Humanoid Control for Unity v4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Passer.MechanicalJoint Class Reference

Description

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 Member Functions

Vector3 GetLocalPosition ()
 
Vector3 GetWorldPosition (Vector3 localPosition)
 
virtual void Awake ()
 
virtual void Start ()
 
virtual void FixedUpdate ()
 
virtual void OnDestroy ()
 
void UpdateEvents ()
 
virtual void OnDrawGizmosSelected ()
 
Vector3 ProjectPointOnPlane (Vector3 point, Vector3 planeOrigin, Vector3 planeNormal)
 

Protected Attributes

Rigidbody rb
 
Transform t
 
float xValue
 
float yValue
 
float zValue
 
float angleValue
 
Vector3 speed
 
float rotationSpeed
 

Static Protected Attributes

static string[] sliderEventTypeLabels
 

Member Function Documentation

◆ LerpX()

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

◆ LerpY()

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

◆ LerpZ()

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

Member Data Documentation

◆ limitX

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.

◆ limitY

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.

◆ limitZ

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.

◆ basePosition

Vector3 Passer.MechanicalJoint.basePosition

The base position for the bounds.

The minLocalPosition and maxLocalPosition are relative to the basePosition.

◆ minLocalPosition

Vector3 Passer.MechanicalJoint.minLocalPosition

The minimum local position.

This localPosition is relative to the basePosition.

◆ maxLocalPosition

Vector3 Passer.MechanicalJoint.maxLocalPosition

The maximum local position.

This localPosition is relative to the basePosition.

◆ limitAngle

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.

◆ minLocalAngle

float Passer.MechanicalJoint.minLocalAngle

The maximum angle around the limitAngleAxis.

When this is zero, the local rotation is locked.

◆ maxLocalAngle

float Passer.MechanicalJoint.maxLocalAngle

The maximum angle around the limitAngleAxis.

When this is zero, the local rotation is locked.

◆ gameObjectEvent

GameObjectEventHandlers Passer.MechanicalJoint.gameObjectEvent
Initial value:
= new GameObjectEventHandlers() {
label = "GameObject Event",
id = 0,
tooltip = "Call functions based on the GameObject life cycle",
eventTypeLabels = new string[] {
"Never",
"Start",
"On Destroy",
"Update",
" ",
" ",
" "
}
}

◆ sliderEventTypeLabels

string [] Passer.MechanicalJoint.sliderEventTypeLabels
staticprotected
Initial value:
= new string[] {
"Never",
"On Min",
"On Max",
"While Min",
"While Max",
"On Change",
"Continuous"
}

◆ xSliderEvents

FloatEventHandlers Passer.MechanicalJoint.xSliderEvents
Initial value:
= new FloatEventHandlers() {
label = "X Axis",
id = 1,
eventTypeLabels = sliderEventTypeLabels,
tooltip =
"Call function using the X axis range value\n" +
"Parameter: the range along the X axis (-1..1)"
}

◆ ySliderEvents

FloatEventHandlers Passer.MechanicalJoint.ySliderEvents
Initial value:
= new FloatEventHandlers() {
label = "Y Axis",
id = 2,
eventTypeLabels = sliderEventTypeLabels,
tooltip =
"Call function using the Y axis range value\n" +
"Parameter: the range along the Y axis (-1..1)"
}

◆ zSliderEvents

FloatEventHandlers Passer.MechanicalJoint.zSliderEvents
Initial value:
= new FloatEventHandlers() {
label = "Z Axis",
id = 3,
eventTypeLabels = sliderEventTypeLabels,
tooltip =
"Call function using the Z axis range value\n" +
"Parameter: the range along the Z axis (-1..1)"
}

◆ angleEvents

FloatEventHandlers Passer.MechanicalJoint.angleEvents
Initial value:
= new FloatEventHandlers() {
label = "Angle",
id = 4,
eventTypeLabels = sliderEventTypeLabels,
}

The documentation for this class was generated from the following file: