Menu ▾ ▴

#134 RigidBody Physics examples.

X3D4
open
None
5 days ago
5 days ago
No

Here are some physics examples, originally from the archive. There is still a little bit to do in X3DJSAIL, and one example, CarDemoMain has some strange Sensors with WHEEL and GAMEPAD DEFs.

The X3dtoJson.xslt has a couple of tweaks; you can review with JSON output.

$ for i in *.x3d; do echo $i; java -cp ~/X3DJSONLD/X3DJSAIL.4.0.full.jar org.web3d.x3d.jsail.CommandLine -validate $i; done 2>&1|grep Cast|sort -u

Results:

[error] X3DLoaderDOM: Incorrectly handled X3DJSAIL object construction, current elementObject=CollidableShape (CollidableShape), child="Shape", containerField="shape", java.lang.ClassCastException: class org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape cannot be cast to class org.web3d.x3d.sai.Grouping.X3DGroupingNode (org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape and org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of loader 'app')

java.lang.ClassCastException: class org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape cannot be cast to class org.web3d.x3d.sai.Grouping.X3DGroupingNode (org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape and org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of loader 'app')

Don't be surprised if there's a huge log of these. It just boils down to allowing a containerField=shape in the Shape node (to fit in CollidalbeShape.shape field).

The example JSON should guide you to implemented needed changes in RigidBody.geometry (it's an MFNode).

I will download latest X3DJSAIL now.

John

1 Attachments

Discussion

  • John W Carlson

    John W Carlson - 5 days ago
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -12,7 +12,7 @@
    
     java.lang.ClassCastException: class org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape cannot be cast to class org.web3d.x3d.sai.Grouping.X3DGroupingNode (org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape and org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of loader 'app')
    
    -Don't be surprise if there's a huge log of these.   It just boils down to allowing a containerField=shape in the Shape node (to fitein CollidalbeShape.shape field).
    +Don't be surprised if there's a huge log of these.   It just boils down to allowing a containerField=shape in the Shape node (to fitein CollidalbeShape.shape field).
    
    
     The example JSON should guide you to implemented needed changes in RigidBody.geometry (it's an MFNode).
    
     
  • John W Carlson

    John W Carlson - 5 days ago

    Here's one more X3DJSAIL unique log message. Looks related to above.

    [error] X3DLoaderDOM: Parent-child node relationship not found! (parent CollidableShape, child Shape, containerField='shape')

     
  • John W Carlson

    John W Carlson - 5 days ago
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -12,7 +12,7 @@
    
     java.lang.ClassCastException: class org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape cannot be cast to class org.web3d.x3d.sai.Grouping.X3DGroupingNode (org.web3d.x3d.jsail.RigidBodyPhysics.CollidableShape and org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of loader 'app')
    
    -Don't be surprised if there's a huge log of these.   It just boils down to allowing a containerField=shape in the Shape node (to fitein CollidalbeShape.shape field).
    +Don't be surprised if there's a huge log of these.   It just boils down to allowing a containerField=shape in the Shape node (to fit in CollidalbeShape.shape field).
    
    
     The example JSON should guide you to implemented needed changes in RigidBody.geometry (it's an MFNode).
    
     

Log in to post a comment.