<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.2//EN" "https://www.web3d.org/specifications/x3d-3.2.dtd">
<![CDATA[
ecmascript: function set_jointContacts(val) { for(i = 0; i < val.length; i++) { if(val[i].geometry1.equals(ground)) { val[i].geometry1 = null; val[i].body1 = null; val[i].bounce = 1; } if(val[i].geometry2.equals(ground)) { val[i].geometry2 = null; val[i].body2 = null; val[i].bounce = 1; } } correctedContacts = val; } function activeSensor(val) { if(val) { indicatorColor.r = 0; indicatorColor.g = 1; indicatorColor.b = 0; } else { indicatorColor.r = 1; indicatorColor.g = 0; indicatorColor.b = 0; } }
]]>
Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.
Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.
COLLISION-OUTPUT
CollisionSensor contacts MFNode |
CONTACT-SCRIPT
Script set_jointContacts MFNode |
then |
CONTACT-SCRIPT
Script correctedContacts MFNode |
BODY-COLLECTION
RigidBodyCollection set_contacts MFNode |
||
then |
CONTACT-SCRIPT
Script indicatorColor SFColor |
INDICATOR-MATERIAL
Material emissiveColor SFColor |
||||
COLLISION-OUTPUT
CollisionSensor isActive SFBool |
CONTACT-SCRIPT
Script activeSensor SFBool |
then |
CONTACT-SCRIPT
Script correctedContacts MFNode |
BODY-COLLECTION
RigidBodyCollection set_contacts MFNode |
||
then |
CONTACT-SCRIPT
Script indicatorColor SFColor |
INDICATOR-MATERIAL
Material emissiveColor SFColor |
<!--
Online at
https://www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BallBounceIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/BallBounce.x3d
-->
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->