当前位置: 首页>>代码示例>>C#>>正文


C# HandModel.GetArmDirection方法代码示例

本文整理汇总了C#中HandModel.GetArmDirection方法的典型用法代码示例。如果您正苦于以下问题:C# HandModel.GetArmDirection方法的具体用法?C# HandModel.GetArmDirection怎么用?C# HandModel.GetArmDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HandModel的用法示例。


在下文中一共展示了HandModel.GetArmDirection方法的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;
        }
开发者ID:ryanwang,项目名称:VR-Planetarium,代码行数:48,代码来源:ArmHUDMGR.cs


注:本文中的HandModel.GetArmDirection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。