player movement and rotation update

This commit is contained in:
Looki2000 2023-03-12 02:31:37 +01:00
parent 94942ef129
commit ebd66fb4aa

View File

@ -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)