Physics Bodies
There are different kinds of physics bodies you can create in 3dverse: static body, rigid body, and kinematic rigid body.
Note that these bodies are all rigid bodies in the classical sense, in that they stay solid and do not deform during collision.
The main difference between the static body and rigid body is that the former is static (expected not to move) during simulation whereas the latter is dynamic (expected to move).
Each of these physics bodies require you to attach some kind of geometry to them which will define their geometry in the physics engine.
Static Body
A static body will not be affected by forces such as gravity.
To make your entity a static body it needs the following components:
-
Physics Material
Entity Component Physics Material physics_material
Physical surface properties used for contact: friction, restitution, optional contact modification, and trigger mode.
SchemacontactVelocity
Vector3(m/s)
Default:[0,0,0]
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
dynamicFriction
Float
Default:0.5
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
isTrigger
Boolean
Default:false
Treat associated geometry as a trigger (generates events but no physical response).
Treat associated geometry as a trigger (generates events but no physical response).
modifyContact
Boolean
Default:false
Enable contact modification (applies contactVelocity on collisions).
Enable contact modification (applies contactVelocity on collisions).
restitution
Float
Default:0
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
staticFriction
Float
Default:0.5
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
- One geometry component from this list: Box Geometry,
Entity Component Box Geometry box_geometry
Box geometry.
Schemadimension
Vector3(m)
Default:[1,1,1]
Box dimensions (width, height, depth) in meters.
Box dimensions (width, height, depth) in meters.
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
Capsule Geometry,Entity Component Capsule Geometry capsule_geometry
Capsule geometry.
Schemaaxis
Integer
Default:1(Y-Axis)
Alignment axis of the capsule: 0=X, 1=Y, 2=Z.
0X-Axis1Y-Axis2Z-Axis
Alignment axis of the capsule: 0=X, 1=Y, 2=Z.
height
Float(m)
Default:1
Height of the cylindrical mid‑section (meters).
Height of the cylindrical mid‑section (meters).
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the hemispherical ends (meters).
Radius of the hemispherical ends (meters).
Sphere Geometry,Entity Component Sphere Geometry sphere_geometry
Sphere geometry.
Schemaoffset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the sphere (meters).
Radius of the sphere (meters).
Cylinder Geometry,Entity Component Cylinder Geometry cylinder_geometry
Cylinder geometry.
Schemaaxis
Integer
Default:1(Y-Axis)
Alignment axis of the cylinder: 0=X, 1=Y, 2=Z.
0X-Axis1Y-Axis2Z-Axis
Alignment axis of the cylinder: 0=X, 1=Y, 2=Z.
height
Float(m)
Default:1
Height of the cylinder (meters).
Height of the cylinder (meters).
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the cylinder (meters).
Radius of the cylinder (meters).
Plane GeometryorEntity Component Plane Geometry plane_geometry
Infinite plane geometry.
Schemadistance
Float(m)
Default:0
Signed distance from the origin along the plane normal (meters).
Signed distance from the origin along the plane normal (meters).
normal
Vector3
Default:[0,1,0]
Unit normal vector of the plane (in local space).
Unit normal vector of the plane (in local space).
Collision Geometry ReferenceEntity Component Collision Geometry Reference collision_geometry_ref
Reference to a collision geometry asset used by physics.
SchemacollisionGeometryRef
Referenced collision geometry (UUID).
Referenced collision geometry (UUID).
Rigid Body
A rigid body will collide against all other physics bodies.
To make your entity a rigid body it needs the following components:
-
Physics Material
Entity Component Physics Material physics_material
Physical surface properties used for contact: friction, restitution, optional contact modification, and trigger mode.
SchemacontactVelocity
Vector3(m/s)
Default:[0,0,0]
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
dynamicFriction
Float
Default:0.5
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
isTrigger
Boolean
Default:false
Treat associated geometry as a trigger (generates events but no physical response).
Treat associated geometry as a trigger (generates events but no physical response).
modifyContact
Boolean
Default:false
Enable contact modification (applies contactVelocity on collisions).
Enable contact modification (applies contactVelocity on collisions).
restitution
Float
Default:0
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
staticFriction
Float
Default:0.5
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
- one geometry component from this list: Box Geometry,
Entity Component Box Geometry box_geometry
Box geometry.
Schemadimension
Vector3(m)
Default:[1,1,1]
Box dimensions (width, height, depth) in meters.
Box dimensions (width, height, depth) in meters.
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
Capsule Geometry,Entity Component Capsule Geometry capsule_geometry
Capsule geometry.
Schemaaxis
Integer
Default:1(Y-Axis)
Alignment axis of the capsule: 0=X, 1=Y, 2=Z.
0X-Axis1Y-Axis2Z-Axis
Alignment axis of the capsule: 0=X, 1=Y, 2=Z.
height
Float(m)
Default:1
Height of the cylindrical mid‑section (meters).
Height of the cylindrical mid‑section (meters).
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the hemispherical ends (meters).
Radius of the hemispherical ends (meters).
Sphere Geometry,Entity Component Sphere Geometry sphere_geometry
Sphere geometry.
Schemaoffset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the sphere (meters).
Radius of the sphere (meters).
Cylinder GeometryorEntity Component Cylinder Geometry cylinder_geometry
Cylinder geometry.
Schemaaxis
Integer
Default:1(Y-Axis)
Alignment axis of the cylinder: 0=X, 1=Y, 2=Z.
0X-Axis1Y-Axis2Z-Axis
Alignment axis of the cylinder: 0=X, 1=Y, 2=Z.
height
Float(m)
Default:1
Height of the cylinder (meters).
Height of the cylinder (meters).
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the cylinder (meters).
Radius of the cylinder (meters).
Collision Geometry Reference(but the collision geometry must be convex, NOT triangular)Entity Component Collision Geometry Reference collision_geometry_ref
Reference to a collision geometry asset used by physics.
SchemacollisionGeometryRef
Referenced collision geometry (UUID).
Referenced collision geometry (UUID).
- Rigid Body(with isKinematic = false)
Entity Component Rigid Body rigid_body
Rigid body parameters for dynamic simulation (mass, damping, limits, CCD, and kinematic/gravity behavior).
SchemaangularDamping
Float(s-1)
Default:0.05
Min:0
Angular damping coefficient (s^-1). 0 = no damping; must be non‑negative.
Angular damping coefficient (s^-1). 0 = no damping; must be non‑negative.
centerOfMass
Vector3(m)
Default:[0,0,0]
Center of mass relative to the entity's local transform (meters).
Center of mass relative to the entity's local transform (meters).
collisionDetection
Unsigned Byte
Default:0(Discrete)
Min:0
Collision detection mode (CCD). Kinematic bodies do not support Linear/Continuous CCD.
0Discrete1LinearContinuous2AngularContinuous3Continuous
Collision detection mode (CCD). Kinematic bodies do not support Linear/Continuous CCD.
isKinematic
Boolean
Default:false
Treat the rigid body as kinematic (unaffected by forces; driven by animation/app logic).
Treat the rigid body as kinematic (unaffected by forces; driven by animation/app logic).
linearDamping
Float(s-1)
Default:0
Min:0
Linear damping coefficient (s^-1). 0 = no damping; must be non‑negative.
Linear damping coefficient (s^-1). 0 = no damping; must be non‑negative.
lockedAxis
Unsigned Byte
Default:0
Min:0
Lock motion along/around the specified axes.
765432101Locks motion along the X axis.
765432102Locks motion along the Y axis.
765432104Locks motion along the Z axis.
765432108Locks motion around the X axis.
7654321016Locks motion around the Y axis.
7654321032Locks motion around the Z axis.
Lock motion along/around the specified axes.
mass
Float(kg)
Default:1
Mass (kg). A value of 0 is treated as infinite mass (static).
Mass (kg). A value of 0 is treated as infinite mass (static).
maxAngularVelocity
Float(rad/s)
Default:100
Min:0
Maximum angular velocity (rad/s). Must be non‑negative.
Maximum angular velocity (rad/s). Must be non‑negative.
maxLinearVelocity
Float(m/s)
Default:10000000000000000
Min:0
Maximum linear velocity (m/s). Must be non‑negative.
Maximum linear velocity (m/s). Must be non‑negative.
useGravity
Boolean
Default:true
Whether the rigid body is affected by gravity.
Whether the rigid body is affected by gravity.
Kinematic Rigid Body
If you move a kinematic rigid body it will collide against rigid bodies, but not against static or kinematic rigid bodies (i.e. if you move it into a static body or another kinematic rigid body, it will go through, but if you move it into a rigid body, this will move your rigid body).
To make your entity a kinematic rigid body it needs the following components:
-
Physics Material
Entity Component Physics Material physics_material
Physical surface properties used for contact: friction, restitution, optional contact modification, and trigger mode.
SchemacontactVelocity
Vector3(m/s)
Default:[0,0,0]
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
dynamicFriction
Float
Default:0.5
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
isTrigger
Boolean
Default:false
Treat associated geometry as a trigger (generates events but no physical response).
Treat associated geometry as a trigger (generates events but no physical response).
modifyContact
Boolean
Default:false
Enable contact modification (applies contactVelocity on collisions).
Enable contact modification (applies contactVelocity on collisions).
restitution
Float
Default:0
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
staticFriction
Float
Default:0.5
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
- one geometry component from this list: Box Geometry,
Entity Component Box Geometry box_geometry
Box geometry.
Schemadimension
Vector3(m)
Default:[1,1,1]
Box dimensions (width, height, depth) in meters.
Box dimensions (width, height, depth) in meters.
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
Capsule Geometry,Entity Component Capsule Geometry capsule_geometry
Capsule geometry.
Schemaaxis
Integer
Default:1(Y-Axis)
Alignment axis of the capsule: 0=X, 1=Y, 2=Z.
0X-Axis1Y-Axis2Z-Axis
Alignment axis of the capsule: 0=X, 1=Y, 2=Z.
height
Float(m)
Default:1
Height of the cylindrical mid‑section (meters).
Height of the cylindrical mid‑section (meters).
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the hemispherical ends (meters).
Radius of the hemispherical ends (meters).
Sphere Geometry,Entity Component Sphere Geometry sphere_geometry
Sphere geometry.
Schemaoffset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the sphere (meters).
Radius of the sphere (meters).
Cylinder Geometry,Entity Component Cylinder Geometry cylinder_geometry
Cylinder geometry.
Schemaaxis
Integer
Default:1(Y-Axis)
Alignment axis of the cylinder: 0=X, 1=Y, 2=Z.
0X-Axis1Y-Axis2Z-Axis
Alignment axis of the cylinder: 0=X, 1=Y, 2=Z.
height
Float(m)
Default:1
Height of the cylinder (meters).
Height of the cylinder (meters).
offset
Vector3(m)
Default:[0,0,0]
Local offset of the geometry origin (meters).
Local offset of the geometry origin (meters).
radius
Float(m)
Default:0.5
Radius of the cylinder (meters).
Radius of the cylinder (meters).
Plane GeometryorEntity Component Plane Geometry plane_geometry
Infinite plane geometry.
Schemadistance
Float(m)
Default:0
Signed distance from the origin along the plane normal (meters).
Signed distance from the origin along the plane normal (meters).
normal
Vector3
Default:[0,1,0]
Unit normal vector of the plane (in local space).
Unit normal vector of the plane (in local space).
Collision Geometry ReferenceEntity Component Collision Geometry Reference collision_geometry_ref
Reference to a collision geometry asset used by physics.
SchemacollisionGeometryRef
Referenced collision geometry (UUID).
Referenced collision geometry (UUID).
- Rigid Body(with isKinematic = true)
Entity Component Rigid Body rigid_body
Rigid body parameters for dynamic simulation (mass, damping, limits, CCD, and kinematic/gravity behavior).
SchemaangularDamping
Float(s-1)
Default:0.05
Min:0
Angular damping coefficient (s^-1). 0 = no damping; must be non‑negative.
Angular damping coefficient (s^-1). 0 = no damping; must be non‑negative.
centerOfMass
Vector3(m)
Default:[0,0,0]
Center of mass relative to the entity's local transform (meters).
Center of mass relative to the entity's local transform (meters).
collisionDetection
Unsigned Byte
Default:0(Discrete)
Min:0
Collision detection mode (CCD). Kinematic bodies do not support Linear/Continuous CCD.
0Discrete1LinearContinuous2AngularContinuous3Continuous
Collision detection mode (CCD). Kinematic bodies do not support Linear/Continuous CCD.
isKinematic
Boolean
Default:false
Treat the rigid body as kinematic (unaffected by forces; driven by animation/app logic).
Treat the rigid body as kinematic (unaffected by forces; driven by animation/app logic).
linearDamping
Float(s-1)
Default:0
Min:0
Linear damping coefficient (s^-1). 0 = no damping; must be non‑negative.
Linear damping coefficient (s^-1). 0 = no damping; must be non‑negative.
lockedAxis
Unsigned Byte
Default:0
Min:0
Lock motion along/around the specified axes.
765432101Locks motion along the X axis.
765432102Locks motion along the Y axis.
765432104Locks motion along the Z axis.
765432108Locks motion around the X axis.
7654321016Locks motion around the Y axis.
7654321032Locks motion around the Z axis.
Lock motion along/around the specified axes.
mass
Float(kg)
Default:1
Mass (kg). A value of 0 is treated as infinite mass (static).
Mass (kg). A value of 0 is treated as infinite mass (static).
maxAngularVelocity
Float(rad/s)
Default:100
Min:0
Maximum angular velocity (rad/s). Must be non‑negative.
Maximum angular velocity (rad/s). Must be non‑negative.
maxLinearVelocity
Float(m/s)
Default:10000000000000000
Min:0
Maximum linear velocity (m/s). Must be non‑negative.
Maximum linear velocity (m/s). Must be non‑negative.
useGravity
Boolean
Default:true
Whether the rigid body is affected by gravity.
Whether the rigid body is affected by gravity.
Character Controller
See Character Controller.
Trigger
A trigger physics body is a physics body with isTrigger set to true in its
Physics Material physics_material
Physical surface properties used for contact: friction, restitution, optional contact modification, and trigger mode.
contactVelocity
Vector3(m/s)
Default:[0,0,0]
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
Applied contact velocity offset when colliding (m/s). Only used if modifyContact is true.
dynamicFriction
Float
Default:0.5
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
Dynamic (kinetic) friction coefficient (typically 0..1). If greater than staticFriction, staticFriction is clamped up to match. Effective value is averaged with the other surface.
isTrigger
Boolean
Default:false
Treat associated geometry as a trigger (generates events but no physical response).
Treat associated geometry as a trigger (generates events but no physical response).
modifyContact
Boolean
Default:false
Enable contact modification (applies contactVelocity on collisions).
Enable contact modification (applies contactVelocity on collisions).
restitution
Float
Default:0
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
Restitution (bounciness) in [0,1]. 0 = no bounce; 1 = perfectly elastic. Effective value is averaged with the other surface.
staticFriction
Float
Default:0.5
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
Static friction coefficient (typically 0..1). 0 feels like ice; higher resists start of motion. Effective value is averaged with the other surface.
Trigger bodies are used for triggering events, and whatever collision that may occur with them is detected, but not resolved by the physics engine. A trigger event allows a developer to react to two entities colliding and apply some logic to that. See Physics-Based Events for more info on trigger events.
Best Practices
The recommendations of “when to use” each physics body are best practices.
For example, a static body is recommended for a non-moving entity. Although you probably shouldn’t, don’t be surprised if you can actually move a static body during simulation by changing its transform. However, collision detection may not work as well and you may get unexpected results because of the way the physics engine is optimized.
So it’s important to configure your physics bodies correctly and follow the recommendations outlined in this doc.