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

Description

A target rig or skeleton for a creature.

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

Public Member Functions

virtual void Pose ()
 Pose the target rig using the IK targets.
void MatchTo (Creature creature)
 Align the target rig with a creature.
virtual void MatchTo (Creature creature, ref bool anythingChanged)
 Align the target rig with a creature.
virtual void AlignPose ()
 Align the pose.
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

HeadTarget head
 The target for the Head pose.
TorsoTarget torso
 The target for the thorax pose.

Protected Member Functions

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.

Member Function Documentation

◆ Pose()

virtual void Creatures.Rig.Pose ( )
virtual

Pose the target rig using the IK targets.

Reimplemented in Creatures.Insects.Rig.

◆ MatchTo() [1/2]

void Creatures.Rig.MatchTo ( Creature creature)

Align the target rig with a creature.

Parameters
creatureThe creature to align to

◆ MatchTo() [2/2]

virtual void Creatures.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 in Creatures.Insects.Rig.

◆ FindModel()

Transform Creatures.Rig.FindModel ( Transform creatureTransform)
staticprotected

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 )
static

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 )
static

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

◆ AlignPose()

virtual void Creatures.Rig.AlignPose ( )
virtual

Align the pose.

This will

  • Put the leg ik targets on the floor
  • 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 in Creatures.Insects.Rig.

◆ AlignPair()

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

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

◆ animator

Animator Creatures.Rig.animator
protected

The animator for the creature.

This is optional


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