void Update()
    {
        // For walking action, keep track of what the last pad clicked was so that movement only occurs with alternate clicks
        // Shouldn't really be in this class which ideally would be restricted to managing the input only
        if (Input.GetButton("LeftPadDown") && !Input.GetButton("RightPadDown") && !lastClickLeft)
        {
            lastClickLeft = true;
            padClicked.Invoke();
        }
        if (Input.GetButton("RightPadDown") && !Input.GetButton("LeftPadDown") && lastClickLeft)
        {
            lastClickLeft = false;
            padClicked.Invoke();
        }

        if (debugMode)
        {
            Vector3    leftPosition  = InputTracking.GetLocalPosition(XRNode.LeftHand);
            Quaternion leftRotation  = InputTracking.GetLocalRotation(XRNode.LeftHand);
            Vector3    rightPosition = InputTracking.GetLocalPosition(XRNode.RightHand);
            Quaternion rightRotation = InputTracking.GetLocalRotation(XRNode.RightHand);
            HUDDebug.AddMessage("Left Position: " + leftPosition + " Left Rotation: " + leftRotation);
            HUDDebug.AddMessage("Right Position: " + rightPosition + " Right Rotation: " + rightRotation);
        }

        // Debug.Log(leftPosition + " " + leftRotation + " " + rightPosition + " " + leftHorz);
        //var interactionSourceStates = InteractionManager.GetCurrentReading();
        //Debug.Log(interactionSourceStates);
    }
 void Awake()
 {
     //If single object already exists then destroy
     if (ThisInstance != null)
     {
         DestroyImmediate(gameObject);
         return;
     }
     //Make this single instance
     ThisInstance = this;
 }
Beispiel #3
0
        public override void Render(double time)
        {
            lock (_RenderLock)
            {
                GL.PushMatrix();
                {
                    if (_FollowTarget != null)
                    {
                        CalculatePan((float)time);
                    }
                    GL.Translate(Math.Round(_ViewPosition.X), Math.Round(_ViewPosition.Y), Math.Round(_ViewPosition.Z));
                    Background.Render(time);
                    Rear.Render(time);
                    // <edit>
                    GL.PushMatrix();
                    {
                        double dx = 0.5 * ViewWidth;
                        double dy = 0.5 * ViewHeight;
                        GL.Translate(dx, dy, -100.0);

                        GL.Rotate(-60, 1.0, 0.0, 0.0);
                        GL.Rotate(MainTimer.Elapsed.TotalSeconds * 6.0, 0.0, 0.0, 1.0);

                        //double dx1 = 0.5 * FloorR;
                        //double dy1 = 0.5 * FloorR;
                        //GL.Translate(-dx1, -dy1, 0.0);

                        Stage.Render(time);
                    }
                    GL.PopMatrix();
                    // </edit>
                    Tests.Render(time);
                    Front.Render(time);
                    if (Configuration.DrawBlueprints)
                    {
                        WorldBlueprint.Render(time);
                    }
                }
                GL.PopMatrix();
                HUD.Render(time);
                if (Configuration.DrawBlueprints)
                {
                    HUDBlueprint.Render(time);
                }
                if (Configuration.ShowDebugVisuals)
                {
                    HUDDebug.Render(time);
                }
            }
        }