Example #1
0
        public StandAxis(bool forward, AxisBinding binding)
            : base("Stand" + (forward ? "X" : "Y"), binding)
        {
            mStandConfig = new StandConfig();
                Vector handR = Nui.joint(Nui.Hand_Right);
                Vector handL = Nui.joint(Nui.Hand_Left);

                Vector zeroPoint = Vector.Create("ZeroPoint", mStandConfig.ZeroPosition.X, mStandConfig.ZeroPosition.Y, mStandConfig.ZeroPosition.Z);
                //How far pushing forward
                Vector diff = zeroPoint - Nui.joint(Nui.Hip_Centre);
                mRaw = forward ? Nui.z(diff) : Nui.x(diff);

                //Whether the push gesture could be active
                mActive = C.And(Nui.abs(mRaw) > Deadzone.Value, Nui.abs(mRaw) < mStandConfig.Maximum);
                //mActive = C.And(mActive, Nui.y(hand) > Nui.y(elbow));
                //The value for the push gesture
                mValue = Nui.ifScalar(mActive, mRaw, 0f);
        }
Example #2
0
        public StandAxis(bool forward, AxisBinding binding)
            : base("Stand" + (forward ? "X" : "Y"), binding)
        {
            mStandConfig = new StandConfig();
            Vector handR = Nui.joint(Nui.Hand_Right);
            Vector handL = Nui.joint(Nui.Hand_Left);

            Vector zeroPoint = Vector.Create("ZeroPoint", mStandConfig.ZeroPosition.X, mStandConfig.ZeroPosition.Y, mStandConfig.ZeroPosition.Z);
            //How far pushing forward
            Vector diff = zeroPoint - Nui.joint(Nui.Hip_Centre);

            mRaw = forward ? Nui.z(diff) : Nui.x(diff);

            //Whether the push gesture could be active
            mActive = C.And(Nui.abs(mRaw) > Deadzone.Value, Nui.abs(mRaw) < mStandConfig.Maximum);
            //mActive = C.And(mActive, Nui.y(hand) > Nui.y(elbow));
            //The value for the push gesture
            mValue = Nui.ifScalar(mActive, mRaw, 0f);
        }