<?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=CameraExampleCode</id>
	<title>CameraExampleCode - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.crumbledworld.com/index.php?action=history&amp;feed=atom&amp;title=CameraExampleCode"/>
	<link rel="alternate" type="text/html" href="https://wiki.crumbledworld.com/index.php?title=CameraExampleCode&amp;action=history"/>
	<updated>2026-04-22T01:52:02Z</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=CameraExampleCode&amp;diff=141&amp;oldid=prev</id>
		<title>Anders: Created page with &quot;==Example Code==  &lt;syntaxhighlight lang=&quot;lua&quot;&gt;  --this = Camera() function create() 	keyBinds = Core.getBillboard(&quot;keyBind&quot;); 	keyBindForward = keyBinds:getKeyBind(&quot;forward&quot;); 	keyBindBackward = keyBinds:getKeyBind(&quot;backward&quot;); 	keyBindLeft = keyBinds:getKeyBind(&quot;left&quot;); 	keyBindRight = keyBinds:getKeyBind(&quot;right&quot;);     end  function update() 	local deltaTime = Core.getDeltaTime() 	local localMat = this:getLocalMatrix() 	if keyBindForward:getHeld() then 		localMat:setPos...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.crumbledworld.com/index.php?title=CameraExampleCode&amp;diff=141&amp;oldid=prev"/>
		<updated>2025-07-06T07:49:30Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Example Code==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;  --this = Camera() function create() 	keyBinds = Core.getBillboard(&amp;quot;keyBind&amp;quot;); 	keyBindForward = keyBinds:getKeyBind(&amp;quot;forward&amp;quot;); 	keyBindBackward = keyBinds:getKeyBind(&amp;quot;backward&amp;quot;); 	keyBindLeft = keyBinds:getKeyBind(&amp;quot;left&amp;quot;); 	keyBindRight = keyBinds:getKeyBind(&amp;quot;right&amp;quot;);     end  function update() 	local deltaTime = Core.getDeltaTime() 	local localMat = this:getLocalMatrix() 	if keyBindForward:getHeld() then 		localMat:setPos...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Example Code==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--this = Camera()&lt;br /&gt;
function create()&lt;br /&gt;
	keyBinds = Core.getBillboard(&amp;quot;keyBind&amp;quot;);&lt;br /&gt;
	keyBindForward = keyBinds:getKeyBind(&amp;quot;forward&amp;quot;);&lt;br /&gt;
	keyBindBackward = keyBinds:getKeyBind(&amp;quot;backward&amp;quot;);&lt;br /&gt;
	keyBindLeft = keyBinds:getKeyBind(&amp;quot;left&amp;quot;);&lt;br /&gt;
	keyBindRight = keyBinds:getKeyBind(&amp;quot;right&amp;quot;);    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function update()&lt;br /&gt;
	local deltaTime = Core.getDeltaTime()&lt;br /&gt;
	local localMat = this:getLocalMatrix()&lt;br /&gt;
	if keyBindForward:getHeld() then&lt;br /&gt;
		localMat:setPosition( localMat:getPosition() - localMat:getAtVec() * deltaTime * 20 )&lt;br /&gt;
	end&lt;br /&gt;
	if keyBindBackward:getHeld() then&lt;br /&gt;
		localMat:setPosition( localMat:getPosition() + localMat:getAtVec() * deltaTime * 20 )&lt;br /&gt;
	end&lt;br /&gt;
	if keyBindLeft:getHeld() then&lt;br /&gt;
		localMat:setPosition( localMat:getPosition() - localMat:getRightVec() * deltaTime * 20 )&lt;br /&gt;
	end&lt;br /&gt;
	if keyBindRight:getHeld() then&lt;br /&gt;
		localMat:setPosition( localMat:getPosition() + localMat:getRightVec() * deltaTime * 20 )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--update rotate&lt;br /&gt;
	if Core.getInput():getKeyHeld(Key.space) then&lt;br /&gt;
		local moseDiff = Core.getInput():getMouseDelta() * 0.002&lt;br /&gt;
		quatRot = Quat()&lt;br /&gt;
		quatRot:fromEuler(moseDiff.y, moseDiff.x, 0.0)&lt;br /&gt;
		localMat = localMat * quatRot:getMatrix()&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	this:setLocalMatrix(localMat)&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Anders</name></author>
	</entry>
</feed>