Difference between revisions of "HPL3/SOMA/Scripting/cVector3f"
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
! Constructor !! Description | ! Constructor !! Description | ||
|- | |- | ||
− | | <syntaxhighlight lang="c++" inline>cVector3f(float, float, float)</syntaxhighlight> || Creates a cVector3f with | + | | <syntaxhighlight lang="c++" inline>cVector3f(float, float, float)</syntaxhighlight> || Creates a <code>cVector3f</code> with the given element data. |
|} | |} | ||
Line 37: | Line 37: | ||
|} | |} | ||
− | + | ==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, y, and z coordinates by that factor. | 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, y, and z coordinates by that factor. | ||
Line 46: | Line 46: | ||
vBaseVector.y / fNormFactor, | vBaseVector.y / fNormFactor, | ||
vBaseVector.z / fNormFactor);</syntaxhighlight> | vBaseVector.z / fNormFactor);</syntaxhighlight> | ||
+ | |||
+ | {{ReferencesSection}} | ||
{{HPL3SOMAScriptingCategories}} | {{HPL3SOMAScriptingCategories}} | ||
__FORCETOC__ | __FORCETOC__ |
Latest revision as of 15:23, 6 August 2020
A three dimensional vector unit whose elements are stored as floats.
Constructors
Constructor | Description |
---|---|
cVector3f(float, float, float) |
Creates a cVector3f 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. |
z | float |
The z value of the vector. |
Functions
Return Type | Function Name | Parameters | Description |
---|---|---|---|
float |
GetElement | uint64 alIdx |
Gets the value at the given index. (Indices 0, 1, and 2 are equal to x, y, and z, 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 afValue |
Sets the value at the given index to the given value. (Indices 0, 1, and 2 are equal to x, y, and z, 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, y, and z coordinates by that factor.
cVector3f vBaseVector(2.0, 5.0, 3.0);
float fNormFactor = vBaseVector.Normalize();
cVector3f vNormalizedVector(vBaseVector.x / fNormFactor,
vBaseVector.y / fNormFactor,
vBaseVector.z / fNormFactor);
References
- HPL3/SOMA/Scripting/cBeam (← links)
- HPL3/SOMA/Scripting/cAINode (← links)
- HPL3/SOMA/Scripting/cAINodeContainer (← links)
- HPL3/SOMA/Scripting/cBeamEnd (← links)
- HPL3/SOMA/Scripting/cBillboard (← links)
- HPL3/SOMA/Scripting/cBoneState (← links)
- HPL3/SOMA/Scripting/cBoundingVolume (← links)
- HPL3/SOMA/Scripting/cCamera (← links)
- HPL3/SOMA/Scripting/cClothEntity (← links)
- HPL3/SOMA/Scripting/cCollidePoint (← links)
- HPL3/SOMA/Scripting/cConfigFile (← links)
- HPL3/SOMA/Scripting/cEnvironmentParticles (← links)
- HPL3/SOMA/Scripting/cExposureArea (← links)
- HPL3/SOMA/Scripting/cFogArea (← links)
- HPL3/SOMA/Scripting/cForceField (← links)
- HPL3/SOMA/Scripting/cFrustum (← links)
- HPL3/SOMA/Scripting/cGuiGfxElement (← links)
- HPL3/SOMA/Scripting/cGuiPopUpColorPicker (← links)
- HPL3/SOMA/Scripting/cGuiSet (← links)
- HPL3/SOMA/Scripting/cGuiSetEntity (← links)
- HPL3/SOMA/Scripting/cGuiSkin (← links)
- HPL3/SOMA/Scripting/cImGui (← links)
- HPL3/SOMA/Scripting/cImGuiGfx (← links)
- HPL3/SOMA/Scripting/cImGuiWindowData (← links)
- HPL3/SOMA/Scripting/cLensFlare (← links)
- HPL3/SOMA/Scripting/cLightBox (← links)
- HPL3/SOMA/Scripting/cLightDirectional (← links)
- HPL3/SOMA/Scripting/cLightMaskBox (← links)
- HPL3/SOMA/Scripting/cLightPoint (← links)
- HPL3/SOMA/Scripting/cLightSpot (← links)
- HPL3/SOMA/Scripting/cLuxAgent (← links)
- HPL3/SOMA/Scripting/cLuxArea (← links)
- HPL3/SOMA/Scripting/cLuxCharMover (← links)
- HPL3/SOMA/Scripting/cLuxClosestCharCollider (← links)
- HPL3/SOMA/Scripting/cLuxCritter (← links)
- HPL3/SOMA/Scripting/cLuxEntityMessageData (← links)
- HPL3/SOMA/Scripting/cLuxForceEmitter (← links)
- HPL3/SOMA/Scripting/cLuxLiquidArea (← links)
- HPL3/SOMA/Scripting/cLuxMap (← links)
- HPL3/SOMA/Scripting/cLuxPathfinder (← 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/cMatrixf (← links)
- HPL3/SOMA/Scripting/cMeshEntity (← links)
- HPL3/SOMA/Scripting/cNode3D (← links)
- HPL3/SOMA/Scripting/cParticleSystem (← links)
- HPL3/SOMA/Scripting/cPhysicsContactData (← links)