本文整理汇总了C#中HandModel.GetArmRotation方法的典型用法代码示例。如果您正苦于以下问题:C# HandModel.GetArmRotation方法的具体用法?C# HandModel.GetArmRotation怎么用?C# HandModel.GetArmRotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandModel
的用法示例。
在下文中一共展示了HandModel.GetArmRotation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AlignArmHUD
void AlignArmHUD(HandModel handModel)
{
ArmHUDgeom.SetActive(true);
if (targetHandID != handModel.GetInstanceID()) {
// Reinitialize ArmHUD alignment
//Debug.Log ("Reinitialize ArmHUD alignment Time.time = " + Time.time);
smoothedPosition.reset = true;
smoothedRotation.reset = true;
targetHandID = handModel.GetInstanceID();
}
float sqrCos = handModel.GetArmDirection().y;
sqrCos *= sqrCos;
float delay = sqrCos * verticalFilterTime + (1f - sqrCos) * horizontalFilterTime;
//Debug.Log ("delay(sqrCos = " + sqrCos + ", Time.deltaTime = " + Time.deltaTime + ") = " + delay);
smoothedPosition.delay = delay;
smoothedRotation.delay = delay;
Vector3 localArmCenter = transform.parent.InverseTransformPoint (handModel.GetArmCenter ());
Quaternion localArmRotation = Quaternion.Inverse (transform.parent.rotation) * handModel.GetArmRotation ();
transform.localPosition = smoothedPosition.Update(localArmCenter, Time.deltaTime);
transform.localRotation = smoothedRotation.Update(localArmRotation, Time.deltaTime);
if(ArmHUDisOpen == false){//Change this to state transition from ARMHUDSTATE_NOLEFTHAND -> ARMHUDSTATE_STATUS_ETC
if(Activate()){
ArmHUDAnimator.Play("Take 001_Opening");
ArmHUDeventsAnimator.Play("WristGraphicsEvents");
ArmHUDisOpen = true;
}
else{
ArmHUDState.Change (ARMHUDSTATE_STATUS_ETC);
return;
}
}
// ArmHUDbaseLookAtGRP.LookAt(LookTarget);
Vector3 localEulerAngles = ArmHUDbaseLookAtGRP.localEulerAngles;
if(ArmHUDisOpen == true){
if(localEulerAngles.x < 340.0f && localEulerAngles.x > 280.0f){
ArmHUDState.Change (ARMHUDSTATE_STATUS_ETC);
}
else if(localEulerAngles.x >26.0f && localEulerAngles.x < 80.0f && ArmHUDState.state != ARMHUDSTATE_PANELVISIBLE)
{
ArmHUDState.Change (ARMHUDSTATE_SETTINGS_ONLY);
}
}
// localEulerAngles.y = 90f;
// localEulerAngles.z = 0f;
// ArmHUDbaseLookAtGRP.localEulerAngles = localEulerAngles;
}