<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://www.orx-project.org/wiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://www.orx-project.org/wiki/feed.php">
        <title>Orx Learning - en:examples:physics</title>
        <description></description>
        <link>https://www.orx-project.org/wiki/</link>
        <image rdf:resource="https://www.orx-project.org/wiki/_media/favicon.ico" />
       <dc:date>2026-04-15T03:08:13+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://www.orx-project.org/wiki/en/examples/physics/bodypart_name_from_collision_event?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.orx-project.org/wiki/en/examples/physics/get_bodypart_count_on_object?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.orx-project.org/wiki/en/examples/physics/get_body_from_object?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.orx-project.org/wiki/en/examples/physics/main?rev=1759253179&amp;do=diff"/>
                <rdf:li rdf:resource="https://www.orx-project.org/wiki/en/examples/physics/objects_from_collision_event?rev=1759253179&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://www.orx-project.org/wiki/_media/favicon.ico">
        <title>Orx Learning</title>
        <link>https://www.orx-project.org/wiki/</link>
        <url>https://www.orx-project.org/wiki/_media/favicon.ico</url>
    </image>
    <item rdf:about="https://www.orx-project.org/wiki/en/examples/physics/bodypart_name_from_collision_event?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Retrieve BodyPart names from Collision Event</title>
        <link>https://www.orx-project.org/wiki/en/examples/physics/bodypart_name_from_collision_event?rev=1759253179&amp;do=diff</link>
        <description>Retrieve BodyPart names from Collision Event


orxSTATUS orxFASTCALL PhysicsEventHandler(const orxEVENT *_pstEvent)
{
    if (_pstEvent-&gt;eType == orxEVENT_TYPE_PHYSICS) {
        orxPHYSICS_EVENT_PAYLOAD* payload = (orxPHYSICS_EVENT_PAYLOAD*)event-&gt;pstPayload; 
        orxLOG(&quot;Recipient %s | Sender: %s&quot;, payload-&gt;zRecipientPartName, payload-&gt;zSenderPartName);
    }
}</description>
    </item>
    <item rdf:about="https://www.orx-project.org/wiki/en/examples/physics/get_bodypart_count_on_object?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Getting the BodyPart count on an Object</title>
        <link>https://www.orx-project.org/wiki/en/examples/physics/get_bodypart_count_on_object?rev=1759253179&amp;do=diff</link>
        <description>Getting the BodyPart count on an Object


	//someObject defined elsewhere

	int count = 0;
	
	orxBODY *someBody = orxOBJECT_GET_STRUCTURE(someObject , BODY);

	orxBODY_PART *part = orxBody_GetNextPart(someBody, orxNULL);
	while (part != orxNULL){
		orxBODY_PART *nextPart = orxBody_GetNextPart(someBody, part);
		
		if (orxString_Compare(orxBody_GetPartName(part), &quot;SomeBodyPart&quot;) == 0) {
			count++;
		}			
		part = nextPart;
	}
	
	return count;</description>
    </item>
    <item rdf:about="https://www.orx-project.org/wiki/en/examples/physics/get_body_from_object?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Getting the Body from an Object</title>
        <link>https://www.orx-project.org/wiki/en/examples/physics/get_body_from_object?rev=1759253179&amp;do=diff</link>
        <description>Getting the Body from an Object


[Player]
Graphic = PlayerGraphic
Body    = PlayerBody

[PlayerBody]
PartList = PlayerBodyPart 

[PlayerBodyPart]
Type  = box
Solid = true



orxOBJECT *playerObject = orxObject_CreateFromConfig(&quot;Player&quot;);
orxBODY *body = orxOBJECT_GET_STRUCTURE(playerObject, BODY);</description>
    </item>
    <item rdf:about="https://www.orx-project.org/wiki/en/examples/physics/main?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Physics Examples</title>
        <link>https://www.orx-project.org/wiki/en/examples/physics/main?rev=1759253179&amp;do=diff</link>
        <description>Physics Examples

bodypart_name_from_collision_event 
Retrieve BodyPart names from Collision Event
objects_from_collision_event 
Retrieve Objects from Collision Event
get_body_from_object 
Get Body from an Object
get_bodypart_count_on_object 
Get BodyPart Count on an Object
physics 
See Physics Tutorials</description>
    </item>
    <item rdf:about="https://www.orx-project.org/wiki/en/examples/physics/objects_from_collision_event?rev=1759253179&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2025-09-30T17:26:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Retrieve Objects from Collision Event</title>
        <link>https://www.orx-project.org/wiki/en/examples/physics/objects_from_collision_event?rev=1759253179&amp;do=diff</link>
        <description>Retrieve Objects from Collision Event


orxSTATUS orxFASTCALL PhysicsEventHandler(const orxEVENT *_pstEvent)
{
    if (_pstEvent-&gt;eType == orxEVENT_TYPE_PHYSICS) {
        orxPHYSICS_EVENT_PAYLOAD* payload = (orxPHYSICS_EVENT_PAYLOAD*)event-&gt;pstPayload; 
        
        if(_pstEvent-&gt;eID == orxPHYSICS_EVENT_CONTACT_ADD) {
	    orxOBJECT *pstRecipientObject, *pstSenderObject;

            /* Gets colliding objects */
            pstRecipientObject = orxOBJECT(_pstEvent-&gt;hRecipient);
            …</description>
    </item>
</rdf:RDF>
