![]() |
Humanoid Control for Unity v4
|
Mechanical Joints can be used to limit the movements of a Kinematic Rigidbody in local space.
Inherits MonoBehaviour.
Public Types | |
| enum | RotationMethod { AngleDifference , PositionDifference } |
Public Member Functions | |
| void | LerpX (float f) |
| Linearly interpolates between min and maxLocalPostion.x. | |
| void | LerpY (float f) |
| Linearly interpolates between min and maxLocalPostion.y. | |
| void | LerpZ (float f) |
| Linearly interpolates between min and maxLocalPostion.z. | |
| Vector3 | GetCorrectionVector () |
| Quaternion | GetCorrectionRotation () |
| Quaternion | GetCorrectionAxisRotation () |
| Quaternion | GetCorrectionAxisRotation_old () |
| Quaternion | GetCorrectionAxisRotation2 () |
| void | MoveForward (float speedZ) |
| void | MoveSideward (float speedX) |
| void | MoveUpward (float speedY) |
| void | SetSpeed (Vector3 speed) |
| void | Rotate (float speed) |
Public Attributes | |
| Transform | parent |
| bool | limitX = true |
| When true, the local X-position is limited. | |
| bool | limitY = true |
| When true, the local Y-position is limited. | |
| bool | limitZ = true |
| When true, the local Z-position is limited. | |
| Vector3 | basePosition |
| The base position for the bounds. | |
| Vector3 | minLocalPosition |
| The minimum local position. | |
| Vector3 | maxLocalPosition |
| The maximum local position. | |
| Quaternion | baseRotation = Quaternion.identity |
| The base rotation for the bounds. | |
| bool | limitAngle = true |
| When the the local rotation is limited. | |
| float | minLocalAngle |
| The maximum angle around the limitAngleAxis. | |
| float | maxLocalAngle |
| The maximum angle around the limitAngleAxis. | |
| Vector3 | limitAngleAxis = Vector3.up |
| The axis around which the Rigidbody can rotate. | |
| RotationMethod | rotationMethod |
| GameObjectEventHandlers | gameObjectEvent |
| FloatEventHandlers | xSliderEvents |
| FloatEventHandlers | ySliderEvents |
| FloatEventHandlers | zSliderEvents |
| FloatEventHandlers | angleEvents |
Protected Attributes | |
| Rigidbody | rb |
| Transform | t |
| float | xValue |
| float | yValue |
| float | zValue |
| float | angleValue |
| Vector3 | speed |
| float | rotationSpeed |
Static Protected Attributes | |
| static string[] | sliderEventTypeLabels |
| void Passer.MechanicalJoint.LerpX | ( | float | f | ) |
Linearly interpolates between min and maxLocalPostion.x.
0 matches the minLocalPosition on the X axis 1 matches the maxLocalPosition on the X axis
| void Passer.MechanicalJoint.LerpY | ( | float | f | ) |
Linearly interpolates between min and maxLocalPostion.y.
0 matches the minLocalPosition on the Y axis 1 matches the maxLocalPosition on the Y axis
| void Passer.MechanicalJoint.LerpZ | ( | float | f | ) |
Linearly interpolates between min and maxLocalPostion.z.
0 matches the minLocalPosition on the Z axis 1 matches the maxLocalPosition on the Z axis
| bool Passer.MechanicalJoint.limitX = true |
When true, the local X-position is limited.
The limits are set by the X member of the minLocalPosition and maxLocalPosition When the bounds are both zero, the local X position is locked.
| bool Passer.MechanicalJoint.limitY = true |
When true, the local Y-position is limited.
The limits are set by the Y member of the minLocalPosition and maxLocalPosition When the bounds are both zero, the local Y position is locked.
| bool Passer.MechanicalJoint.limitZ = true |
When true, the local Z-position is limited.
The limits are set by the Z member of the minLocalPosition and maxLocalPosition When the bounds are both zero, the local Z position is locked.
| Vector3 Passer.MechanicalJoint.basePosition |
The base position for the bounds.
The minLocalPosition and maxLocalPosition are relative to the basePosition.
| Vector3 Passer.MechanicalJoint.minLocalPosition |
The minimum local position.
This localPosition is relative to the basePosition.
| Vector3 Passer.MechanicalJoint.maxLocalPosition |
The maximum local position.
This localPosition is relative to the basePosition.
| bool Passer.MechanicalJoint.limitAngle = true |
When the the local rotation is limited.
The limitation is determined by a maxLocalAngle around the limitAnglesAxis. With this limitation, the rigidbody can only rotated around the limmitAngleAxis.
| float Passer.MechanicalJoint.minLocalAngle |
The maximum angle around the limitAngleAxis.
When this is zero, the local rotation is locked.
| float Passer.MechanicalJoint.maxLocalAngle |
The maximum angle around the limitAngleAxis.
When this is zero, the local rotation is locked.
| GameObjectEventHandlers Passer.MechanicalJoint.gameObjectEvent |
|
staticprotected |
| FloatEventHandlers Passer.MechanicalJoint.xSliderEvents |
| FloatEventHandlers Passer.MechanicalJoint.ySliderEvents |
| FloatEventHandlers Passer.MechanicalJoint.zSliderEvents |
| FloatEventHandlers Passer.MechanicalJoint.angleEvents |