<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Camera%3A%3AgetDirection</id>
	<title>Camera::getDirection - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://rage.grandroleplay.ru/index.php?action=history&amp;feed=atom&amp;title=Camera%3A%3AgetDirection"/>
	<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Camera::getDirection&amp;action=history"/>
	<updated>2026-07-24T20:09:24Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://rage.grandroleplay.ru/index.php?title=Camera::getDirection&amp;diff=613&amp;oldid=prev</id>
		<title>imported&gt;Unknown в 12:29, 21 декабря 2018</title>
		<link rel="alternate" type="text/html" href="https://rage.grandroleplay.ru/index.php?title=Camera::getDirection&amp;diff=613&amp;oldid=prev"/>
		<updated>2018-12-21T12:29:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{ClientsideJsFunction}}&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Get camera direction&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;camera.getDirection();&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Return value===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;Vector3&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This function returns undefined or a valid result, if you point with your camera on something.&lt;br /&gt;
&lt;br /&gt;
{{ClientsideCode|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function pointingAt(distance) {&lt;br /&gt;
    const camera = mp.cameras.new(&amp;quot;gameplay&amp;quot;); // gets the current gameplay camera&lt;br /&gt;
&lt;br /&gt;
    let position = camera.getCoord(); // grab the position of the gameplay camera as Vector3&lt;br /&gt;
&lt;br /&gt;
    let direction = camera.getDirection(); // get the forwarding vector of the direction you aim with the gameplay camera as Vector3&lt;br /&gt;
&lt;br /&gt;
    let farAway = new mp.Vector3((direction.x * distance) + (position.x), (direction.y * distance) + (position.y), (direction.z * distance) + (position.z)); // calculate a random point, drawn on a invisible line between camera position and direction (* distance)&lt;br /&gt;
&lt;br /&gt;
    let result = mp.raycasting.testPointToPoint(position, farAway, [1, 16]); // now test point to point&lt;br /&gt;
&lt;br /&gt;
    return result; // and return the result ( undefined, if no hit )&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Camera_definition_c}}&lt;br /&gt;
[[Category:Clientside API]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Unknown</name></author>
	</entry>
</feed>