VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
void AVR.Avatar.AVR_PoseAssumer.setPosRot ( int  layerIndex)
inlineprotected

Definition at line 146 of file AVR_PoseAssumer.cs.

146  {
147  float layerWeight = animator.GetLayerWeight(layerIndex);
148 
149  {
150  animator.SetLookAtPosition(transform.TransformPoint(provider.lookAtPos));
151  }
152  {
153  animator.bodyPosition = transform.TransformPoint(provider.bodyPos);
154  animator.bodyRotation = transform.rotation * provider.bodyRot;
155  }
156  if(playerRig.leftHandController!=null)
157  {
158  animator.SetIKPosition(AvatarIKGoal.LeftHand, transform.TransformPoint(provider.leftHandPos));
159  animator.SetIKRotation(AvatarIKGoal.LeftHand, transform.rotation * provider.leftHandRot);
160  }
161  if(playerRig.rightHandController != null)
162  {
163  animator.SetIKPosition(AvatarIKGoal.RightHand, transform.TransformPoint(provider.rightHandPos));
164  animator.SetIKRotation(AvatarIKGoal.RightHand, transform.rotation * provider.rightHandRot);
165  }
166  if(!swap_feet)
167  {
168  animator.SetIKPosition(AvatarIKGoal.LeftFoot, transform.TransformPoint(provider.leftFootPos));
169  animator.SetIKRotation(AvatarIKGoal.LeftFoot, transform.rotation * provider.leftFootRot);
170  animator.SetIKPosition(AvatarIKGoal.RightFoot, transform.TransformPoint(provider.rightFootPos));
171  animator.SetIKRotation(AvatarIKGoal.RightFoot, transform.rotation * provider.rightFootRot);
172  }
173  else {
174  animator.SetIKPosition(AvatarIKGoal.LeftFoot, transform.TransformPoint(provider.rightFootPos));
175  animator.SetIKRotation(AvatarIKGoal.LeftFoot, transform.rotation * provider.rightFootRot);
176  animator.SetIKPosition(AvatarIKGoal.RightFoot, transform.TransformPoint(provider.leftFootPos));
177  animator.SetIKRotation(AvatarIKGoal.RightFoot, transform.rotation * provider.leftFootRot);
178  }
179  }
AVR_Controller leftHandController
Returns the AVR_Controller that represents the left hand controller (if it exists). This value depends on the controllerNode value and is not updated if this one is changed during runtime.
bool swap_feet
Swap left and right feet targets. (If the avatar consistently has crossed legs, toggle this) ...
AVR_Controller rightHandController
Returns the AVR_Controller that represents the right hand controller (if it exists). This value depends on the controllerNode value and is not updated if this one is changed during runtime.
AVR_PlayerRig playerRig
The current AVR_PlayerRig instance in the scene