<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FCommunity%2FScripting%2FClasses%2Fcvector4f</id>
	<title>HPL3/Community/Scripting/Classes/cvector4f - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=HPL3%2FCommunity%2FScripting%2FClasses%2Fcvector4f"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/Community/Scripting/Classes/cvector4f&amp;action=history"/>
	<updated>2026-05-14T15:46:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=HPL3/Community/Scripting/Classes/cvector4f&amp;diff=2125&amp;oldid=prev</id>
		<title>Maintenance script: Upload classes to sub</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=HPL3/Community/Scripting/Classes/cvector4f&amp;diff=2125&amp;oldid=prev"/>
		<updated>2020-07-30T09:11:16Z</updated>

		<summary type="html">&lt;p&gt;Upload classes to sub&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==cVector4f==&lt;br /&gt;
&lt;br /&gt;
===Fields===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=1&lt;br /&gt;
! Field Name !! Type !! Description &lt;br /&gt;
|-&lt;br /&gt;
|  x  ||  float  ||  The x value of the vector. &lt;br /&gt;
|-&lt;br /&gt;
|  y  ||  float  ||  The y value of the vector. &lt;br /&gt;
|-&lt;br /&gt;
|  z  ||  float  ||  The z value of the vector. &lt;br /&gt;
|-&lt;br /&gt;
|  w  ||  float  ||  The w value of the vector. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; border=1&lt;br /&gt;
! Return Type !! Function Name !! Parameters !! Description &lt;br /&gt;
|-&lt;br /&gt;
|  float  ||  GetElement  ||  uint64 alIdx, &amp;lt;br /&amp;gt;const  ||  Gets the value at the given index. (Indices 0, 1, 2, and 3 are equal to x, y, z, and w respectively.) &lt;br /&gt;
|-&lt;br /&gt;
|  void  ||  SetElement  ||  uint64 alIdx, &amp;lt;br /&amp;gt;float, &amp;lt;br /&amp;gt;const  ||  Sets the value at the given index to the given value. (Indices 0, 1, 2, and 3 are equal to x, y, z, and w respectively.) &lt;br /&gt;
|-&lt;br /&gt;
|  float  ||  SqrLength  ||  const  ||  Returns the length-squared of this vector. &lt;br /&gt;
|-&lt;br /&gt;
|  float  ||  Length  ||  const  ||  Returns the length of this vector. &lt;br /&gt;
|-&lt;br /&gt;
|  float  ||  Normalize  ||       ||  Returns the normalization factor for this vector. (See Remarks.) &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Remarks===&lt;br /&gt;
&lt;br /&gt;
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, z, and w coordinates by that factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;cVector4f vBaseVector(2.0, 5.0, 3.0, 4.0);&lt;br /&gt;
float fNormFactor = vBaseVector.Normalize();&lt;br /&gt;
cVector3f vNormalizedVector(vBaseVector.x / fNormFactor, &lt;br /&gt;
                            vBaseVector.y / fNormFactor, &lt;br /&gt;
                            vBaseVector.z / fNormFactor,&lt;br /&gt;
                            vBaseVector.w / fNormFactor);&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>