Code: Select all
unitdir1,unitdir2,unitdir3 = Spring.GetUnitDirection(unitID)
Thanks
aGorm
Moderator: Moderators
Code: Select all
unitdir1,unitdir2,unitdir3 = Spring.GetUnitDirection(unitID)
Would be my guess / recollection also.zwzsg wrote:I would say unitdir1, unitdir2, unitdir3 are the cartesian coordinates (that, is, the X, the Y, the Z) of a vertex. This vertex direction is the same as the unit direction.
So no, they are not angles in the [-pi,pi] range. They are coordinates in the [-1,1] range (assuming the vertex is normalised).
Mostly a guess, though.
Code: Select all
dir = Spring.GetUnitHeading(unitID)/32768*math.pi
32768 binary numberaGorm wrote:Thanks... out of intrest whats the /32768 for? Just some magic constant?
aGorm