Skip to main content

Rigidbody Editor

The Rigidbody hierarchy in this documentation is shown as follows:

133204933441411039

Overview

The Rigidbody Editor is used to produce models‘ Rigidbody resources whose physics effects can be edited and debugged.

image-20230818094713758

No.NameDescription
1Top ToolbarProvide features of deleting, saving, simulating Rigidbodies, importing physics collisions and resetting camera positions.
2Tree View PanelTo display Rigidbodies and Collider nodes contained in them, add and delete Colliders.
3Scene PanelTo display the models, observe the effect of Rigidbody simulation, and edit the Position, Rotation, Scale of the Colliders.
4RigidBody Detail PanelTo edit the properties of the Rigidbodies.

File Types Available for Rigidbody Editing

SuffixDescription
.xmodModel resource file.

Rigidbody File Types Saved by the Editor

The Editor will output Rigidbody resources in the following two formats after saving the Rigidbody editing.

SuffixDescription
.cobjRigidbody configuration file in INI format. Save the physics material file path, collision presets, etc. referenced by the Rigidbody.
.nxxRigidbody configuration file in XML format. Save all properties related to Rigidbody collision and simulation.

Shortcut Keys

Shortcut KeyDescription
1Drag to edit coordinate axis to modify the Position of the selected Collider.
2Drag to edit coordinate axis to modify the Rotation of the selected Collider.
3Drag to edit coordinate axis to modify the Scale of the selected Collider.
4Switch local/world space editing.
5Select the blank position of the Scene and drag to change the height of the model.
6Select the blank position of the Scene and drag to change the rotation of the model.
ShiftFiner adjustments can be made to the position change of the Collider by pressing Shift during dragging to edit the coordinate axis.
Ctrl + SSave the currently edited Rigidbody.
DeleteDelete the currently selected Collider.
FFire a dynamic Rigidbody sphere at the mouse pointer location.

Opening Rigidbody Editor

Method One

Find the model file or Rigidbody file in the Resource Preview window.

刚体编辑器

Double-click the model file 刚体编辑器 to open the Model Editor.

image-20230207162845223

Click the 刚体编辑器 button in the Model Editor to switch to Rigidbody editing.

image-20230208114648391

Rigidbody Editor:

image-20230818094821732

Method Two

Double-click any type of Rigidbody file (.cobj/.nxx/.nxb) in the Resource Preview window to open the Rigidbody Editor.

刚体编辑器

Creating Rigidbodies

Click the blank space in the Scene panel and find the Rebuild Rigid option in the RigidBody Detail panel.

image-20230818094923539

PropertyDescription
Rigid TypeType of the newly created Rigidbody.
  • Dynamic Rigid: Suitable for objects whose position is controlled by physics simulation such as balls, cans, etc.
  • Kinematic Rigid: Suitable for objects whose position is controlled by external settings such as elevators, moving platforms, etc.
  • Static Rigid: Suitable for objects whose position will not change such as walls, rocks, etc.
Collider TypeGeometry type of the newly created Rigidbody.
  • Capsule Geometry: Capsule geometry containing radius and half-height properties.
  • Sphere Geometry: Sphere geometry containing radius property.
  • Box Geometry: Box geometry containing length, width and height properties.
  • Convex Mesh Geometry: Convex polyhedron geometry that wraps the model.
  • Triangle Mesh Geometry: Triangle mesh that matches the model mesh. Note: Triangle meshes will not involve in the physics simulations when they are attached to dynamic Rigidbodies.
Mesh LODSelect the LOD of the vertex data referenced by the generated collider.
Create Collider Per Model NodeWhen enabled, a collider will be generated separately based on the mesh vertices of each model node in the model. Otherwise, a collider will be generated based on the overall mesh vertices.
TriggerCreate as trigger Rigidbody.
RebuildRebuild the Rigidbody.

Select the required Rigid Type and Collider Type under the Rebuild Rigid option, then click the Rebuild button.

image-20230818095038234

Sort the above collider types in descending order of performance or collision precision:

Sorted By
PerformanceSphere Geometry > Capsule Geometry > Box Geometry > Convex Mesh Geometry > Triangle Mesh Geometry
Collision PrecisionTriangle Mesh Geometry > Convex Mesh Geometry > Sphere Geometry = Capsule Geometry = Box Geometry

Two tree nodes of different colors will be displayed in the Tree View panel on the left after creation.

刚体编辑器

NodeDescription
Blue box Rigidbody node.
Yellow box Collider node.

Adding Colliders

Multiple different Colliders can be added to a Rigidbody.

Select the Rigidbody node in the Tree View panel. Right-click the node and select Add Collider.

image-20230209174312961

Click OK to complete after setting the parameters in the pop-up window. The Create From Model Nodes list displays the Model nodes of the current model. Each Model node contains a set of model vertex data, and you can select any of them to create Rigidbody Colliders.

image-20230818095311283

The newly attached Collider can be viewed in the Tree View panel and Scene panel after adding.

image-20230818095415430

Deleting Colliders

Delete unwanted Colliders in Rigidbodies.

Method One

Select the Collider node to be deleted in the Tree View panel. Right-click it and select Delete Collider. Then click the OK button in the pop-up window to delete the selected Collider.

image-20230209174838008

Method Two

Select the Collider to be deleted in the Scene panel, press the shortcut key Delete, and then click the OK button in the pop-up window to delete the selected Collider.

delete

Editing Colliders

Edit the Collider to adjust its position, rotation and scaling, as well as the position and rotation of the model.

Switching Editing Modes of Coordinates

Select the Collider in the Scene panel to display the editing coordinates.

刚体编辑器

Click the buttons in the Scene panel to switch the editing mode of the coordinates.

image-20230208095137432

Or press the corresponding Shortcut Keys (1/2/3/4) to switch the editing mode of the coordinate.

Shortcut KeyDescription
1Drag the coordinate to change the position of the Collider.
2Drag the coordinate to change the rotation of the Collider.
3Drag the coordinate to change the scaling of the Collider.
4Switch between the local and world spatial coordinate systems.
ShiftHold down the Shift key and drag to modify the position/rotation/scaling of the Collider more precisely.

Adjusting the Position and Rotation of Models

When the cursor is placed at a blank space of the Scene panel, in panning mode, click and drag the mouse up or down to move the model up or down ; And in rotation mode, click and drag the mouse left or right to rotate the model left or right.

Click the buttons in the Scene panel to switch the editing mode of the model.

image-20230208100039590

Or press the corresponding Shortcut Keys (5/6) to switch between the translation or rotation mode of the model.

Shortcut KeyDescription
5Translate the model up or down.
6Rotate the model left or right.

modeledit

Editing Properties of Rigidbodies

By editing different properties of the Rigidbody, you can get different physics effects in the physics simulation.

In the Tree View panel, select the Rigidbody to be edited. The RigidBody Detail panel on the right shows settings for the properties of the Rigidbody.

image-20230818095602179

Edit Settings

image-20230818095632983

PropertyDescription
Show ModelUsed to hide the model to observe the Rigidbody collision.
Show SimulateUsed to switch on/off information on the geometry involved in the physics simulation.
Show Scene QueryUsed to switch on/off information on the geometry involved in the scene collision query.
Show Invalid ColliderUsed to switch on/off the display of information of the geometry that does not participate in the simulation or the collision detection.
Play Model AnimUsed to play/stop the model animation.

Rigidbody Common Properties

image-20230818095715300

PropertyDescription
Rigid TypeThe type of the Rigidbody.
NameThe name of the Rigidbody.
Enable SimulateSpecify whether the Rigidbody will participate in the physics simulation or not.
If Enable Simulate is false, then the Rigidbody will not participate in the physics simulation. This means there will be no collisions with other objects involved in the simulation, and the position of the model will not be controlled by physics.
This setting does not affect the Rigidbody being detected by the scene collision query.
Enable Control ConstraintCreate a joint to constrain the motion of the Rigidbody (only available in ragdoll editing) .

Rigidbody Properties

刚体编辑器

PropertyDescription
MassMass of the Rigidbody in Kg. When the value is set too small or 0, the simulation will experience jitter or penetration.
No GravityWhen No Gravity is true, the Rigidbody will no longer be affected by the gravity of the scene.
CCDContinuous collision detection. When the Rigidbody is moving too fast, causing something like a tunnel effect and penetrating other Rigidbodies, you need to enable this option.
Minimum Position IterationsThis property defines the resolution accuracy when the Rigidbody is controlled by constraints.
If the Rigidbody is controlled by constraints and jitter and other abnormal performance occurs, the number of position iterations can be increased appropriately to make the Rigidbody more stable.
Minimum Velocity IterationsThis property defines the resolution accuracy of the Rigidbody when in a collision.
If the bounce of the two colliding objects is too violent, the number of velocity iterations can be increased appropriately. This will make the separation velocity of the two objects approach the result defined by the material elastic coefficient.
Center Of Mass X/Y/Z (Read Only)This is a read-only property that shows the position of the Rigidbody's mass center in local space.
Center Of Mass Offset X/Y/ZUsed to offset the coordinates of the Rigidbody's mass center.
Inertia Tensor Scale X/Y/ZThe original inertia coefficient of the Rigidbody is related to the mass and the position of the Rigidbody's mass center. This coefficient is scaled from the original inertia coefficient of the Rigidbody.
The larger the inertia, the less likely the state of motion will change.
Dominance GroupCurrently, dominance groups from 0 to 10 are defined. Dominance relationships exist between dominance groups from 1 to 10, and the larger the number, the higher the dominance level. Group 0 has the same dominance level as all other groups.
Rigidbodies with higher dominance levels have infinitely large mass relative to those with lower levels.

Dynamic Properties

133368003151042828

PropertyDescription
KinematicIf Kinematic is true, the current Rigidbody type will switch to kinematic Rigidbody.
If Kinematic is false, the current Rigidbody type will switch to dynamic Rigidbody.
Weld ToWeld one ragdoll's bone to another bone. Used to replace the feature of fixing joints (This property is used for ragdoll editing).
Max Angular SpeedThe maximum angle speed of the Rigidbody will not be larger than this value.
Linear DampingAffect the attenuation rate of the the Rigidbody's linear velocity. The larger the linear damping, the faster the Rigidbody will stop its linear motion.
Angular DampingAffect the attenuation rate of the the Rigidbody's angular velocity. The larger the angular damping, the faster the Rigidbody will stop rotating.
Sleep ThresholdThis is a Rigidbody kinetic energy threshold. When the Rigidbody kinetic energy is below this value, the Rigidbody starts the sleep timer and enters sleep state at the end of the timer.
Stable ThresholdWhen the mass-normalized kinetic energy of the Rigidbody is below this threshold, the object will tend to stabilize. The stability here refers to the stability of the interactions among a large number of objects in the scene.

Editing Collider Properties

In the Scene panel or Tree View panel, select the Collider you want to edit. The corresponding property settings will be displayed in the RigidBody Detail panel on the right.

image-20230228111719114

PropertyDescription
Collider NameName of Collider.
Collider IndexIndex of Collider.
Trigger (Disable Simulate)When the Trigger (Disable Simulate) is true, the Collider is converted to a trigger Collider, a trigger event will be generated when there are other Colliders inside the trigger Collider.
Simulate (Disable Trigger)Collider participates in physical simulation.
Scene QueryCollider participates in scene collision query.
Double-sidedEffective only when the Collider type is Triangle Mesh Geometry .
The double-sided mesh can detect the surface normal of the back triangle when performing scene collision queries inside the mesh.
Contact OffsetWhen the distance between two Colliders is less than the Contact Offset, two objects will collide.
Contact Offset must be greater than Rest Offset.
Rest OffsetThe rest distance of two Colliders is equal to the sum of their Rest Offset.
When Rest Offset equals to 0, two objects will just stick together.
When Rest Offset is greater than 0, two objects can slide more smoothly into each other, because this minimizes the effect of irregular surfaces during sliding.

Geometries

This setting is displayed only if the Geometry Type is Capsule Geometry, Sphere Geometry, or Box Geometry, and the Geometry display different properties depending on the Geometry Type.

Capsule Geometries

image-20230228111929730

PropertyDescription
Capsule RadiusRadius of capsule.
Capsule Half HeightHalf height of capsule.

Sphere Geometries

image-20230228111942128

PropertyDescription
Sphere RadiusRadius of sphere.

Box Geometries

image-20230228111955843

PropertyDescription
Box Length (X)Length of box.
Box Width (Y)Width of box.
Box Height (Z)Height of box.

Locations

image-20230210172439445

PropertyDescription
Local PositionThe Position of the Collider in the local space of the Rigidbody.
Local AngleThe Angle of the Collider in the local space of the Rigidbody.

Materials

image-20230208105245168

PropertyDescription
Material FilePhysical material file path.
The Collider will apply the material properties specified in the physical material file.
If no physical material file is specified, the Collider will apply the following material properties.
Dynamic FrictionCoefficient of dynamic friction.
Static FrictionCoefficient of static friction.
Friction Combine ModeFriction Combination mode.
RestitutionCoefficient of elasticity.
Restitution Combine ModeElastic coefficient combination mode.

Friction/Restitution Combine Mode

After two objects of different materials collide, the blending mode of the larger object number becomes the effective combine mode between the two objects.

finalCombineMode = maximum(material0.combineMode, material1.combineMode)

Serial NumberNameDescription
1Average(a + b) / 2
2Min Valueminimum(a,b)
3Multiplya * b
4Max Valuemaximum(a,b)

Event Callbacks

image-20230208110115573

PropertyDescription
Notify Contact EventWhether a contact event is triggered when a Rigidbody collides with other object.
Notify Overlap EventWhether an overlap event is triggered when a Rigidbody overlaps another object.
The collision results between the two objects must both be overlap for the overlap event to be successfully triggered.
Notify Sleep EventWhether a sleep event is triggered when the Rigidbody falls into sleep or is awakened.

Collision Filters

image-20230208110309836

PropertyDescription
Collision PresetCollision preset name.
Collision ChannelChannel of collision.
Collision ResponseCollision response to other collision channel types.

Saving/Deleting/Simulating Rigidbodies

The Top Toolbar provides corresponding button features.

刚体编辑器

Button NameDescription
DeleteEmpty the edited Rigidbody and delete the resource files.
Save AsSave the currently edited Rigidbody as.
SaveSave the currently edited Rigidbody.
SimulateSimulate the currently edited Rigidbody.

Convex Decomposition

Click the blank space in the Scene panel to see the related properties of Convex Decomposition in the RigidBody Detail panel. Too many convexes and too high decomposition precision will strongly affect the speed of collision generation.

image-20230815174709145

PropertyDescription
Max HullsThe maximum number of convex hulls that can be generated for each mesh in the model.
Max Hull VertsThe maximum number of vertices that can be generated for each decomposed convex hull.
Hull PrecisionThe precision of the generated convex vertices. The larger the value, the more precise the generated convex.
RebuildGenerate a collision based on the current settings.
DefaultRestore default settings.