<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://oxeyegames.com/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=GetEntityCollisions</id>
		<title>GetEntityCollisions - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://oxeyegames.com/wiki/index.php?action=history&amp;feed=atom&amp;title=GetEntityCollisions"/>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=GetEntityCollisions&amp;action=history"/>
		<updated>2026-04-09T10:17:59Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://oxeyegames.com/wiki/index.php?title=GetEntityCollisions&amp;diff=412&amp;oldid=prev</id>
		<title>Jeb: Created page with '{{PhysicsMethod| physics:getEntityCollisions(entityId) | Fetches a list of current collision points for a given entity. This list will not include sensor points, they are stored ...'</title>
		<link rel="alternate" type="text/html" href="http://oxeyegames.com/wiki/index.php?title=GetEntityCollisions&amp;diff=412&amp;oldid=prev"/>
				<updated>2010-02-07T12:56:29Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#39;{{PhysicsMethod| physics:getEntityCollisions(entityId) | Fetches a list of current collision points for a given entity. This list will not include sensor points, they are stored ...&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PhysicsMethod|&lt;br /&gt;
physics:getEntityCollisions(entityId)&lt;br /&gt;
|&lt;br /&gt;
Fetches a list of current collision points for a given entity. This list will not include sensor points, they are stored in a separate list and are fetched with [[getEntitySensorPoints]].&lt;br /&gt;
|&lt;br /&gt;
{{MethodParam|enitityId|An integer|The entity's body identifier.}}&lt;br /&gt;
|&lt;br /&gt;
Returns a table containing collision elements (see below). If no collisions are found, this method returns nil to save some garbage collection performance. In other words, the returned table is never empty, it's either nil or non-empty.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Collision Info ===&lt;br /&gt;
&lt;br /&gt;
The returned table contains a list of collision points. Each point has the following info:&lt;br /&gt;
&lt;br /&gt;
{| border=2 cellpadding=3 cellspacing=0 style=&amp;quot;margin: 0 0 1em 1em; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#c797d7&amp;quot;| '''Parameter'''&lt;br /&gt;
|style=&amp;quot;background:#c797d7&amp;quot;| '''Type'''&lt;br /&gt;
|style=&amp;quot;background:#c797d7&amp;quot;| '''Description'''&lt;br /&gt;
|-&lt;br /&gt;
{{MethodParam|x|A number|The world X position of the collision point, measured in meters.}}&lt;br /&gt;
{{MethodParam|y|A number|The world Y position of the collision point, measured in meters.}}&lt;br /&gt;
{{MethodParam|nx|A number|The collision point normal's normalized X value. Points towards the entity.}}&lt;br /&gt;
{{MethodParam|ny|A number|The collision point normal's normalized Y value. Points towards the entity.}}&lt;br /&gt;
{{MethodParam|impulse|A number|The collision impulse.}}&lt;br /&gt;
{{MethodParam|id|An integer|The entity identifier of the body that this entity has collided with.}}&lt;br /&gt;
{{MethodParam|userData|A string|If the other entity has userData in the shape that this entity has collided with, that userData will be copied to this value. This is usually nil. See [[Common Shape Settings]].}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   local collisions = physics:getEntityCollisions(player.body)&lt;br /&gt;
   if collisions then&lt;br /&gt;
      for index, info in ipairs(collisions) do&lt;br /&gt;
          local userData = info.userData or &amp;quot;n/a&amp;quot;&lt;br /&gt;
          print(&amp;quot;Collision with &amp;quot;.. info.id .. &amp;quot; at (&amp;quot; .. info.x .. &amp;quot;, &amp;quot; .. info.y .. &amp;quot;), (&amp;quot; ..&lt;br /&gt;
             info.nx .. &amp;quot;, &amp;quot; .. info.ny .. &amp;quot;), &amp;quot; .. info.impulse .. &amp;quot;, &amp;quot; userData)&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jeb</name></author>	</entry>

	</feed>