mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 16:12:35 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user