Class: MSPhysics::Plane
- Defined in:
- RubyExtension/MSPhysics/joint_plane.rb
Overview
Constant Summary collapse
- DEFAULT_LINEAR_FRICTION =
0.0
- DEFAULT_ANGULAR_FRICTION =
0.0
- DEFAULT_ROTATION_ENABLED =
false
Constants inherited from Joint
Joint::DEFAULT_BODIES_COLLIDABLE, Joint::DEFAULT_BREAKING_FORCE, Joint::DEFAULT_SOLVER_MODEL, Joint::DEFAULT_STIFFNESS
Instance Method Summary collapse
-
#angular_friction ⇒ Numeric
Get rotation friction.
-
#angular_friction=(value) ⇒ Object
Set rotation friction.
-
#initialize(world, parent, pin_tra, group = nil) ⇒ Plane
constructor
Create a plane joint.
-
#linear_friction ⇒ Numeric
Get movement friction.
-
#linear_friction=(value) ⇒ Object
Set movement friction.
-
#rotation_enabled=(state) ⇒ Object
Enable/disable the rotation along the connected body’s center of mass and the plane’s Z-axis.
-
#rotation_enabled? ⇒ Boolean
Determine whether the rotation along the connected body’s center of mass and the plane’s Z-axis is enabled.
Methods inherited from Joint
#address, all_joints, #bodies_collidable=, #bodies_collidable?, #breaking_force, #breaking_force=, #child, #connect, #connected?, #destroy, #disconnect, #dof, #get_pin_matrix, #get_pin_matrix2, #get_tension1, #get_tension2, #group, joint_by_address, #name, #name=, #parent, #set_pin_matrix, #solver_model, #solver_model=, #stiffness, #stiffness=, #type, #valid?, validate, #world
Methods inherited from Entity
Constructor Details
#initialize(world, parent, pin_tra, group = nil) ⇒ Plane
Create a plane joint.
17 18 19 20 21 22 23 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 17 def initialize(world, parent, pin_tra, group = nil) super(world, parent, pin_tra, group) MSPhysics::Newton::Plane.create(@address) MSPhysics::Newton::Plane.set_linear_friction(@address, DEFAULT_LINEAR_FRICTION) MSPhysics::Newton::Plane.set_angular_friction(@address, DEFAULT_ANGULAR_FRICTION) MSPhysics::Newton::Plane.enable_rotation(@address, DEFAULT_ROTATION_ENABLED) end |
Instance Method Details
#angular_friction ⇒ Numeric
Get rotation friction.
39 40 41 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 39 def angular_friction MSPhysics::Newton::Plane.get_angular_friction(@address) end |
#angular_friction=(value) ⇒ Object
Set rotation friction.
45 46 47 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 45 def angular_friction=(value) MSPhysics::Newton::Plane.set_angular_friction(@address, value) end |
#linear_friction ⇒ Numeric
Get movement friction.
27 28 29 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 27 def linear_friction MSPhysics::Newton::Plane.get_linear_friction(@address) end |
#linear_friction=(value) ⇒ Object
Set movement friction.
33 34 35 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 33 def linear_friction=(value) MSPhysics::Newton::Plane.set_linear_friction(@address, value) end |
#rotation_enabled=(state) ⇒ Object
Enable/disable the rotation along the connected body’s center of mass and the plane’s Z-axis.
59 60 61 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 59 def rotation_enabled=(state) MSPhysics::Newton::Plane.enable_rotation(@address, state) end |
#rotation_enabled? ⇒ Boolean
Determine whether the rotation along the connected body’s center of mass and the plane’s Z-axis is enabled.
52 53 54 |
# File 'RubyExtension/MSPhysics/joint_plane.rb', line 52 def rotation_enabled? MSPhysics::Newton::Plane.rotation_enabled?(@address) end |