Sorry people I didn't post the code, my fault!
/*controla a camera*/
void moveCamera()
{
float distance = -1.5-.25*LShip[1].speed;
float x = distance * dbSin(camAngleY) * dbCos(camAngleX);
float z = distance * dbSin(camAngleY) * dbSin(camAngleX);
float y = distance * dbCos(camAngleY);
dbPositionCamera(x+dbObjectPositionX(1),y+dbObjectPositionY(1),z+dbObjectPositionZ(1));
dbRotateCamera(camAngleY-90,90-camAngleX,0);
}
/*trata dos comandos da nave do jogador*/
void comandos()
{
/*Ajuda a position o cenario*/
dbPositionObject(98,dbObjectPositionX(1),dbObjectPositionY(1),dbObjectPositionZ(1));
dbPositionObject(99,dbObjectPositionX(98),dbObjectPositionY(98),dbObjectPositionZ(98)+500);
if (dbJoystickLeft()==1)
{
dbYRotateObject(LShip[1].obj,dbWrapValue(dbObjectAngleY(1)-.25f));
camAngleX= dbWrapValue(camAngleX+0.25f);
moveCamera();
}
if (dbJoystickRight()==1)
{
dbYRotateObject(LShip[1].obj,dbWrapValue(dbObjectAngleY(1)+.25f));
camAngleX= dbWrapValue(camAngleX-0.25f);
moveCamera();
}
if (dbJoystickUp()==1)
{
dbXRotateObject(LShip[1].obj,dbWrapValue(dbObjectAngleX(1)+.125f));
camAngleY = dbWrapValue(camAngleY+.125f);
moveCamera();
}
if (dbJoystickDown()==1)
{
dbXRotateObject(LShip[1].obj,dbWrapValue(dbObjectAngleX(1)-.125f));
camAngleY = dbWrapValue(camAngleY-.125f);
moveCamera();
}
if(dbJoystickHatAngle(0)==27000)
{
dbMoveObjectLeft(LShip[1].obj,.025f);
moveCamera();
}
if(dbJoystickHatAngle(0)==9000)
{
dbMoveObjectRight(LShip[1].obj,.025f);
moveCamera();
}
if(dbJoystickHatAngle(0)==0)
{
dbMoveObjectUp(LShip[1].obj,.025f);
moveCamera();
}
if(dbJoystickHatAngle(0)==18000)
{
dbMoveObjectDown(LShip[1].obj,.025f);
moveCamera();
}
LShip[1].speed = 1.0-dbJoystickSliderA()/65535.0;
if (LShip[1].speed>0)
{
dbMoveObject(LShip[1].obj,LShip[1].speed);
moveCamera();
}
}