Beispiel #1
0
        public void move(float dx, float dy, float dz)
        {
            if (myIsDebugging == true)
            {
                myDebugCamera.move(dx, dy, dz);
                return;
            }

            myIsDirty = true;
            Vector3 eye = position;

            eye += myXAxis * dx;
            eye += myYAxis * dy;
            eye += myZAxis * -dz;

            position = eye;

            updateViewMatrix();
        }
Beispiel #2
0
        public void tick(float dt)
        {
            //update axis from orientation
            myCamera.setOrientation(myViewOri);

            if (shiftDown)
            {
                myStepSize = defaultBigStepSize;
            }
            else
            {
                myStepSize = defaultStepSize;
            }

            //move based on keys
            if (moveForward == true)
            {
                myCamera.move(0.0f, 0.0f, myStepSize * dt);
            }
            if (moveBackward == true)
            {
                myCamera.move(0.0f, 0.0f, -myStepSize * dt);
            }
            if (moveLeft == true)
            {
                myCamera.move(-myStepSize * dt, 0.0f, 0.0f);
            }
            if (moveRight == true)
            {
                myCamera.move(myStepSize * dt, 0.0f, 0.0f);
            }
            if (moveUp == true)
            {
                myCamera.move(0.0f, myStepSize * dt, 0.0f);
            }
            if (moveDown == true)
            {
                myCamera.move(0.0f, -myStepSize * dt, 0.0f);
            }
        }