Relation between GetPos and GetAngle?

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
Post Reply
Seven
Posts: 4
Joined: 06 Dec 2022, 23:20

Relation between GetPos and GetAngle?

Post by Seven »

I want to check in the ESP plugin script that player is facing the movement direction (i.e. not moving backwards or sideways).
I can get facing angle using GetAngle and I can trace x,y change using GetPos, so I want to compare them.
The question is, where is angle 0 looking? For example, with angle 0 x is not changing and only y is increasing, with angle 90 y is not changing and x is increasing etc. In short, how the angle is oriented in the code in relation to x,y coordinates?
Or is there any other simple way to know if player is moving backwards or sideways, like with running and jumping detection?
Sorry if it's wrong place to ask, will be grateful for any hints on where I can find this information.

Ok, so I tested it and the result is that Angle = 0 is to the north, X axis is to the east and Y axis is to the north.
In short, X axis matches Angle = 90, Y axis matches Angle = 0, where values are defined in the scripts as

Code: Select all

set PosX to ( Player->GetPos, X )
set PosY to ( Player->GetPos, Y )
set Angle to  ( Player->GetAngle, Z )
Post Reply