Jump to content
  • Sign Up

River.8964

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by River.8964

  1. Here is what I came up with:

    I use fAvatarFront from struct LinkedMem and like you said we take only X and Z values so they are fAvatarFront[0] and fAvatarFront[2] respectively.

     

    This is the code written in C#:

    > public static int Get_Orientation(float fAvatarFront)

    > {

    > float radian = (float)Math.Atan2(fAvatarFront[0], fAvatarFront[2]);

    > float angle = radian * 180.0f / (float)Math.PI;

    > return (int)((angle + 360.0f) % 360.0f);

    > }

     

    This will return an integer value from 0 to 359. It starts at true North equals to 0 and goes clockwise.

    Thanks again for the infos.

  2. I'm playing with the MumbleLink API at the moment and I'm trying to get the character's orientation relative to the game map's orientation.

    There's a struct fAvatarFront in LinkedMem. This struct changes when the character rotates around itself.

    And there's another struct compassRotation in MumbleContext but it's always 0 no matter which way the character turns afaik even though the wiki said that it's radians (I have a high hope for it but turned out it didn't worked or I missed something big time :p ).

    Does anyone figure out how to get this information? My best observation is the clue relates to the struct fAvatarFront.

    It would be nice if someone already created some sort of formula to convert these numbers into the angle number relative to the map's orientation.

     

    Thanks in advance

×
×
  • Create New...