mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Moved collision/physics information into manifest, made real mouse cursor always invisible and use 'virtual' cursor when needed.
This commit is contained in:
@@ -8,9 +8,6 @@ class IMICFPS
|
||||
|
||||
def setup
|
||||
bind_model
|
||||
@collision = :dynamic
|
||||
@physics = true
|
||||
|
||||
@speed = 2.5 # meter's per second
|
||||
@running_speed = 5.0 # meter's per second
|
||||
@turn_speed = 50.0
|
||||
|
||||
@@ -7,7 +7,7 @@ class IMICFPS
|
||||
|
||||
attr_accessor :scale, :visible, :renderable, :backface_culling
|
||||
attr_accessor :position, :orientation, :velocity
|
||||
attr_reader :name, :debug_color, :bounding_box, :collision, :physics, :mass, :drag, :camera
|
||||
attr_reader :name, :debug_color, :bounding_box, :drag, :camera, :manifest
|
||||
|
||||
def initialize(manifest:, map_entity: nil, spawnpoint: nil, backface_culling: true, auto_manage: true)
|
||||
@manifest = manifest
|
||||
@@ -27,14 +27,6 @@ class IMICFPS
|
||||
|
||||
@debug_color = Color.new(0.0, 1.0, 0.0)
|
||||
|
||||
@collidable = [:static, :dynamic]
|
||||
# :dynamic => moves in response,
|
||||
# :static => does not move ever,
|
||||
# :none => no collision check, entities can pass through
|
||||
@collision = :static
|
||||
@physics = @manifest.physics # Entity affected by gravity and what not
|
||||
@mass = 100 # kg
|
||||
|
||||
@last_position = Vector.new(@position.x, @position.y, @position.z)
|
||||
|
||||
@sandboxes = []
|
||||
@@ -61,7 +53,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def collidable?
|
||||
@collidable.include?(@collision)
|
||||
@manifest.collision
|
||||
end
|
||||
|
||||
def bind_model
|
||||
|
||||
Reference in New Issue
Block a user