Been coding for years, but there are some functions and operators I still don't know what they exactly do. Could anyone enlighten me?
<<, >> and >>> (int A, int B)
<<, >> (vector A, rotator B)
Cross (vector A, vector B)
Invert (out vector X, out vector Y, out vector Z)
MirrorVectorByNormal (vector Vect, vector Normal)
GetUnAxes (rotator A, out vector X, out vector Y, out vector Z)
OrthoRotation (vector X, vector Y, vector Z)
What do these functions do?
- Feralidragon
- Godlike
- Posts: 5493
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: What do these functions do?
Code: Select all
<<, >> and >>> (int A, int B)
Shift Right (Arithmetic): >> : Shifts the bits of the first operand right, maintaining its signum
Shift Right: >>> : Shifts the bits of the first operand right, filling with zeroes
Source: UnrealWiki
Code: Select all
<<, >> (vector A, rotator B)
Code: Select all
GetAxes( B, X, Y, Z);
return A.X*X + A.Y*Y + A.Z*Z;
Code: Select all
GetUnAxes( B, X, Y, Z);
return A.X*X + A.Y*Y + A.Z*Z;
Code: Select all
Cross (vector A, vector B)
I must say this function saved me a lot of trouble in the vehicles.
Code: Select all
Invert (out vector X, out vector Y, out vector Z)
Code: Select all
MirrorVectorByNormal (vector Vect, vector Normal)
Think of a projectile p with a certain speed vector that hits a wall with a certain normal vector HitNormal and gets reflected without any damping. The projectile's new speed is what you get from MirrorVectorByNormal(p.Velocity, HitNormal). This can also be calculated through:
Code: Select all
Vect - (Vect dot Normal(HitNormal)) * Normal(HitNormal)
Source: UnrealWiki
Code: Select all
GetUnAxes (rotator A, out vector X, out vector Y, out vector Z)
Source: UnrealWiki
Code: Select all
OrthoRotation (vector X, vector Y, vector Z)
Source: UnrealWiki
- Saya-chan
- Adept
- Posts: 446
- Joined: Mon Jun 02, 2008 10:46 am
- Personal rank: Former UT99 modder
- Location: Vigo, Galicia
- Contact:
Re: What do these functions do?
Thanks a lot. Now I think I know how to fix some problems and add some new features to mods
~♥~ Bless the Cute Emperor ~♥~