<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/TestSphereAgainstWorld?action=history&amp;feed=atom</id>
	<title>TestSphereAgainstWorld - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/TestSphereAgainstWorld?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TestSphereAgainstWorld&amp;action=history"/>
	<updated>2026-05-09T20:40:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TestSphereAgainstWorld&amp;diff=81523&amp;oldid=prev</id>
		<title>FileEX: Created page with &quot;{{Client function}} __NOTOC__ {{New feature/item|3.161|1.6.0|22837| The function checks whether there is an object within the given radius and returns information about it. The function works similarly to processLineOfSight, but instead of a straight line, it operates based on the specified radius, forming a sphere.}}  ==Syntax==  Return values labelled for ease of reference. &lt;syntaxhighlight lang=&quot;lua&quot;&gt; bool               -- hit element            -- hitElement floa...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TestSphereAgainstWorld&amp;diff=81523&amp;oldid=prev"/>
		<updated>2024-12-22T01:52:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Client function}} __NOTOC__ {{New feature/item|3.161|1.6.0|22837| The function checks whether there is an object within the given radius and returns information about it. The function works similarly to &lt;a href=&quot;/wiki/ProcessLineOfSight&quot; title=&quot;ProcessLineOfSight&quot;&gt;processLineOfSight&lt;/a&gt;, but instead of a straight line, it operates based on the specified radius, forming a sphere.}}  ==Syntax==  Return values labelled for ease of reference. &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool               -- hit element            -- hitElement floa...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.161|1.6.0|22837|&lt;br /&gt;
The function checks whether there is an object within the given radius and returns information about it. The function works similarly to [[processLineOfSight]], but instead of a straight line, it operates based on the specified radius, forming a sphere.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
Return values labelled for ease of reference.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool               -- hit&lt;br /&gt;
element            -- hitElement&lt;br /&gt;
float float float  -- worldModelPositionX,Y,Z&lt;br /&gt;
float float float  -- worldModelRotationX,Y,Z&lt;br /&gt;
int                -- worldModelID&lt;br /&gt;
int                -- worldLODModelID&lt;br /&gt;
string             -- entity type (vehicle, ped, object etc.)&lt;br /&gt;
                 testSphereAgainstWorld ( float startX, float startY, float startZ, &lt;br /&gt;
                                       float radius, &lt;br /&gt;
                                       [ bool ignoredElement = nil, &lt;br /&gt;
                                       bool checkBuildings = true, &lt;br /&gt;
                                       bool checkVehicles = true, &lt;br /&gt;
                                       bool checkPeds = true, &lt;br /&gt;
                                       bool checkObjects = true, &lt;br /&gt;
                                       bool checkDummies = true, &lt;br /&gt;
                                       bool ignoreSomeObjectsForCamera = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''startX:''' The start ''x'' position&lt;br /&gt;
*'''startY:''' The start ''y'' position&lt;br /&gt;
*'''startZ:''' The start ''z'' position&lt;br /&gt;
*'''radius:''' The radius of the sphere.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''ignoredElement:''' Specifies the element to be excluded from collision detection within the sphere.&lt;br /&gt;
*'''checkBuildings:''' Specifies whether [[Building|buildings]] should be detected, i.e., elements of the default GTA map or those created using [[createBuilding]].&lt;br /&gt;
*'''checkVehicles:''' Specifies whether [[Vehicle|vehicles]] should be detected.&lt;br /&gt;
*'''checkPeds:''' Specifies whether [[Ped|peds]] (including [[Player|players]]) should be detected.&lt;br /&gt;
*'''checkObjects:''' Specifies whether [[Object|objects]] should be detected.&lt;br /&gt;
*'''checkDummies:''' Specifies whether internal GTA dummies should be detected. These are not used in the current MTA version so this argument can be set to ''false''.&lt;br /&gt;
*'''ignoreSomeObjectsForCamera:''' Specifies whether certain elements should be ignored. These are objects that have the (K) property in the 'object.dat' file. (i.e. Most dynamic objects like boxes or barrels).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
The '''modelID''', '''lodID''', '''worldModelPositionX,Y,Z''', '''worldModelRotationX,Y,Z''' and '''entityType''' parameters are returned even if '''hitElement''' is '''nil'''.&lt;br /&gt;
&lt;br /&gt;
*'''hit:''' ''true'' if there is a collision, ''false'' otherwise.&lt;br /&gt;
*'''hitElement:''' the MTA element hit if any, ''nil'' otherwise.&lt;br /&gt;
*'''worldModelPositionX,Y,Z:''' World position of the detected element.&lt;br /&gt;
*'''worldModelRotationX,Y,Z:''' World rotation of the detected element.&lt;br /&gt;
*'''modelID:''' The ID of the element.&lt;br /&gt;
*'''lodID:''' The ID of the element's LOD (or 0).&lt;br /&gt;
*'''entityType:''' The type of the element (building, vehicle, ped, object, dummy).&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>FileEX</name></author>
	</entry>
</feed>