Class: BulldogPhysics::CollisionPrimitive
- Inherits:
-
Object
- Object
- BulldogPhysics::CollisionPrimitive
- Defined in:
- lib/RigidBodies/collision_shapes.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#transform ⇒ Object
readonly
Returns the value of attribute transform.
Instance Method Summary collapse
- #calculate_internals ⇒ Object
- #get_axis(index) ⇒ Object
- #get_transform ⇒ Object
-
#initialize ⇒ CollisionPrimitive
constructor
A new instance of CollisionPrimitive.
Constructor Details
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/RigidBodies/collision_shapes.rb', line 5 def body @body end |
#offset ⇒ Object
Returns the value of attribute offset.
5 6 7 |
# File 'lib/RigidBodies/collision_shapes.rb', line 5 def offset @offset end |
#transform ⇒ Object (readonly)
Returns the value of attribute transform.
15 16 17 |
# File 'lib/RigidBodies/collision_shapes.rb', line 15 def transform @transform end |
Instance Method Details
#calculate_internals ⇒ Object
17 18 19 20 |
# File 'lib/RigidBodies/collision_shapes.rb', line 17 def calculate_internals() #puts "OFFSET #{@offset}" @transform = @body.transform_matrix * @offset end |
#get_axis(index) ⇒ Object
22 23 24 |
# File 'lib/RigidBodies/collision_shapes.rb', line 22 def get_axis(index) @transform.getAxisVector(index) end |
#get_transform ⇒ Object
26 27 28 |
# File 'lib/RigidBodies/collision_shapes.rb', line 26 def get_transform @transform end |