<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.crumbledworld.com/index.php?action=history&amp;feed=atom&amp;title=Matrix</id>
	<title>Matrix - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.crumbledworld.com/index.php?action=history&amp;feed=atom&amp;title=Matrix"/>
	<link rel="alternate" type="text/html" href="https://wiki.crumbledworld.com/index.php?title=Matrix&amp;action=history"/>
	<updated>2026-04-21T23:07:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.4</generator>
	<entry>
		<id>https://wiki.crumbledworld.com/index.php?title=Matrix&amp;diff=44&amp;oldid=prev</id>
		<title>Anders: Created page with &quot;{{:MatrixExampleCode}}  ==Constructor== {| class=&quot;wikitable&quot;  !|function !|description |- |Matrix(float* x) |x is array of length 16 |- |Matrix(Vec3 position) | |- |Matrix(Matrix mat) | |- |Matrix() | |- |}  ==Functions== {| class=&quot;wikitable&quot; !|return !|function !|description |- |Vec3 |getRightVec() |Returns the Right Vector. |- |Vec3 |getUpVec() |Returns the Up Vector. |- |Vec3 |[[Matrix:getAtVec()|getAtVec]...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.crumbledworld.com/index.php?title=Matrix&amp;diff=44&amp;oldid=prev"/>
		<updated>2025-07-05T13:37:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{:MatrixExampleCode}}  ==Constructor== {| class=&amp;quot;wikitable&amp;quot;  !|function !|description |- |Matrix(float* x) |x is array of length 16 |- |Matrix(&lt;a href=&quot;/index.php/Vec3&quot; title=&quot;Vec3&quot;&gt;Vec3&lt;/a&gt; position) | |- |Matrix(Matrix mat) | |- |Matrix() | |- |}  ==Functions== {| class=&amp;quot;wikitable&amp;quot; !|return !|function !|description |- |&lt;a href=&quot;/index.php/Vec3&quot; title=&quot;Vec3&quot;&gt;Vec3&lt;/a&gt; |&lt;a href=&quot;/index.php?title=Matrix:getRightVec()&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Matrix:getRightVec() (page does not exist)&quot;&gt;getRightVec&lt;/a&gt;() |Returns the Right Vector. |- |&lt;a href=&quot;/index.php/Vec3&quot; title=&quot;Vec3&quot;&gt;Vec3&lt;/a&gt; |&lt;a href=&quot;/index.php?title=Matrix:getUpVec()&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Matrix:getUpVec() (page does not exist)&quot;&gt;getUpVec&lt;/a&gt;() |Returns the Up Vector. |- |&lt;a href=&quot;/index.php/Vec3&quot; title=&quot;Vec3&quot;&gt;Vec3&lt;/a&gt; |[[Matrix:getAtVec()|getAtVec]...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{:MatrixExampleCode}}&lt;br /&gt;
&lt;br /&gt;
==Constructor==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!|function&lt;br /&gt;
!|description&lt;br /&gt;
|-&lt;br /&gt;
|Matrix(float* x)&lt;br /&gt;
|x is array of length 16&lt;br /&gt;
|-&lt;br /&gt;
|Matrix([[Vec3]] position)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Matrix(Matrix mat)&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Matrix()&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!|return&lt;br /&gt;
!|function&lt;br /&gt;
!|description&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|[[Matrix:getRightVec()|getRightVec]]()&lt;br /&gt;
|Returns the Right Vector.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|[[Matrix:getUpVec()|getUpVec]]()&lt;br /&gt;
|Returns the Up Vector.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|[[Matrix:getAtVec()|getAtVec]]()&lt;br /&gt;
|Returns the At Vector&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|[[Matrix:getPosition()|getPosition]]()&lt;br /&gt;
|Returns the position.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|[[Matrix:getScale()|getScale]]()&lt;br /&gt;
|Returns the length of right, up and at vector.&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|[[Matrix:getRotation()|getRotation]]()&lt;br /&gt;
|Returns the matrix approximated rotation.&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:setRightVec(Vec3 rightVec)|setUpVec]]([[Vec3]] rightVec)&lt;br /&gt;
|Set right Vector.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:setUpVec(Vec3 upVec)|setUpVec]]([[Vec3]] upVec)&lt;br /&gt;
|Set up Vector.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:setAtVec(Vec3 atVec)|setAtVec]]([[Vec3]] atVec)&lt;br /&gt;
|Set at Vector.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:setPosition(Vec3 position)|setPosition]]([[Vec3]] position)&lt;br /&gt;
|Set position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:setRotation(Vec3 rotation)|setRotation]]([[Vec3]] rotation)&lt;br /&gt;
|Set rotation.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:setScale(Vec3 scale)|setScale]]([[Vec3]] scale)&lt;br /&gt;
|Set scale.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:identity()|setScale]]()&lt;br /&gt;
|Set identity.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:createMatrix(Vec3 at, Vec3 up)|createMatrix]]([[Vec3]] at, [[Vec3]] up)&lt;br /&gt;
|Create matrix from the given at and up.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:createMatrixR(Vec3 right, Vec3 upVec)|createMatrix]]([[Vec3]] right, [[Vec3]] up)&lt;br /&gt;
|Create matrix from the given right and up.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:createMatrixUp(Vec3 up, Vec3 right)|createMatrix]]([[Vec3]] up, [[Vec3]] right)&lt;br /&gt;
|Create matrix from the given up and right.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:scale(Vec3 scale)|scale]]([[Vec3]] scale)&lt;br /&gt;
|Scale the matrix right up and at vec by the given scale.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:scale(float value)|scale]](float value)&lt;br /&gt;
|Scale the matrix right up and at vec by the given value.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:scale(float value)|scale]](float value)&lt;br /&gt;
|Scale the matrix right up and at vec by the given value.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:translate(Vec3 vec)|translate]]([[Vec3]] vec)&lt;br /&gt;
|Translate this matrix with the given vector.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:rotationOnly()|rotationOnly]]()&lt;br /&gt;
|Clear position.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:inverse()|inverse]]()&lt;br /&gt;
|Inverse Matrix.&lt;br /&gt;
|-&lt;br /&gt;
|[[Matrix]]&lt;br /&gt;
|[[Matrix:inverseM()|inverseM]]()&lt;br /&gt;
|Return a inverse Matrix.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:normalize()|normalize]]()&lt;br /&gt;
|Normalize right, up and at vector.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|[[Matrix:rotate(Vec3 axis, float degrees)|rotate]]([[Vec3]] axis, float rad)&lt;br /&gt;
|Set fixed rotation around a given axis.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!|return&lt;br /&gt;
!|function&lt;br /&gt;
!|description&lt;br /&gt;
|-&lt;br /&gt;
|Matrix&lt;br /&gt;
|Matrix * Matrix&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec4]]&lt;br /&gt;
|Matrix * [[Vec4]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[[Vec3]]&lt;br /&gt;
|Matrix * [[Vec3]]&lt;br /&gt;
|equal to Matrix * [[Vec4]]([[Vec3]](), 1.0)&lt;br /&gt;
|-&lt;br /&gt;
|Matrix&lt;br /&gt;
|Matrix * float&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|bool&lt;br /&gt;
|Matrix == Matrix&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Anders</name></author>
	</entry>
</feed>