player movement and rotation update
This commit is contained in:
parent
94942ef129
commit
ebd66fb4aa
4
main.cpp
4
main.cpp
@ -239,14 +239,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
//pb.player -> setPosition(irr::core::vector3df(playerPos.X - cos(irr::core::degToRad(playerRot.Y + movementAngle)) * angularVel, playerPos.Y, playerPos.Z + sin(irr::core::degToRad(playerRot.Y + movementAngle)) * angularVel));
|
||||
//pb.camera -> setTarget(irr::core::vector3df(playerPos.X - cos(irr::core::degToRad(playerRot.Y + movementAngle)) * angularVel, playerPos.Y + pb.verticalCamRot, playerPos.Z + sin(irr::core::degToRad(playerRot.Y + movementAngle)) * angularVel));
|
||||
pb.camera -> setTarget(irr::core::vector3df(playerPos.X - cos(irr::core::degToRad(playerRot.Y)) * angularVel, playerPos.Y + pb.verticalCamRot, playerPos.Z + sin(irr::core::degToRad(playerRot.Y)) * angularVel));
|
||||
|
||||
pb.player -> setPosition(irr::core::vector3df(playerPos.X - movementVec.X * angularVel, playerPos.Y, playerPos.Z + movementVec.Y * angularVel));
|
||||
|
||||
pb.player -> updateAbsolutePosition();
|
||||
}
|
||||
|
||||
pb.camera -> setTarget(irr::core::vector3df(playerPos.X - movementVec.X * angularVel, playerPos.Y + pb.verticalCamRot, playerPos.Z + movementVec.Y * angularVel));
|
||||
//pb.camera -> setTarget(irr::core::vector3df(playerPos.X - movementVec.X * angularVel, playerPos.Y + pb.verticalCamRot, playerPos.Z + movementVec.Y * angularVel));
|
||||
|
||||
// Water on Level 7 //
|
||||
if(levelSwitcher.currentLevel == 7)
|
||||
|
Loading…
Reference in New Issue
Block a user