Exemplo n.º 1
0
    // Move the player relative to her own position and
    // orientation. After the call, the new position is returned.
    void moveRel(float &relX, float &relY, float &relZ)
    {
        using namespace Ogre;

        // Move camera relative to its own direction
        camera->moveRelative(Vector3(relX,0,relZ));

        // Up/down movement is always done relative the world axis.
        camera->move(Vector3(0,relY,0));

        // Get new camera position, converting back to MW coords.
        Vector3 pos = camera->getPosition();
        relX = pos[0];
        relY = -pos[2];
        relZ = pos[1];

        // TODO: Collision detection must be used to find the REAL new
        // position.

        // Set the position
        setPos(relX, relY, relZ);
    }
Exemplo n.º 2
0
//Ogre::Camera::move(Ogre::Vector3 const&)
void camera_move(CameraHandle handle, const float x, const float y, const float z)
{
    Ogre::Camera* camera = static_cast<Ogre::Camera*>(handle);
    camera->move(Ogre::Vector3(x, y, z));
}