Gravity constant moved into constants.rb, camera can now report what it is looking at, entity has knowledge of camera now, AABB tree search can now use either BoundingBox or Ray colliders

This commit is contained in:
2019-08-13 09:47:23 -05:00
parent 771b6a4247
commit 016e8109de
9 changed files with 57 additions and 33 deletions

View File

@@ -7,7 +7,7 @@ class IMICFPS
attr_accessor :scale, :visible, :renderable, :backface_culling
attr_accessor :position, :rotation, :velocity
attr_reader :name, :debug_color, :bounding_box, :collision, :physics, :mass, :drag
attr_reader :name, :debug_color, :bounding_box, :collision, :physics, :mass, :drag, :camera
def initialize(x: 0, y: 0, z: 0, bound_model: nil, scale: MODEL_METER_SCALE, backface_culling: true, auto_manage: true, manifest_file: nil)
@position = Vector.new(x, y, z)
@@ -43,6 +43,8 @@ class IMICFPS
normalize_bounding_box
end
@camera = nil
return self
end
@@ -70,6 +72,14 @@ class IMICFPS
@bound_model = nil
end
def attach_camera(camera)
@camera = camera
end
def detach_camera
@camera = nil
end
def setup
end