Class: MSPhysics::Contact
- Defined in:
- RubyExtension/MSPhysics/contact.rb
Overview
The Contact class represents an individual collision contact.
Instance Attribute Summary collapse
-
#force ⇒ Geom::Vector3d
readonly
Get contact force in Newtons.
-
#normal ⇒ Geom::Vector3d
readonly
Get contact normal.
-
#point ⇒ Geom::Point3d
readonly
Get contact point.
-
#speed ⇒ Numeric
readonly
Get contact speed in meters per second.
-
#toucher ⇒ Body
readonly
Get contact body.
Instance Method Summary collapse
-
#initialize(toucher, point, normal, force, speed) ⇒ Contact
constructor
A new instance of Contact.
Methods inherited from Entity
Constructor Details
#initialize(toucher, point, normal, force, speed) ⇒ Contact
Returns a new instance of Contact.
12 13 14 15 16 17 18 |
# File 'RubyExtension/MSPhysics/contact.rb', line 12 def initialize(toucher, point, normal, force, speed) @toucher = toucher @point = Geom::Point3d.new(point.to_a) @normal = Geom::Vector3d.new(normal.to_a).normalize @force = Geom::Vector3d.new(force.to_a) @speed = speed.to_f end |
Instance Attribute Details
#force ⇒ Geom::Vector3d (readonly)
Get contact force in Newtons.
|
# File 'RubyExtension/MSPhysics/contact.rb', line 32
|
#normal ⇒ Geom::Vector3d (readonly)
Get contact normal.
|
# File 'RubyExtension/MSPhysics/contact.rb', line 28
|
#point ⇒ Geom::Point3d (readonly)
Get contact point.
|
# File 'RubyExtension/MSPhysics/contact.rb', line 24
|
#speed ⇒ Numeric (readonly)
Get contact speed in meters per second.
|
# File 'RubyExtension/MSPhysics/contact.rb', line 36
|