Search public documentation:
- PhysX Reference
- Force fields
- Scene compartments
- Double buffering and parallelization of PhysX
- One way interaction ("Dominance Groups")
- PhysX visualization flags
- Platform analyzer
- Physics collision for rigid bodies
- bForceActive - Indicates whether the force is active at the moment.
- ForceFieldChannel - Identifies which force field exclude volumes (RB_ForceFieldExcludeVolumes) apply to this force field.
- bForceApplyToCloth - Enable/Disable influence on cloth.
- bForceApplyToFluid - Enable/Disable influence on fluid particles.
- bForceApplyToRigidBodies - Enable/Disable influence on rigid bodies.
- bForceApplyToProjectiles - Enable/Disable influence on projectiles like rockets.
- CollideWithChannelsIdentifies - Which types of objects are influence by this force field.
- ForceStrength - Strength of the force applied by this actor. Positive forces are applied outwards.
- ForceRadius - Radius of influence of the force.
SwirlStrength- This field is not used. (How strongly objects orbit around Z axis of actor.)
SpinTorque- This field is not used. (How strongly to spin objects around their local Z.)
- ForceFalloff - The way in which the force falls off as objects are further away from the location. Either the applied force is constant independent of the position, or the force gets linearly interpolated from ForceStrength at the center to zero at a radius of ForceRadius.
- RadialForceMode - Indicates which type of force mode is used.
- RadialStrength - Strength of the force applied outwards from the cylinder axis.
- RotationalStrength - Rotational strength of the force applied around the cylinder axis.
- LiftStrength - Strength of the force applied along the cylinder axis
- LiftFalloffHeight - Lift falloff height, 0-1, lift starts to fall off in a linear way above this height.
- EscapeVelocity - Velocity above which the radial force is ignored.
- ForceRadius - Radius of influence of the force at the bottom of the cylinder.
- ForceTopRadius - Radius of the force field at the top.
- ForceHeight - Height of force cylinder.
- HeightOffset - Offset from the actor base to the center of the force field.
Allows user to separate objects into compartments which may or may not interact with one another. Compartments allow the parallelization of scenes which can simulate while the game engine is performing other tasks. In addition compartments can be individually configured to run at different sub steps or possibly interleaved simulations in order to improve performance on effects based scenes. A compartment represents a sub-instance of one type of physics simulation, for example hardware fluid, hardware rigid body, or software rigid body. Several compartments may exist inside one scene, (including several of the same type) and interaction between them and the scene proper is taken care of automatically. This allows for transparent manipulation, simulation and interaction, without having to worry about the low-level nuts and bolts. The SDK manages all links between the compartments. For example, when a material is created, it will be created for all rigid body compartments, or if a ray cast is performed, the query will return all intersected hardware and software objects in all compartments. A newly created scene, hardware or software, contains no compartments. Any object that is added to the scene will be inserted into the scene proper, unless either a compartment is specified in its descriptor, or that type of object cannot exist directly in the scene. The latter applies to the example fluid in a software scene. In such a case, an appropriate default compartment will be created for the new object if none exists already. Here follows a comprehensive list of the different possibilities for creating objects with compartments, and what interactions they support. Interactions include both collisions between physical entities, and trigger testing.
|Item||Resides in||Affects||Affected by|
|Rigid bodies||Scene proper||Everything||Each other, cloth with two-way interaction set (even in compartments), fluid with two-way interaction set (only in compartments)|
|Fluids||Not available in software|
|Cloth||Master scene||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
|Item||Resides in||Affects||Affected by|
|Rigid bodies||Specified compartment||Each other only||Each other, rigid bodies in master scene|
|Fluids||Not available in software|
|Cloth||Specified compartment||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
|Item||Resides in||Runs on||Affects||Affected by|
|Rigid bodies||Scene proper||By scene type||Everything||Each other, cloth with two-way interaction set (even in compartments), fluid with two-way interaction set (only in compartments)|
|Fluids||Default fluid compartment (will create if nonexistent)||Hardware||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
|HW Cloth1||Default cloth compartment (will create if nonexistent)||Hardware||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
|SW Cloth1||Scene proper||Software||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
|Item||Resides in:||Runs on:||Affects:||Affected by:|
|Rigid bodies||Specified compartment||As the compartment||Each other only||Each other, rigid bodies in master scene2|
|Fluids||Specified compartment||Hardware||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
|Cloth||Specified compartment||As the compartment||Rigid bodies only in master scene, if two-way interaction is set||Rigid bodies only in master scene.|
- Rigid body
- Soft body
Note: This is not used at the moment, but it is here for future functionality.
With dominance groups one can have all constraints (contacts and joints) created between actors act in one direction only. This is useful if you want to make sure that the movement of the rider of a vehicle or the pony tail of a character doesn't influence the object it is attached to, while keeping the motion of both inherently physical. The dominance group is a property of the NxActor. It is simply a 5-bit (0-31 range) identifier. When a constraint (either joint or contact) acts between two actors, their dominance groups are used to determine which are influenced. The influence is determined by a user-defined matrix of pairs of reals. When two NxActors interact, their dominance group numbers are used to look up the correct real pair in the matrix. Each real may be in the range [0.0,1.0], and the value determines how much influence each NxActor receives from the interaction. Currently, only the values 0.0 and 1.0 are supported. The intermediate values may be used for "partial" interactions in the future. By default, the interaction matrix is set up so that if the actors' dominance groups are equal, (1.0,1.0) is returned. This is the "normal" interaction behavior - both actors are influenced by the constraint. If the actors' dominance groups are not equal, then the default matrix will return (0.0,1.0) or (1.0,0.0) depending on which group ID is greater. It is set up so that the lower dominance group ID gets the 1.0 weight, while the higher group ID gets the 0.0 weight. That is, lower group IDs win. PhysX sets the default dominance group ID to 0, which will always win (or tie) with the default interaction matrix. UE3 resets the NxActors' dominance group to 15 (by default), but does not modify the interaction matrix. This makes it easier to specify more- and less-dominant IDs. In UE3 the dominance group is specified by the RBDominanceGroup field in UPrimitiveComponent.
There are several PhysX visualization flags which can be set on the command line by typing NXVIS followed by one of the following flags:
- WORLDAXES - Visualize the world axes.
- BODYAXES - Visualize a body's axes.
- MASSAXES - Visualize a body's mass axes.
- CONTACTPOINT - Visualize contact points.
- CONTACTS - Visualize contact normals.
- CONTACTERROR - Visualize contact errors.
- CONTACTFORCE - Visualize contact forces.
- JOINTLIMITS - Visualize joint limits.
- JOINTLOCALAXES - Visualize local joint axes.
- JOINTWORLDAXES - Visualize joint world axes.
- CCD - Visualize CCD skeletons.
- CCDTESTS - Visualize CCD tests.
- COLLISIONAABBS - Visualize bounds (AABBs in world space).
- COLLISION - Visualize shape.
- Red - BSP/Trimesh/Heightfield
- Orange - Convex
- White - Sphere/Box Primitives
- COLLISIONAXES - Visualize shape axes.
- CLOTH_MESH - Visualize cloth meshes.
- CLOTH_COLLISIONS - Visualize cloth rigid body collision.
- CLOTH_ATTACHMENT - Visualize cloth attachments.
- CLOTH_SLEEP_VERTEX - Visualize cloth sleeping with full per-vertex information.
- CLOTH_SLEEP - Visualize cloth sleeping.
- Red - Sleeping
- White - Awake
- Blue - Static
- CLOTH_VALIDBOUNDS - Visualize cloth valid bounds.
- CLOTH_TEARABLE_VERTICES - Visualize tearable cloth vertices.
- FLUID_PACKETS - Visualize fluid packets.
- FLUID_POSITION - Visualize particle position.
- FLUID_MESH_PACKETS - Visualize available fluid mesh packets.
- FLUID_PACKET_DATA - Visualize fluid data packets.
- FLUID_BOUNDS - Visualize fluid AABB.
- FLUID_VELOCITY - Visualize particle velocity.
- FLUID_KERNEL_RADIUS - Visualize particle kernel radius.
- FLUID_DRAINS - Visualize fluid drain shapes.
- FLUID_EMITTERS - Visualize emitter.
- Force Fields
- FORCEFIELDS - Visualize forcefield shapes.
- SOFTBODY_MESH - Visualize soft body meshes.
- SOFTBODY_ATTACHMENT - Visualize soft body attachments.
- SOFTBODY_COLLISIONS - Visualize soft body collisions with rigid bodies.
- SOFTBODY_SLEEP_VERTEX - Visualize soft body sleeping with full per-vertex information.
- SOFTBODY_SLEEP - Visualize soft body sleeping.
- SOFTBODY_VALIDBOUNDS - Visualize soft body valid bounds.
The way that PhysX rigid-body physics engine works is to generate contact points each frame for where things are touching. This is a more complicated process than performing a line check, so it is important to keep the geometry that real physics objects (such as a rag dolls) collide with as simple as possible, both for speed and behavior. For example, a lot of small triangles can lead to physics objects getting snagged, and will take a long time to process. First, for an Actor to block physics Actors, it must have the bBlockRigidBody flag set to true. This is the default for static meshes and blocking volumes. If UseSimpleRigidBodyCollision is true (see Collision Models above for more details), the engine will take the collision model and turn it into a set of convex hull primitives for contact generation. If you choose Collision from the View menu in the Static Mesh Editor, it will give you an overall primitive count. You ideally want to keep that count below 10, certainly under 100. Rigid-body actors collide against BSP and terrain per-triangle. For this reason, you should make sure your BSP and terrain do not have very small triangles in them. For small details, use a blocking volume/collision model.
- RBChannel - This indicates what type of object this is considered for collision.
- RBCollidesWithChannel - This indicates the types of object that should generate a collision with this one.