Hpl2:Resources:script modules:vector3d

From Frictional Wiki
Revision as of 14:48, 9 July 2020 by Maintenance script (talk | contribs) (Upload from wiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Vector 3D

The following code provides support for 3D Vectors. Note: These functions will be set out best using the Improved Notepad++ HPS Support.


These functions provide operator overloads to make working with vectors easier. Additionally, string parsing, saving to and loading from variables as well as length and normalisation operations are availible.


Installation

Download the code here . Paste the code either into your .hps file OR an external file and utilising a Script Pre-Processer. Remove the section labeled MATH if you are already using the math module. Remove the section labeled STRING PARSING if you are already using the String Parsing module.

Documentation - Constructors

Vec3()


Creates a new vector with each component set to 0


Vec3(float afX, float afY, float afZ)


Creates a new vector with the given X,y,Z components


Vec3(Vec3 &in v1)


Creates a new vector with the same components as the passed in vector.


Vec3(string &in asVecName)


Creates a new vector based off a local variable name. See also Vec3::load.


Vec3(float[] values)


Creates a new vector based of a float array with at least 3 elements. Array[0] is the x components, Array[1] the y and Array[2] the z.

Documentation - Methods

Todo


Documentation - Examples

Todo