Difference between revisions of "HPL3/SOMA/Scripting/cVector2f"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
A two dimensional vector unit whose elements are stored as floats. | A two dimensional vector unit whose elements are stored as floats. | ||
+ | |||
+ | ==Constructors== | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Constructor !! Description | ||
+ | |- | ||
+ | | <syntaxhighlight lang="c++" inline>cVector2f(float, float)</syntaxhighlight> || Creates a <code>cVector2f</code> with the given element data. | ||
+ | |} | ||
==Fields== | ==Fields== | ||
Line 36: | Line 44: | ||
vBaseVector.y / fNormFactor);</syntaxhighlight> | vBaseVector.y / fNormFactor);</syntaxhighlight> | ||
− | + | {{ReferencesSection}} | |
− | + | ||
− | + | {{HPL3SOMAScriptingCategories}} | |
− | |||
− | |||
__FORCETOC__ | __FORCETOC__ |
Latest revision as of 15:22, 6 August 2020
A two dimensional vector unit whose elements are stored as floats.
Constructors
Constructor | Description |
---|---|
cVector2f(float, float) |
Creates a cVector2f with the given element data.
|
Fields
Field Name | Type | Description |
---|---|---|
x | float |
The x value of the vector. |
y | float |
The y value of the vector. |
Functions
Return Type | Function Name | Parameters | Description |
---|---|---|---|
float |
GetElement | uint64 alIdx |
Gets the value at the given index. (Indices 0 and 1 are equal to x and y, respectively.) |
float |
Length | Returns the length of this vector. | |
float |
Normalize | Returns the normalization factor for this vector. (See Remarks.) | |
void |
SetElement | uint64 alIdx ,float |
Sets the value at the given index to the given value. (Indices 0 and 1 are equal to x and y, respectively.) |
float |
SqrLength | Returns the length-squared of this vector. |
Remarks
A normalized vector is a vector whose length is equal to one, otherwise known as a unit vector. To convert a vector into a unit vector, get the normalization factor by calling the Normalize function, then divide each of the vector's x and y coordinates by that factor.
cVector2f vBaseVector(2.0, 5.0);
float fNormFactor = vBaseVector.Normalize();
cVector2f vNormalizedVector(vBaseVector.x / fNormFactor,
vBaseVector.y / fNormFactor);
References
- HPL3/SOMA/Scripting/cBeam (← links)
- HPL3/SOMA/Scripting/cCamera (← links)
- HPL3/SOMA/Scripting/cClothEntity (← links)
- HPL3/SOMA/Scripting/cConfigFile (← links)
- HPL3/SOMA/Scripting/cForceField (← links)
- HPL3/SOMA/Scripting/cFrustum (← links)
- HPL3/SOMA/Scripting/cGuiGfxElement (← links)
- HPL3/SOMA/Scripting/cGuiMessageData (← links)
- HPL3/SOMA/Scripting/cGuiSet (← links)
- HPL3/SOMA/Scripting/cImGui (← links)
- HPL3/SOMA/Scripting/cImGuiButtonData (← links)
- HPL3/SOMA/Scripting/cImGuiCheckBoxData (← links)
- HPL3/SOMA/Scripting/cImGuiFont (← links)
- HPL3/SOMA/Scripting/cImGuiFrameData (← links)
- HPL3/SOMA/Scripting/cImGuiGaugeData (← links)
- HPL3/SOMA/Scripting/cImGuiGfx (← links)
- HPL3/SOMA/Scripting/cImGuiLabelData (← links)
- HPL3/SOMA/Scripting/cImGuiMultiSelectData (← links)
- HPL3/SOMA/Scripting/cImGuiSliderData (← links)
- HPL3/SOMA/Scripting/cImGuiTextFrameData (← links)
- HPL3/SOMA/Scripting/cImGuiWindowData (← links)
- HPL3/SOMA/Scripting/cLensFlare (← links)
- HPL3/SOMA/Scripting/cLuxAgent (← links)
- HPL3/SOMA/Scripting/cLuxArea (← links)
- HPL3/SOMA/Scripting/cLuxCritter (← links)
- HPL3/SOMA/Scripting/cLuxInputHandler (← links)
- HPL3/SOMA/Scripting/cLuxLiquidArea (← links)
- HPL3/SOMA/Scripting/cLuxMap (← links)
- HPL3/SOMA/Scripting/cLuxPlayer (← links)
- HPL3/SOMA/Scripting/cLuxProp (← links)
- HPL3/SOMA/Scripting/cLuxSoundscapeArea (← links)
- HPL3/SOMA/Scripting/cLuxVisibilityArea (← links)
- HPL3/SOMA/Scripting/cLuxVisibilityPortal (← links)
- HPL3/SOMA/Scripting/cPostEffect ChromaticAberration (← links)
- HPL3/SOMA/Scripting/cPostEffect VideoDistortion (← links)
- HPL3/SOMA/Scripting/cRendererCallbackFunctions (← links)
- HPL3/SOMA/Scripting/cResourceVarsObject (← links)
- HPL3/SOMA/Scripting/cRopeEntity3D (← links)
- HPL3/SOMA/Scripting/cTerrain (← links)
- HPL3/SOMA/Scripting/cWidgetButton (← links)
- HPL3/SOMA/Scripting/cWidgetCheckBox (← links)
- HPL3/SOMA/Scripting/cWidgetCollapsiblePane (← links)
- HPL3/SOMA/Scripting/cWidgetCollapsiblePaneContainer (← links)
- HPL3/SOMA/Scripting/cWidgetComboBox (← links)
- HPL3/SOMA/Scripting/cWidgetContextMenu (← links)
- HPL3/SOMA/Scripting/cWidgetDummy (← links)
- HPL3/SOMA/Scripting/cWidgetFrame (← links)
- HPL3/SOMA/Scripting/cWidgetGroup (← links)
- HPL3/SOMA/Scripting/cWidgetImage (← links)
- HPL3/SOMA/Scripting/cWidgetLabel (← links)