Class: Box2D::RevoluteJoint
Constant Summary
Constants inherited
from Joint
Joint::ID_CLASS
Instance Attribute Summary
Attributes inherited from Joint
#body_a, #body_b
Attributes inherited from Handle
#id, #world
Instance Method Summary
collapse
Methods inherited from Joint
#collide_connected=, #collide_connected?, #constraint_force, #constraint_torque, #destroy, #initialize, #invalidate_from_body!, #user_data, #user_data=
Methods inherited from Handle
#destroyed?, #eql?, #hash, #initialize, #valid?
Constructor Details
This class inherits a constructor from Box2D::Joint
Instance Method Details
#angle ⇒ Object
74
75
76
77
|
# File 'lib/box2d/joint.rb', line 74
def angle
ensure_valid!
Native.b2RevoluteJoint_GetAngle(@id)
end
|
#limits ⇒ Object
99
100
101
102
|
# File 'lib/box2d/joint.rb', line 99
def limits
ensure_valid!
Native.b2RevoluteJoint_GetLowerLimit(@id)..Native.b2RevoluteJoint_GetUpperLimit(@id)
end
|
#motor_enabled=(value) ⇒ Object
94
95
96
97
|
# File 'lib/box2d/joint.rb', line 94
def motor_enabled=(value)
ensure_valid!
Native.b2RevoluteJoint_EnableMotor(@id, !!value)
end
|
#motor_enabled? ⇒ Boolean
89
90
91
92
|
# File 'lib/box2d/joint.rb', line 89
def motor_enabled?
ensure_valid!
Native.b2RevoluteJoint_IsMotorEnabled(@id)
end
|
#motor_speed ⇒ Object
79
80
81
82
|
# File 'lib/box2d/joint.rb', line 79
def motor_speed
ensure_valid!
Native.b2RevoluteJoint_GetMotorSpeed(@id)
end
|
#motor_speed=(value) ⇒ Object
84
85
86
87
|
# File 'lib/box2d/joint.rb', line 84
def motor_speed=(value)
ensure_valid!
Native.b2RevoluteJoint_SetMotorSpeed(@id, ValueConversion.finite_float(value, label: "motor_speed"))
end
|