Class: BulldogPhysics::CollisionData
- Inherits:
-
Object
- Object
- BulldogPhysics::CollisionData
- Defined in:
- lib/RigidBodies/collision_shapes.rb
Instance Attribute Summary collapse
-
#contacts ⇒ Object
Returns the value of attribute contacts.
-
#contacts_count ⇒ Object
Returns the value of attribute contacts_count.
-
#contacts_left ⇒ Object
Returns the value of attribute contacts_left.
-
#current_contact ⇒ Object
Returns the value of attribute current_contact.
-
#friction ⇒ Object
Returns the value of attribute friction.
-
#restitution ⇒ Object
Returns the value of attribute restitution.
-
#tolerance ⇒ Object
Returns the value of attribute tolerance.
Instance Method Summary collapse
- #add_contacts(count) ⇒ Object
- #has_more_contacts ⇒ Object
-
#initialize ⇒ CollisionData
constructor
A new instance of CollisionData.
- #reset(max_contacts) ⇒ Object
Constructor Details
#initialize ⇒ CollisionData
Returns a new instance of CollisionData.
65 66 67 68 69 |
# File 'lib/RigidBodies/collision_shapes.rb', line 65 def initialize() @contacts = Array.new @current_contact = @contacts_count = @contacts_left = 0 @friction = @restitution = @tolerance = 0.0 end |
Instance Attribute Details
#contacts ⇒ Object
Returns the value of attribute contacts.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def contacts @contacts end |
#contacts_count ⇒ Object
Returns the value of attribute contacts_count.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def contacts_count @contacts_count end |
#contacts_left ⇒ Object
Returns the value of attribute contacts_left.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def contacts_left @contacts_left end |
#current_contact ⇒ Object
Returns the value of attribute current_contact.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def current_contact @current_contact end |
#friction ⇒ Object
Returns the value of attribute friction.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def friction @friction end |
#restitution ⇒ Object
Returns the value of attribute restitution.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def restitution @restitution end |
#tolerance ⇒ Object
Returns the value of attribute tolerance.
63 64 65 |
# File 'lib/RigidBodies/collision_shapes.rb', line 63 def tolerance @tolerance end |
Instance Method Details
#add_contacts(count) ⇒ Object
81 82 83 84 85 86 |
# File 'lib/RigidBodies/collision_shapes.rb', line 81 def add_contacts(count) @contacts_left -= count @contacts_count += count @current_contact += count end |
#has_more_contacts ⇒ Object
71 72 73 |
# File 'lib/RigidBodies/collision_shapes.rb', line 71 def has_more_contacts() @contacts_left > 0 end |
#reset(max_contacts) ⇒ Object
75 76 77 78 79 |
# File 'lib/RigidBodies/collision_shapes.rb', line 75 def reset(max_contacts) @contacts_left = max_contacts @contacts_count = 0 @current_contact = 0 end |