3D Objects
- Last UpdatedAug 22, 2023
- 2 minute read
Objects in 3D scenes
You can associate three types of objects with objects inside a 3DScene.
-
Static objects. Never moves.
-
Dynamic objects. Moved by the PhysX simulation.
-
Kinematic objects. moved by the 3DScene.
Colliding
To collide within the PhysXScene, these objects need at least one collision 'shape' each.
3DSMax Parameters
You can assign PhysX parameters to a Mesh using 3DSMax. Place these parameters inside the mesh user buffer.
-
The $Shader and $PhysX blocks are separate. Do not nest them.
-
PhysX Meshes (at least Dynamic ones) must be exported in Object Space because they need the correct mesh's transform matrix.
Parameters
szActorType parameter
The actor type.
|
Valid values |
Description |
|---|---|
|
Static |
Never moves. |
|
Dynamic |
Moved by the PhysX simulation. |
|
Kinematic |
Moved by the 3DScene. |
szShape parameter
The collision shape type.
|
Valid values |
Description |
|---|---|
|
BoundingSphere |
The engine's bounding sphere of the object is used as the collision shape |
|
BoundingBox |
The engine's oriented bounding box of the object is used as the collision shape |
|
Plane |
A plane is generated using one of the mesh triangles. |
|
Geometry |
The collision shape is created using the mesh triangles. This collision shape is generated in runtime. To prevent slowdowns, limit the triangles that this collision shape contains. |
fDensity parameter
The density of the object. This value is used to calculate the mass of the PhysX Actor. Static Actors do not need a mass.
-
Range: [0..inf]
-
Default: 1
bDrain parameter
This Actor is used to drain PhysX particles.
-
Range: True, False.
-
Default: False.
bSleep parameter
This Actor starts in sleep mode. Valid only for Dynamic Actors.
-
Range: True, False.
-
Default: False.
Code example for generic dynamic object
This is a code example for creating a generic dynamic object.
$PhysX
{
szActorType = Dynamic
szShape = BoundingBox
}
Code example for dynamic object
This is a code example that creates a dynamic object that starts in sleep mode. The object does not move until some collision kicks in.
$PhysX
{
szActorType = Dynamic
szShape = BoundingBox
fDensity = 1.1
bSleep = true
}
Code example for static object
This is a code example that creates a static object whose collision shape is its bounding box and is used to drain particles.
$PhysX
{
szActorType = Static
szShape = BoundingBox
fDensity = 1.2
bDrain = true
}
Code example of Mesh user buffer
This is an example of a Mesh user buffer. Note: that the two structures are separate.
$Shader
{
szName = Vc
}
$PhysX
{
szActorType = Dynamic
szShape = BoundingBox
}