コード例 #1
0
 static void HumanPose_muscles(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.HumanPose _this = (UnityEngine.HumanPose)vc.csObj;
         var result = _this.muscles;
         var arrRet = result;
         for (int i = 0; arrRet != null && i < arrRet.Length; i++)
         {
             JSApi.setSingle((int)JSApi.SetType.SaveAndTempTrace, arrRet[i]);
             JSApi.moveSaveID2Arr(i);
         }
         JSApi.setArrayS((int)JSApi.SetType.Rval, (arrRet != null ? arrRet.Length : 0), true);
     }
     else
     {
         System.Single[] arg0 = JSDataExchangeMgr.GetJSArg <System.Single[]>(() =>
         {
             int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg);
             int length  = JSApi.getArrayLength(jsObjID);
             var ret     = new System.Single[length];
             for (var i = 0; i < length; i++)
             {
                 JSApi.getElement(jsObjID, i);
                 ret[i] = (System.Single)JSApi.getSingle((int)JSApi.GetType.SaveAndRemove);
             }
             return(ret);
         });
         UnityEngine.HumanPose _this = (UnityEngine.HumanPose)vc.csObj;
         _this.muscles = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
コード例 #2
0
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.HumanPose o;
         o = new UnityEngine.HumanPose();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
コード例 #3
0
 public void SetHumanPose(ref HumanPose humanPose)
 {
   humanPose.Init();
   if (this.Internal_SetHumanPose(ref humanPose.bodyPosition, ref humanPose.bodyRotation, humanPose.muscles))
     return;
   Debug.LogWarning((object) "HumanPoseHandler is not initialized properly");
 }
コード例 #4
0
 public void SetHumanPose(ref HumanPose humanPose)
 {
     humanPose.Init();
     if (!this.Internal_SetHumanPose(ref humanPose.bodyPosition, ref humanPose.bodyRotation, humanPose.muscles))
     {
         Debug.LogWarning("HumanPoseHandler is not initialized properly");
     }
 }
コード例 #5
0
 public void GetHumanPose(ref HumanPose humanPose)
 {
     humanPose.Init();
     if (!this.Internal_GetHumanPose(ref humanPose.bodyPosition, ref humanPose.bodyRotation, humanPose.muscles))
     {
         Debug.LogWarning("HumanPoseHandler is not initialized properly");
     }
 }
コード例 #6
0
 public void GetHumanPose(ref HumanPose humanPose)
 {
     humanPose.Init();
     if (this.Internal_GetHumanPose(ref humanPose.bodyPosition, ref humanPose.bodyRotation, humanPose.muscles))
     {
         return;
     }
     Debug.LogWarning((object)"HumanPoseHandler is not initialized properly");
 }
コード例 #7
0
 public void SetHumanPose(ref HumanPose humanPose)
 {
     if (this.m_Ptr == IntPtr.Zero)
     {
         throw new NullReferenceException("HumanPoseHandler is not initialized properly");
     }
     humanPose.Init();
     this.SetHumanPose(ref humanPose.bodyPosition, ref humanPose.bodyRotation, humanPose.muscles);
 }
コード例 #8
0
        public void GetInternalHumanPose(ref HumanPose humanPose)
        {
            if (m_Ptr == IntPtr.Zero)
            {
                throw new NullReferenceException("HumanPoseHandler is not initialized properly");
            }

            humanPose.Init();
            GetInternalHumanPose(out humanPose.bodyPosition, out humanPose.bodyRotation, humanPose.muscles);
        }
コード例 #9
0
        public void GetHumanPose(ref HumanPose humanPose)
        {
            bool flag = this.m_Ptr == IntPtr.Zero;

            if (flag)
            {
                throw new NullReferenceException("HumanPoseHandler is not initialized properly");
            }
            humanPose.Init();
            this.GetHumanPose(out humanPose.bodyPosition, out humanPose.bodyRotation, humanPose.muscles);
        }
コード例 #10
0
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.HumanPose o;
			o=new UnityEngine.HumanPose();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
コード例 #11
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.HumanPose o;
         o = new UnityEngine.HumanPose();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #12
0
    static bool HumanPoseHandler_SetHumanPose__HumanPose(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            int r_arg0 = JSApi.getArgIndex();
            UnityEngine.HumanPose arg0 = (UnityEngine.HumanPose)JSMgr.datax.getObject((int)JSApi.GetType.ArgRef);
            ((UnityEngine.HumanPoseHandler)vc.csObj).SetHumanPose(ref arg0);
            JSApi.setArgIndex(r_arg0);
            JSMgr.datax.setObject((int)JSApi.SetType.ArgRef, arg0);
        }

        return(true);
    }
コード例 #13
0
 static void HumanPose_bodyRotation(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.HumanPose _this = (UnityEngine.HumanPose)vc.csObj;
         var result = _this.bodyRotation;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.Quaternion arg0  = (UnityEngine.Quaternion)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.HumanPose  _this = (UnityEngine.HumanPose)vc.csObj;
         _this.bodyRotation = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
コード例 #14
0
// fields
    static void HumanPose_bodyPosition(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.HumanPose _this = (UnityEngine.HumanPose)vc.csObj;
            var result = _this.bodyPosition;
            JSApi.setVector3S((int)JSApi.SetType.Rval, result);
        }
        else
        {
            UnityEngine.Vector3   arg0  = (UnityEngine.Vector3)JSApi.getVector3S((int)JSApi.GetType.Arg);
            UnityEngine.HumanPose _this = (UnityEngine.HumanPose)vc.csObj;
            _this.bodyPosition = arg0;
            JSMgr.changeJSObj(vc.jsObjID, _this);
        }
    }
コード例 #15
0
        /// <summary>
        /// リセンター
        /// 現在の位置と姿勢が中心と正面を向くようにすべてのトラッカーに影響がある座標系を調整する。
        /// </summary>
        public void Recenter()
        {
            Debug.Assert(_refs.trackersRoot != null);
            Debug.Assert(dummyAnimator != null);

            var pose = new UnityEngine.HumanPose();

            _dummyPoseHandler.GetHumanPose(ref pose);

            var trackersRoot = _refs.trackersRoot;

            var affectPosition    = new Vector3(pose.bodyPosition.x, 0, pose.bodyPosition.z);
            var affectEulerAngles = new Vector3(0, pose.bodyRotation.eulerAngles.y, 0);

            trackersRoot.RotateAround(affectPosition, Vector3.up, -affectEulerAngles.y);
            trackersRoot.Translate(-affectPosition, Space.World);
        }