• Visit Rebornbuddy
  • GameObject.AboutFace()

    Discussion in 'Community Developer Forum' started by newb23, Jan 24, 2017.

    1. newb23

      newb23 Community Developer

      Joined:
      Nov 26, 2014
      Messages:
      397
      Likes Received:
      15
      Trophy Points:
      18
      Hey Mastahg,

      I am looking into a writing a personal solution, but I wanted to ask if it might be within the scope of RB to add GameObject.AboutFace();, literally the exact opposite of GameObject.Face();

      It would be exceptionally handy for a certain number of spells in the end-game and beyond into 4.0 to be able to add a call to CurrentTarget.AboutFace(); and wait for the cast to end before re-engaging.

      Thank you!

      Edit: Possibly with an overload with a certian amount of degrees you wish to overload for an InView check?

      From Ultima's Code for example:

      Code:
              public static bool InView(Vector3 PlayerLocation, float PlayerHeading, Vector3 TargetLocation)        {
                  var d = Math.Abs(MathEx.NormalizeRadian(PlayerHeading
                      - MathEx.NormalizeRadian(MathHelper.CalculateHeading(PlayerLocation, TargetLocation)
                      + (float)Math.PI)));
      
      
                  if (d > Math.PI)
                  {
                      d = Math.Abs(d - 2 * (float)Math.PI);
                  }
                  return d < 0.78539f;
              }
       
      Last edited: Jan 24, 2017
    2. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,229
      Likes Received:
      364
      Trophy Points:
      83
      Nope.

      Make one your self.

      MovementManager.SetFacing(float rotation)
      MovementManager.SetFacing(Vector3 target)
      MovementManager.SetFacing2D(Vector3 target)
       

    Share This Page