Moved collision/physics information into manifest, made real mouse cursor always invisible and use 'virtual' cursor when needed.

This commit is contained in:
2019-09-28 13:29:21 -05:00
parent e038dcbe24
commit 40d1105fb8
13 changed files with 32 additions and 30 deletions

View File

@@ -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

View File

@@ -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