1
\$\begingroup\$

Could I please get an example of the correct syntax for calling the

Invert ( out vector X, out vector Y, out vector Z )

function

\$\endgroup\$
  • 1
    \$\begingroup\$ Simple question doesn't mean it's not a fit for the site, I don't see anything else wrong with it. Sorry about the people down voting without comment. \$\endgroup\$ – MichaelHouse Oct 16 '13 at 1:04
  • \$\begingroup\$ From the docs: "Inverts a coordinate system specified by three axis vectors." I have no idea what that is supposed to mean. Maybe it'll clue in someone else. \$\endgroup\$ – Sean Middleditch Oct 16 '13 at 1:17
  • \$\begingroup\$ Sounds like it's doing a matrix inverse on the upper 3x3 and returning them as individual axes instead of all matrixed up. \$\endgroup\$ – Patrick Hughes Nov 15 '13 at 4:24
1
\$\begingroup\$

While I couldn't find and examples of that function specifically, we can look at the out parameter modifier to get an idea of how this function might work.

In the example:

Function Clamp(Out Int Value, Int Min, Int Max) {   
    if( Value < Min)
      Value = Min;
    else if( Value > Max)
      Value = Max; 
}

And it's usage:

Clamp(Health, 0, 100);

We see that for the out parameter, we need to pass in variable that's been defined already (similar to other languages that have an out parameter modifier). Based off that, I would assume the correct syntax for the Invert function would be something like:

var Vector xVec;
var Vector yVec;
var Vector zVec;

//set vectors to something to be inverted

Invert ( xVec, yVec, zVec );

Where a Vector is defined as:

struct Vector
{
    var float X;
    var float Y;
    var float Z;
};
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.