Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fixed ThirdPerson_GetRelativeAngle (int player)
- {
- fixed yaw = CameraGetYaw(player);
- //fixed face = UnitGetFacing(playerAssets[player].units.avatar);
- fixed up = IntToFixed(MaxI(BoolToInt(playerInput[player].key.state[c_keyW]),BoolToInt(playerInput[player].key.state[c_keyUp])));
- fixed down = IntToFixed(MaxI(BoolToInt(playerInput[player].key.state[c_keyS]),BoolToInt(playerInput[player].key.state[c_keyDown])));
- fixed left = IntToFixed(MaxI(BoolToInt(playerInput[player].key.state[c_keyA]),BoolToInt(playerInput[player].key.state[c_keyLeft])));
- fixed right = IntToFixed(MaxI(BoolToInt(playerInput[player].key.state[c_keyD]),BoolToInt(playerInput[player].key.state[c_keyRight])));
- fixed atan = ATan2(up - down, right - left);
- return (yaw+atan);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement