All Classes Namespaces Functions Variables Enumerations Properties Pages
Public Member Functions | Public Attributes | Properties | List of all members
IKSolverAim Class Reference

Rotates a hierarchy of bones to make a Transform aim at a target. If there are problems with continuity and the solver get's jumpy, make sure to keep IKPosition at a safe distance from the transform and try decreasing solver and bone weights. More...

Inheritance diagram for IKSolverAim:
Inheritance graph
[legend]
Collaboration diagram for IKSolverAim:
Collaboration graph
[legend]

Public Member Functions

float GetAngle ()
 Gets the angular offset. More...
 
- Public Member Functions inherited from IKSolverHeuristic
bool SetChain (Transform[] hierarchy, Transform root)
 Rebuild the bone hierarcy and reinitiate the solver. More...
 
override void StoreDefaultLocalState ()
 Stores the default local state for the bones used by the solver. More...
 
override void FixTransforms ()
 Fixes all the Transforms used by the solver to their initial state. More...
 
override bool IsValid (bool log)
 Determines whether this instance is valid or not. If log == true, will log a warning message in case of an invalid solver. More...
 
override IKSolver.Point[] GetPoints ()
 Gets all the points used by the solver. More...
 
override IKSolver.Point GetPoint (Transform transform)
 Gets the point with the specified Transform. More...
 
- Public Member Functions inherited from IKSolver
void Initiate (Transform root)
 Initiate the solver with specified root Transform. Use only if this IKSolver is not a member of an IK component. More...
 
void Update ()
 Updates the IK solver. Use only if this IKSolver is not a member of an IK component or the IK component has been disabled and you intend to manually control the updating. More...
 
Vector3 GetIKPosition ()
 Gets the IK position. NOTE: You are welcome to read IKPosition directly, this method is here only to match the Unity's built in IK API. More...
 
void SetIKPosition (Vector3 position)
 Sets the IK position. NOTE: You are welcome to set IKPosition directly, this method is here only to match the Unity's built in IK API. More...
 
float GetIKPositionWeight ()
 Gets the IK position weight. NOTE: You are welcome to read IKPositionWeight directly, this method is here only to match the Unity's built in IK API. More...
 
void SetIKPositionWeight (float weight)
 Sets the IK position weight. NOTE: You are welcome to set IKPositionWeight directly, this method is here only to match the Unity's built in IK API. More...
 
Transform GetRoot ()
 Gets the root Transform. More...
 
delegate void UpdateDelegate ()
 Delegates solver update events. More...
 
delegate void IterationDelegate (int i)
 Delegates solver iteration events. More...
 

Public Attributes

Transform transform
 The transform that we want to aim at IKPosition. More...
 
Vector3 axis = Vector3.forward
 The local axis of the Transform that you want to be aimed at IKPosition. More...
 
Vector3 poleAxis = Vector3.up
 Keeps that axis of the Aim Transform directed at the polePosition. More...
 
Vector3 polePosition
 The position in world space to keep the pole axis of the Aim Transform directed at. More...
 
float poleWeight
 The weight of the Pole. More...
 
Transform poleTarget
 If assigned, will automatically set polePosition to the position of this Transform. More...
 
float clampWeight = 0.1f
 Clamping rotation of the solver. 0 is free rotation, 1 is completely clamped to transform axis. More...
 
int clampSmoothing = 2
 Number of sine smoothing iterations applied to clamping to make it smoother. More...
 
IterationDelegate OnPreIteration
 Called before each iteration of the solver. More...
 
- Public Attributes inherited from IKSolverHeuristic
Transform target
 The target Transform. Solver IKPosition will be automatically set to the position of the target. More...
 
float tolerance = 0f
 Minimum distance from last reached position. Will stop solving if difference from previous reached position is less than tolerance. If tolerance is zero, will iterate until maxIterations. More...
 
int maxIterations = 4
 Max iterations per frame More...
 
bool useRotationLimits = true
 If true, rotation limits (if excisting) will be applied on each iteration. More...
 
Bone[] bones = new Bone[0]
 The hierarchy of bones. More...
 
- Public Attributes inherited from IKSolver
Vector3 IKPosition
 The IK position. More...
 
float IKPositionWeight = 1f
 The IK position weight. More...
 
UpdateDelegate OnPreInitiate
 Called before initiating the solver. More...
 
UpdateDelegate OnPostInitiate
 Called after initiating the solver. More...
 
UpdateDelegate OnPreUpdate
 Called before updating. More...
 
UpdateDelegate OnPostUpdate
 Called after writing the solved pose More...
 

Properties

Vector3 transformAxis [get]
 Gets the Axis of the AimTransform is world space. More...
 
Vector3 transformPoleAxis [get]
 Gets the Pole Axis of the AimTransform is world space. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IKSolver
static Transform ContainsDuplicateBone (Bone[] bones)
 Checks if an array of objects contains any duplicates. More...
 

Detailed Description

Rotates a hierarchy of bones to make a Transform aim at a target. If there are problems with continuity and the solver get's jumpy, make sure to keep IKPosition at a safe distance from the transform and try decreasing solver and bone weights.