The following lists the source code that is currently available.
---------------
Code may be beta and thus may not work properly. As such, all code should be used at your own risk.
---------------
Printable View
The following lists the source code that is currently available.
---------------
Code may be beta and thus may not work properly. As such, all code should be used at your own risk.
---------------
Vector class [v 1.0]:
Use:
- This is the fundamental class for all vectors and most points in our 3D world. It stores 3 floats (X, Y, Z).
Member variables:
- float fX: Holds the X position.
- float fY: Holds the Y position.
- float fZ: Holds the Z position.
Functions:
- Operator ==: Checks if two operators have the same X, Y and Z component.
- Operator != (Vector, Vector): Checks if two operators have one or more components that are not the same.
- Operator + (Vector, Vector): Adds one vector to an other vector.
- Operator - (Vector, Vector): Subtract one vector from an other.
- Operator - (Vector): Changes the sign of all the components in the vector.
- Operator * (float, Vector): Multiplies each component of a vector with a float.
- Operator * (Vector, float): Multiplies each component of a vector with a float.
- Operator * (Vector, float): Devides each component of a vector with a float.
- Operator / (float, Vector): Devides each component of a vector with a float.
- Magnitude (): Returns the length of the vector.
- Normalise (): Returns a normalized version of the vector.
- NormalizeThis (): Normalizes this vector.
- DotPro (Vector): Returns the dot product between this vector and an other one.
- AngleBetween (Vector): Returns the angle between this vector and an other vector.
- Normal (Vector): Returns the normal between this and an other vector.
- CrossProd (Vector): Returns the cross product between this and and an other vector.
- To2DPointFromXY (): Returns the X and Y component as a 2D point.
- Print (): Prints out the values of X, Y, and Z for debugging purpose.
History:
- 19.09.05 - Added to this thread.
- 16.10.05 - Took away W as a member, and changed the functions acordingly, since there was no use for it.
.