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

Description

The target rig or skeleton for an insect.

Inheritance diagram for Creatures.Insects.Rig:
Creatures.Rig

Public Member Functions

override void Pose ()
 Pose the target rig using the IK targets.
override void MatchTo (Creature creature, ref bool somethingChanged)
 Align the target rig with a creature.
override void AlignPose ()
 Align the pose.
void GroundFeet ()
void AlignFeetToGround ()
void MatchTo (Creature creature)
 Align the target rig with a creature.
void AlignPair (Transform leftTransform, Transform rightTransform)
 Align a pair of bones.

Static Public Member Functions

static Quaternion TargetToBoneRotation (Transform bone, Transform nextBone, Vector3 up)
 Compute the rotation from the target to the creature's bone.
static Quaternion TargetToBoneRotation (Transform bone, Transform nextBone)
static Quaternion TargetToBoneRotation (Transform bone, Vector3 forward, Vector3 up)
 Compute the rotation from the target to the creature's bone.

Public Attributes

TailTarget tail
LegTarget leftFrontLeg
 The left front leg.
LegTarget leftMiddleLeg
 The left middle leg.
LegTarget leftBackLeg
 The left hind leg.
LegTarget rightFrontLeg
 The right front leg.
LegTarget rightMiddleLeg
 The right middle leg.
LegTarget rightBackLeg
 The right hindLeg.
HeadTarget head
 The target for the Head pose.
TorsoTarget torso
 The target for the thorax pose.

Protected Member Functions

void GroundFoot (LegTarget leg)
 Align the foot inverse kinematics targets to the floor.
void AlignFootToGround (LegTarget leg)
float DistanceToGround (Vector3 position, out Vector3 groundNormal)
virtual void Awake ()
 Unity calls Awake when loading an instance of a script component.

Static Protected Member Functions

static Transform FindModel (Transform creatureTransform)
 Find the creature 3D model in the hierarchy.

Protected Attributes

Animator animator
 The animator for the creature.

Properties

HeadTarget insectHead [get]
 The insect-specific head target.
LegTarget[] legs [get]
 All legs of the insect.

Member Function Documentation

◆ Pose()

override void Creatures.Insects.Rig.Pose ( )
virtual

Pose the target rig using the IK targets.

Reimplemented from Creatures.Rig.

◆ MatchTo() [1/2]

override void Creatures.Insects.Rig.MatchTo ( Creature creature,
ref bool anythingChanged )
virtual

Align the target rig with a creature.

Parameters
creatureThe creature to align to
anythingChangedTrue when any property of the creature has changed

Reimplemented from Creatures.Rig.

◆ AlignPose()

override void Creatures.Insects.Rig.AlignPose ( )
virtual

Align the pose.

This will

  • Put ik targets for each left/right pari at the same height
  • Put ik targets for each left/right pair in the same forward position
  • Put ik targets for each left/right pair symmetric in the sideward direciton

Reimplemented from Creatures.Rig.

◆ GroundFoot()

void Creatures.Insects.Rig.GroundFoot ( LegTarget leg)
protected

Align the foot inverse kinematics targets to the floor.

Parameters
legThe leg target to align

◆ MatchTo() [2/2]

void Creatures.Rig.MatchTo ( Creature creature)
inherited

Align the target rig with a creature.

Parameters
creatureThe creature to align to

◆ FindModel()

Transform Creatures.Rig.FindModel ( Transform creatureTransform)
staticprotectedinherited

Find the creature 3D model in the hierarchy.

Parameters
creatureTransformThe (root) transform of the creature
Returns
The transform with the model or null if it could not be found

◆ TargetToBoneRotation() [1/2]

Quaternion Creatures.Rig.TargetToBoneRotation ( Transform bone,
Transform nextBone,
Vector3 up )
staticinherited

Compute the rotation from the target to the creature's bone.

Parameters
boneThe creature's bone for this target
nextBoneThe next bone in the creature's hierarchy
Returns
The rotation from the target bone rotation to the creature bone rotation

The next bone is used to compute the direction of the bone. The 'up'-direction of the bone is currently fixed to (world) up.

◆ TargetToBoneRotation() [2/2]

Quaternion Creatures.Rig.TargetToBoneRotation ( Transform bone,
Vector3 forward,
Vector3 up )
staticinherited

Compute the rotation from the target to the creature's bone.

Parameters
boneThe creature's bone for this target
forwardThe forward direction of the bone
upThe up direction of the bone
Returns

◆ AlignPair()

void Creatures.Rig.AlignPair ( Transform leftTransform,
Transform rightTransform )
inherited

Align a pair of bones.

Parameters
leftTransformThe transform of the left side bone
rightTransformThe transform of the right side bone

This will

  • Put the transforms at the same height
  • Put the transforms in the same forward position
  • Put the transforms symmetric in the sideward direciton relative to the rig.

Member Data Documentation

◆ tail

TailTarget Creatures.Insects.Rig.tail

The target for the tail pose

◆ animator

Animator Creatures.Rig.animator
protectedinherited

The animator for the creature.

This is optional


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