get absolute rotational values from entityPitch?
Blitz3D Forums/Blitz3D Programming/get absolute rotational values from entityPitch?
| ||
I've noticed that if you add a rotational value to an entity with a value like say 700, it will rotate it correctly as if it's rotated beyond 360 degrees, but if I use the entityPitch function, that absolute rotation value is truncated to a value between -180 and 180. Is there anyway around this? or is this just result of blitz converting it's rotational data to direct X then entityPitch using directX to conver the data back again? |
| ||
I'm pretty sure B3D doesn't use euler rotations internally, so it's having to mathematically derive them from ( probably ) quaternion values, and there are multiple euler values to any one quaternion orientation, so B3D is internally trying to make them between 180 and -180 for consistency. |
| ||
Its fairly simple really:p# = EntityPitch(Entity) If p < 0 p = p + 360 EndIf This will return a value between 0 to 360 instead of -180 to 180. |