Creature Control for Unity v0.1
Loading...
Searching...
No Matches
Creatures.LegTarget Class Reference

Description

A leg in a TargetRig which is used to control a leg in a model.

Inheritance diagram for Creatures.LegTarget:
Creatures.Target

Public Member Functions

override void MatchTo (Bone bone)
 Function to match the target to the selected bone.
override void Unmatch ()
 Set properties for the case no matching bone exists.
void PoseTargetLimb ()
 Pose the target limb.
void UpdateBones (Leg leg)
 Update the bones of the from this target.
virtual void Align ()
 Align the pose.
virtual void UpdateBones (Bone bone)
 Update the pose of the bone from this target.

Static Public Member Functions

static float CosineRule (float a, float b, float c)
 Implementation of the Law of Cosines.

Public Attributes

Transform coxaTarget
 The target for the coxa bone.
Transform femurTarget
 The target for the femur bone.
Transform tibiaTarget
 The target for the tibia bone.
Transform tarsus
 The target for the tarsus bone.
Transform phalangesTarget
 The target for the phalanges bone.
Transform end
 The end target of the leg chain.
Transform tarsusEnd
 The end transform of the tarsus.
float length
 The length of the leg from hip to foot.
float femurLength
 The length of the femur target.
float tibiaLength
 The length of the tibia target.
float tarsusLength
 The length fo the tarsus target.
Transform ikTarget
 The target for the inverse kinematics.
LegTarget otherLeg
 The target of the leg on the other Side of the body.
Quaternion targetToBoneFemur
 The rotation to get from the target to the models' femur bone.
Quaternion targetToBoneTibia
 The rotation to get from the target to the models' tibia bone.
Quaternion targetToBoneTarsus
 The rotation to get from the target to the models' tarsus bone.
Rig rig
 The target Rig to which this target belongs.
bool isMatched = false
 Is this target matched to a bone?
Quaternion targetToBone
 The rotation to transform the target rotation into the rotation of the bone in the model.

Protected Member Functions

Quaternion FemurRotation (Vector3 targetPosition)
 Calculate the femur target orientation in world space.
Quaternion TibiaRotation (Vector3 targetPosition)
 Calculate the tibia target orientation in world space.
Vector3 GetTibiaUpWorld ()
Quaternion TarsusRotation (Quaternion targetRotation)
 Calculates the tarsus rotation in world space.
void UpdateFemur (Transform femurBone)
 Update the pose of the femur bone based on its target.
void UpdateTibia (Transform tibiaBone)
 Update the pose of the tibia bone based on its target.
void UpdateTarsus (Transform tarsusBone)
 Update the pose of the tarsus bone based on its target.

Member Function Documentation

◆ MatchTo()

override void Creatures.LegTarget.MatchTo ( Bone bone)
virtual

Function to match the target to the selected bone.

Parameters
boneThe bone to match to

This will put the target at the bone position and orientation and calculate the targetToBone rotation When the bone is null, the value isMatched will become false

Reimplemented from Creatures.Target.

◆ Unmatch()

override void Creatures.LegTarget.Unmatch ( )
virtual

Set properties for the case no matching bone exists.

Reimplemented from Creatures.Target.

◆ UpdateBones() [1/2]

void Creatures.LegTarget.UpdateBones ( Leg leg)

Update the bones of the from this target.

Parameters
legThe creature's leg to update

◆ FemurRotation()

Quaternion Creatures.LegTarget.FemurRotation ( Vector3 targetPosition)
protected

Calculate the femur target orientation in world space.

Parameters
targetPositionThe inverse kinematics target position
Returns
The target orientation, may be identity when either the femur or tibia target is not defined

◆ TibiaRotation()

Quaternion Creatures.LegTarget.TibiaRotation ( Vector3 targetPosition)
protected

Calculate the tibia target orientation in world space.

Parameters
targetPosition
Returns
The target orientation, may be identity when the tibia target is not defined

◆ TarsusRotation()

Quaternion Creatures.LegTarget.TarsusRotation ( Quaternion targetRotation)
protected

Calculates the tarsus rotation in world space.

Parameters
targetRotationThe orientation of the inverse kinematics target
Returns
The tarsus orientation

◆ UpdateFemur()

void Creatures.LegTarget.UpdateFemur ( Transform femurBone)
protected

Update the pose of the femur bone based on its target.

Parameters
femurBoneThe femure bone Transform

◆ UpdateTibia()

void Creatures.LegTarget.UpdateTibia ( Transform tibiaBone)
protected

Update the pose of the tibia bone based on its target.

Parameters
tibiaBoneThe tibia bone Transform

◆ UpdateTarsus()

void Creatures.LegTarget.UpdateTarsus ( Transform tarsusBone)
protected

Update the pose of the tarsus bone based on its target.

Parameters
tarsusBoneThe tarsus bone Transform

◆ CosineRule()

float Creatures.LegTarget.CosineRule ( float a,
float b,
float c )
static

Implementation of the Law of Cosines.

Parameters
aSide a of the triangle
bSide b of the triangle
cSide c of the triangle
Returns
The angle between sides a and b

◆ Align()

virtual void Creatures.Target.Align ( )
virtualinherited

Align the pose.

This will make the pose of the creature symmetric

Reimplemented in Creatures.HeadTarget, Creatures.Insects.HeadTarget, and Creatures.TailTarget.

◆ UpdateBones() [2/2]

virtual void Creatures.Target.UpdateBones ( Bone bone)
virtualinherited

Update the pose of the bone from this target.

Parameters
boneThe bone for which the pose is updated

Reimplemented in Creatures.Insects.AntennaTarget, and Creatures.Insects.HeadTarget.

Member Data Documentation

◆ coxaTarget

Transform Creatures.LegTarget.coxaTarget

The target for the coxa bone.

Another name is the hip bone

◆ femurTarget

Transform Creatures.LegTarget.femurTarget

The target for the femur bone.

Another name is the upper leg or thigh

This target is currently not supported

◆ tibiaTarget

Transform Creatures.LegTarget.tibiaTarget

The target for the tibia bone.

Another name is the lower leg or shank

◆ tarsus

Transform Creatures.LegTarget.tarsus

The target for the tarsus bone.

Another name is the foot

◆ phalangesTarget

Transform Creatures.LegTarget.phalangesTarget

The target for the phalanges bone.

Another name is the toes No individual toe bones are supported

This target is currently not supported

◆ length

float Creatures.LegTarget.length

The length of the leg from hip to foot.

This is used for the inverse kinematics calculations

◆ ikTarget

Transform Creatures.LegTarget.ikTarget

The target for the inverse kinematics.

This target is normalle at the foot bone


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