Class R.components.physics.RevoluteJoint
Extends
R.components.physics.BaseMotorJoint.
A revolute joint which allows two bodies to revolve around a common
anchor point in a R.physics.Simulation.
Defined in: revolutejoint.js.
Constructor Attributes | Constructor Name and Description |
---|---|
R.components.physics.RevoluteJoint(name, body1, body2, anchor)
Creates a revolute joint between two physical bodies.
|
- Fields borrowed from class R.components.Base:
- TYPE_COLLIDER, TYPE_INPUT, TYPE_LOGIC, TYPE_RENDERING, TYPE_TRANSFORM
Method Attributes | Method Name and Description |
---|---|
Clear the translation limits.
|
|
Get the class name of this object
|
|
During simulation, this returns the current angle of the joint
in degrees.
|
|
Get the lower limit of translation, in meters, through which the joint can travel.
|
|
Get the lower limiting angle, in degrees, through which the joint can rotate.
|
|
Get the upper limit of translation, in meters, through which the joint can travel.
|
|
Get the upper limiting angle, in degrees, through which the joint can rotate.
|
|
offset(pt)
Offset the joint's anchors by the given point
|
|
setLowerLimit(limit)
Set the lower limit of translation through which the joint can travel.
|
|
setLowerLimitAngle(angle)
Set the upper limiting angle through which the joint can rotate.
|
|
setUpperLimit(limit)
Set the upper limit of translation through which the joint can travel.
|
|
setUpperLimitAngle(angle)
Set the upper limiting angle through which the joint can rotate.
|
- Methods borrowed from class R.components.physics.BaseMotorJoint:
- clearForce, getMotorForce, getMotorSpeed, getReactionForce, getReactionTorque, setMotorForce, setMotorSpeed
- Methods borrowed from class R.components.physics.BaseJoint:
- getBody1, getBody2, getCollideBodies, getJoint, getJointDef, getSimulation, setBody1, setBody2, setCollideBodies, startSimulation, stopSimulation
- Methods borrowed from class R.components.Base:
- execute, getGameObject, getHostObject, getPriority, getType, getTypeString, release, setGameObject, setHostObject, setPriority
- Methods borrowed from class R.engine.BaseObject:
- addEvent, addEvents, destroy, getElement, jQ, removeEvent, setElement, triggerEvent, update
- Methods borrowed from class R.engine.PooledObject:
- clearObjectDataModel, getId, getName, getObjectDataModel, getProperties, isDestroyed, setName, setObjectDataModel, toString, toXML
Class Detail
R.components.physics.RevoluteJoint(name, body1, body2, anchor)
Creates a revolute joint between two physical bodies.
- Parameters:
- name
- {String} Name of the component
- body1
- {R.components.physics.BaseBody} The first body for the joint
- body2
- {R.components.physics.BaseBody} The second body for the joint
- anchor
- {R.math.Point2D} A point, in world coordinates relative to the two bodies, to use as the joint's anchor point
Method Detail
clearLimits()
Clear the translation limits.
Defined in: prismaticjoint.js.
Defined in: prismaticjoint.js.
{String}
getClassName()
Get the class name of this object
- Returns:
- {String} "R.components.physics.RevoluteJoint"
{Number}
getJointAngle()
During simulation, this returns the current angle of the joint
in degrees. Outside of simulation it will always return zero.
- Returns:
- {Number}
{Number}
getLowerLimit()
Get the lower limit of translation, in meters, through which the joint can travel.
Defined in: prismaticjoint.js.
Defined in: prismaticjoint.js.
- Returns:
- {Number}
{Number}
getLowerLimitAngle()
Get the lower limiting angle, in degrees, through which the joint can rotate.
- Returns:
- {Number} The angle, or
undefined
{Number}
getUpperLimit()
Get the upper limit of translation, in meters, through which the joint can travel.
Defined in: prismaticjoint.js.
Defined in: prismaticjoint.js.
- Returns:
- {Number}
{Number}
getUpperLimitAngle()
Get the upper limiting angle, in degrees, through which the joint can rotate.
- Returns:
- {Number} The angle, or
undefined
offset(pt)
Offset the joint's anchors by the given point
Defined in: prismaticjoint.js.
Defined in: prismaticjoint.js.
- Parameters:
- pt
- {R.math.Point2D} The offset amount
setLowerLimit(limit)
Set the lower limit of translation through which the joint can travel.
Defined in: prismaticjoint.js.
Defined in: prismaticjoint.js.
- Parameters:
- limit
- {Number} The limit, in meters
setLowerLimitAngle(angle)
Set the upper limiting angle through which the joint can rotate. Zero is the
"top" of the rotation, with rotation moving positively in a counter-clockwise
rotation. Negative numbers will move the rotation clockwise.
- Parameters:
- angle
- {Number} An angle in degrees
setUpperLimit(limit)
Set the upper limit of translation through which the joint can travel.
Defined in: prismaticjoint.js.
Defined in: prismaticjoint.js.
- Parameters:
- limit
- {Number} The limit, in meters
setUpperLimitAngle(angle)
Set the upper limiting angle through which the joint can rotate. Zero is the
"top" of the rotation, with rotation moving positively in a counter-clockwise
rotation. Negative numbers will move the rotation clockwise.
- Parameters:
- angle
- {Number} An angle in degrees