{
  "X3D": {
    "encoding": "UTF-8",
    "@profile": "Full",
    "@version": "4.1",
    "@xsd:noNamespaceSchemaLocation": "https://www.web3d.org/specifications/x3d-4.1.xsd",
    "JSON schema": "https://www.web3d.org/specifications/x3d-4.1-JSONSchema.autogenerated.json",
    "head": {
      "component": [
        {
          "@name": "RigidBodyPhysics",
          "@level": 2
        }
      ],
      "meta": [
        {
          "@name": "title",
          "@content": "softbodyscene.json"
        },
        {
          "@name": "creator",
          "@content": "John Carlson"
        },
        {
          "@name": "creator",
          "@content": "Kripken (Ammo.js)"
        },
        {
          "@name": "creator",
          "@content": "Bullet Physics (C++)"
        },
        {
          "@name": "created",
          "@content": "08 March 2026"
        },
        {
          "@name": "generator",
          "@content": "Gemini 3.1"
        },
        {
          "@name": "identifier",
          "@content": "https://coderextreme.net/X3DJSONLD/src/main/data/softbodyscene.json"
        },
        {
          "@name": "reference",
          "@content": "https://github.com/kripken/ammo.js/blob/main/examples/webgl_demo_softbody_cloth/index.html"
        },
        {
          "@name": "description",
          "@content": "an example of soft body physics with a swingable cloth, brick wall and bouncy ball"
        }
      ]
    },
    "Scene": {
      "-children": [
        {
          "Background": {
            "@skyColor": [0.749, 0.820, 0.898]
          }
        },
        {
          "Viewpoint": {
            "@position": [-14, 12, 12],
            "@fieldOfView": 1.0472,
            "@centerOfRotation": [0, 3, 0]
          }
        },
        {
          "EnvironmentLight": {
            "@color": [0.251, 0.251, 0.251],
            "@ambientIntensity": 1.0
          }
        },
        {
          "DirectionalLight": {
            "@color": [1, 1, 1],
            "@intensity": 1.0,
            "@direction": [0.4667, -1, -1]
          }
        },
	{ 
	  "Transform": {
	    "@translation": [0, 6, 0],
	    "-children": [
	      {
		"Shape": {
		  "-geometry": {
		    "Text": {
		      "@DEF": "Features",
		      "@string": ["X3D JSON", "Ammo.js", "Three.JS", "WebGPU"],
		      "-fontStyle": { "FontStyle": { "@size": 0.8 } }
		    }
		  },
		  "-appearance": {
		    "Appearance": {
		      "-material": {
			"Material": {
			  "@diffuseColor": [1, 1, 0],
			  "@emissiveColor": [0.5, 0.5, 0]
			}
		      }
		    }
		  }
		}
	      }
	    ]
	  }
	},
	{
              "Transform": {
	            "@translation": [0, 6, 0],
                    
                    "@rotation": [1, 0, 0, 1.5708],
                    "-children": [
	        	{ "Inline": { "DEF": "MyInline", "@url" : [ "HumanoidComplete.x3dj" ] } }
		    ]
	      }
        },
        {
          "IMPORT": {
            "@inlineDEF": "MyInline",
            "@importedDEF": "GrampsSkin",
            "@AS": "GrampsSkin"
          }
        },
        {
          "RigidBodyCollection": {
            "@gravity": [0, -9.8, 0],
            "-bodies": [
              { "SoftBody": { "@DEF": "Features", "@mass": 1, "@position": [0, 6, 0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "@USE": "" } } } } ] } },
              { "RigidBody": { "@DEF": "Ground", "@mass": 0, "@position": [0, -0.5, 0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.8, 0.8] } } } }, "-geometry": { "Box": { "@size": [40, 1, 40] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Base", "@mass": 0, "@position": [-3, 0.1, -5], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.37, 0.37, 0.37] } } } }, "-geometry": { "Box": { "@size": [1, 0.2, 1] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Pylon", "@mass": 0, "@position": [-3, 3, -5], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.37, 0.37, 0.37] } } } }, "-geometry": { "Box": { "@size": [0.4, 6, 0.4] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Arm", "@mass": 2, "@position": [-3, 6.2, -1.5], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.37, 0.37, 0.37] } } } }, "-geometry": { "Box": { "@size": [0.4, 0.4, 7.4] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L1_1", "@mass": 0.5, "@position": [0, 0.3, -4.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_2", "@mass": 0.5, "@position": [0, 0.3, -3.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_3", "@mass": 0.5, "@position": [0, 0.3, -1.8], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_4", "@mass": 0.5, "@position": [0, 0.3, -0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_5", "@mass": 0.5, "@position": [0, 0.3, 0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_6", "@mass": 0.5, "@position": [0, 0.3, 1.8], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_7", "@mass": 0.5, "@position": [0, 0.3, 3.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L1_8", "@mass": 0.5, "@position": [0, 0.3, 4.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L2_1", "@mass": 0.5, "@position": [0, 0.9, -3.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L2_2", "@mass": 0.5, "@position": [0, 0.9, -2.4], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L2_3", "@mass": 0.5, "@position": [0, 0.9, -1.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L2_4", "@mass": 0.5, "@position": [0, 0.9, 0.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L2_5", "@mass": 0.5, "@position": [0, 0.9, 1.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L2_6", "@mass": 0.5, "@position": [0, 0.9, 2.4], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L2_7", "@mass": 0.5, "@position": [0, 0.9, 3.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L3_1", "@mass": 0.5, "@position": [0, 1.5, -3.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L3_2", "@mass": 0.5, "@position": [0, 1.5, -1.8], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L3_3", "@mass": 0.5, "@position": [0, 1.5, -0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L3_4", "@mass": 0.5, "@position": [0, 1.5, 0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L3_5", "@mass": 0.5, "@position": [0, 1.5, 1.8], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L3_6", "@mass": 0.5, "@position": [0, 1.5, 3.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L4_1", "@mass": 0.5, "@position": [0, 2.1, -2.4], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L4_2", "@mass": 0.5, "@position": [0, 2.1, -1.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L4_3", "@mass": 0.5, "@position": [0, 2.1, 0.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L4_4", "@mass": 0.5, "@position": [0, 2.1, 1.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L4_5", "@mass": 0.5, "@position": [0, 2.1, 2.4], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L5_1", "@mass": 0.5, "@position": [0, 2.7, -1.8], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L5_2", "@mass": 0.5, "@position": [0, 2.7, -0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L5_3", "@mass": 0.5, "@position": [0, 2.7, 0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L5_4", "@mass": 0.5, "@position": [0, 2.7, 1.8], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L6_1", "@mass": 0.5, "@position": [0, 3.3, -1.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L6_2", "@mass": 0.5, "@position": [0, 3.3, 0.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.6, 0.2, 0.1] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L6_3", "@mass": 0.5, "@position": [0, 3.3, 1.2], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L7_1", "@mass": 0.5, "@position": [0, 3.9, -0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Brick_L7_2", "@mass": 0.5, "@position": [0, 3.9, 0.6], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.7, 0.4, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },

              { "RigidBody": { "@DEF": "Brick_L8_1", "@mass": 0.5, "@position": [0, 4.5, 0.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Box": { "@size": [0.6, 0.6, 1.2] } } } } } } ] } },
              { "RigidBody": { "@DEF": "Cylinder", "@mass": 0.5, "@position": [0, 4.5, 0.0], "-geometry": [ { "CollidableShape": { "-shape": { "Shape": { "-appearance": { "Appearance": { "-material": { "Material": { "@diffuseColor": [0.8, 0.3, 0.2] } } } }, "-geometry": { "Cylinder": { "@height": 1.0, "@radius": 1.0 } } } } } } ] } } ,
              {
                "RigidBody": {
                  "@DEF": "Gramps",
                  "@mass": 1.5,
                  "@position": [0, 3.0, 0.0],
                  "@orientation": [1, 0, 0, 1.5708],
		  "@scale": [0.025, 0.025, 0.025],
                  "-geometry": [
                    {
                      "CollidableShape": {
                        "-shape": {
                          "Shape": { "USE": "GrampsSkin" }
                        }
                      }
		    }
                  ]
		}
              },
	      {
                "SoftBody": {
                  "@DEF": "Cloth",
                  "@mass": 1.5,
                  "@position": [-3, 1.0, 2.0],
                  "-geometry": [
                    {
                      "CollidableShape": {
                        "-shape": {
                          "Shape": {
                            "-appearance": {
                              "Appearance": {
                                "-material": {
                                  "Material": {
                                    "@diffuseColor": [0.9, 0.9, 0.9]
                                  }
                                }
                              }
                            },
                            "-geometry": {
                              "ElevationGrid": {
                                "@xDimension": 36,
                                "@zDimension": 26,
                                "@xSpacing": 0.2,
                                "@zSpacing": 0.2
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              },
              {
                "SoftBody": {
                  "@DEF": "SquishyBall",
                  "@mass": 2.5,
                  "@position": [0, 15, 1.5],
                  "-geometry": [
                    {
                      "CollidableShape": {
                        "-shape": {
                          "Shape": {
                            "-appearance": {
                              "Appearance": {
                                "-material": {
                                  "Material": {
                                    "@diffuseColor": [0.2, 0.8, 0.4]
                                  }
                                }
                              }
                            },
                            "-geometry": {
                              "Sphere": {
                                "@radius": 1.0
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            ],
            "-joints": [
              {
                "SingleAxisHingeJoint": {
                  "@DEF": "ArmHinge",
                  "@anchorPoint": [-3, 6, -5],
                  "@axis": [0, 1, 0],
                  "-body1": {
                    "RigidBody": {
                      "@USE": "Pylon"
                    }
                  },
                  "-body2": {
                    "RigidBody": {
                      "@USE": "Arm"
                    }
                  }
                }
              },
              {
                "Stitch": {
                  "@DEF": "ArmClothStitch",
                  "@body1Index": [0, 7, 14, 21, 28, 35],
                  "@weight": [1, 1, 1, 1, 1, 1],
                  "-body1": {
                    "RigidBody": {
                      "@USE": "Arm"
                    }
                  },
                  "-body2": {
                    "SoftBody": {
                      "@USE": "Cloth"
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}
