Menu

#115 RigidBody.geometry is object/SFNode in JSON, should be array/MFNode.

X3D4
open
None
2026-06-19
2026-06-19
No

https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/rigidBodyPhysics.html#RigidBody

37.4.10 RigidBody
RigidBody : X3DNode, X3DBoundedObject {
[snip]
MFNode [in,out] geometry [] [X3DNBodyCollidableNode]
[snip]
}

https://www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/UniversalJointExample.x3d

https://www.web3d.org/x3d/content/examples/Basic/RigidBodyPhysics/UniversalJointExample.json

Problematic area in JSON:

{ "RigidBody":
{
"@DEF":"BODY-2",
"@angularDampingFactor":0,
"@mass":0.1,
"@orientation":[0.0,0.0,1.0,0.7854],
"@position":[-0.35355,-0.35355,0.0],
"@useGlobalGravity":false,
"-geometry":
{ "CollidableShape":
{
"@USE":"BOX-GEOM-2"
}
}
}
}

            Proposed/Recommended fix:

             { "RigidBody":
              {
                "@DEF":"BODY-2",
                "@angularDampingFactor":0,
                "@mass":0.1,
                "@orientation":[0.0,0.0,1.0,0.7854],
                "@position":[-0.35355,-0.35355,0.0],
                "@useGlobalGravity":false,
                "-geometry":[
                  { "CollidableShape":
                    {
                      "@USE":"BOX-GEOM-2"
                    }
                  }
                  ]
              }
            }

            Note additional square brackets around CollidableShape object in fix.

            Even if the examples in the archive are bad, we still have to be concerned in JSON between an SFNOde (object) and MFNode (array).

Discussion

  • John W Carlson

    John W Carlson - 2026-06-19
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,5 @@
    +https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4.1-CD/Part01/components/rigidBodyPhysics.html#RigidBody
    +
     37.4.10 RigidBody
     RigidBody : X3DNode, X3DBoundedObject {
     [snip]
    
     
  • John W Carlson

    John W Carlson - 2026-06-19
    • summary: RigidBody.geometry is object/SFNode in JSON, should be array/SFNode. --> RigidBody.geometry is object/SFNode in JSON, should be array/MFNode.
     

Log in to post a comment.