1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

what does GetAxes() do?

Discussion in 'Programming' started by navboy, Jan 31, 2002.

  1. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    i know the x,y,z are out variables, but i don't know what the function does, or what gets sent or returned in x,y,z, and if they are vectors or what ...

    Looked around and couldn't find it anywhere in the actor hierarchy, is this a special function of some sort?
     
  2. butto

    butto Red Orchestra Coder

    Joined:
    Dec 2, 2001
    Messages:
    693
    Likes Received:
    0
  3. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    okay, i've found some more examples of it and it looks like it returns normal vectors along the x, y, and z axes for what direction the supplied rotator points in?

    But how is this different from just casting the rotator to a vector then using that; isn't it basically the same info only with three less vector variables to mess with?
     
  4. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    cool, thanks, that mostly makes sense, except that the example given:

    GetAxes(rotation, X, Y, Z);
    StartTrace = Location;
    EndTrace = StartTrace + vector(rotation) * 10000;
    Trace(HitLocation, HitNormal, EndTrace, StartTrace, True);
    spawn(class'BlastMark',,,HitLocation);


    never ends up using X, Y or Z after calling GetAxes and i've seen this same type of thing elsewhere, which makes me wonder if i'm missing something about the way it works. It doesn't do something to its first param too does it ("rotation" in this case)?
     
  5. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,913
    Likes Received:
    36
    It's declared in Object (superclass of Actor, line 233):
    Code:
    native(229) static final function GetAxes (rotator A, out vector X, out vector Y, out vector Z);
    
    What makes me wonder is the GetUnAxes() function right below that line. It uses the very same parameters, but what does it do?
     
  6. navboy

    navboy New Member

    Joined:
    Jan 5, 2001
    Messages:
    340
    Likes Received:
    0
    hmm, well below i posted logging where i stood facing northwest and caused it to log both GetAxes and GetUnAxes, then faced west and did it again. It's not immediately obvious to me what it's doing but it almost strikes me as maybe using a left-handed coordinate system instead of a right-handed one?


    facing Northwest:
    ScriptLog: GetAxes gave X -0.665807,-0.744300,0.052132 Y 0.745327,-0.666699,0.000383 Z 0.034471,0.039110,0.998640 , InstigatorVelocity Dot X is 0.000000
    ScriptLog: GetUnAxes gave X -0.665807,0.745327,0.034471 Y -0.744300,-0.666699,0.039110 Z 0.052132,0.000383,0.998640 , InstigatorVelocity Dot X is 0.000000


    facing West:
    ScriptLog: GetAxes gave X -0.999633,-0.007284,0.026075 Y 0.007286,-0.999973,0.000000 Z 0.026074,0.000190,0.999660 , InstigatorVelocity Dot X is 0.000000
    ScriptLog: GetUnAxes gave X -0.999633,0.007286,0.026074 Y -0.007284,-0.999973,0.000190 Z 0.026075,0.000000,0.999660 , InstigatorVelocity Dot X is 0.000000
     

Share This Page