create_physics_scene
Create a physics scene by setting gravity and scene name, adding a ground plane only when the stage lacks one to prevent duplicate collision floors.
Instructions
Create a physics scene, adding a ground plane only if the stage lacks one. Call get_scene_info first to verify connection.
A loaded environment usually brings its own collision floor, and this does not add a second one on top of it — provided load_environment ran BEFORE this call. The check happens once, here: call this first and the environment's floor arrives afterwards, leaving two collision floors with the engine deciding which one objects land on. load_environment reports that case as "collision_floor_warning". The response reports "ground_plane" — the floor objects will actually land on — and "ground_plane_created", false when the stage already had one. Read the floor's height from that prim rather than assuming z=0; an environment's floor is not always at the origin.
The check recognises a collision-enabled prim of type Plane, which is what the shipped environments author. An environment whose floor is a Mesh is NOT recognised, so a second plane is added and two collision floors end up on the stage — which one wins is the physics engine's decision. When "ground_plane_created" is true after loading an environment, verify the floor before placing anything on it.
Args: gravity: Gravity vector [x, y, z]. Default is standard gravity. scene_name: Name for the physics scene prim.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gravity | No | ||
| scene_name | No | PhysicsScene |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |