Common Physics Properties
Related Components
Object | Description |
---|---|
LModelComponent | Model component. Used to add a model to a game object. Everything from small items to large buildings can be added to the scene with the model component. |
LBoxComponent | Box component. Used to add a box collider to the game object. |
LSphereComponent | Sphere component. Used to add a sphere collider to the game object. |
LCapsuleComponent | Capsule component. Used to add a capsule collider to the game object. |
LSkeletalMeshComponent | Skeletal mesh component. Used to add a skeletal mesh model to a game object. Various characters and monsters can be added to the scene with the skeletal mesh component. |
The contents of Physics properties of each component may differ slightly, but the contents of Collision properties are basically the same.
Component Properties
Transform
Property | Description |
---|---|
Mobility | This property determines whether the component is movable and whether the physics object created by the component is static or dynamic.
|
Physics
Property | Description |
---|---|
Override Physics File | Whether to use custom physics resources. If Override Physics File = false, then the component will automatically find and load a physics resource file that matches the current model. If Override Physics File = true, then the component will load only the user-specified physics resource file. If the user-specified file is empty or does not exist at this time, the component will try to create a default collision. |
Rigid File | The user-specified physics resource file path. The name of this property changes according to the classification of the component type. E.g. The corresponding property name of the LModelComponent is Rigid File. The corresponding property name of the LSkeletalMeshComponent is Ragdoll File. The corresponding property name of the LDestructibleComponent is Destructible File Note: For LModelComponent, if the resource file set by the Rigid File property is empty or invalid, then the component will try to create the default collision. Components involved in physics simulation will create Convex collisions by default, others will create Mesh collisions by default. Note: Please try to create collision resources for model components by the Rigid Body Editor, as the default collision for components is generated in real time from the model vertex while the Editor is running. Meanwhile, try to use simple collision shapes (e.g. sphere/capsule/box) instead of Convex collisions or Mesh collisions (if possible) as simple collision shapes are more efficient. |
Simulate Physics | Whether the component participates in physics simulation. When Simulate Physics = true, the component will automatically start the physics simulation after the game is started. When Mobility is set to Static, the Simulate Physics property will be set to false automatically. When Simulate Physics property is set to true, Mobility is automatically set to Movable. |
Start Awake | Whether to wake up the component after the game is started. When the component is involved in the physics simulation, but you want the component to be static initially and the simulation is not activated until the component collides with other object. In this case, set the Start Awake property to false to get the above effect. |
Auto Weld | Whether to auto-weld to the parent component. If Auto Weld = true, the current component will automatically weld to its parent component and combine with the collision of the parent component to become a whole. |
Mass | Quality related property settings |
Material | Physics material related property settings |
Gravity | Gravity related property settings |
Mass
Property | Description |
---|---|
Mass Override | Whether to override the mass of the current component. When Mass Override = true, the mass of the component is the value of Mass In Kg property. When Mass Override = false, the mass of the component is the mass set in the physics resource file specified by the Rigid File property. If Rigid File is not specified or the corresponding physics resource file does not exist at this time, the mass of the component will be 1 by default. |
Mass In Kg | The specified mass value(Kg). |
Material
Property | Description |
---|---|
Material Override | The physics material file. The properties in the material file specified by Material Override are set to each collider contained in the component by default. |
Apply Material To Colliders | Specifying a material file to a specific collider of a component will override the properties in the material file specified by Material Override. When a model has different materials, a specific material can be set in Apply Material To Colliders. |
Gravity
Property | Description |
---|---|
Enable Gravity | Whether to enable gravity. This property will take effect when the component successfully loads physics and when Simulate Physics = true. |
Gravity Type | Different gravity effects can be obtained by selecting different gravity types, which can be extended by the program. The built-in gravity types are as follows:
|
Vector Gravity
Property | Description |
---|---|
Terrain Component | Any model component or terrain component in the scene. |
Gravity Axis Of Terrain | Based on the component specified by Terrain Component, select any axis direction of the component as the gravity direction. |
Gravity Acceleration | Gravity Acceleration. |
Sphere Gravity
Property | Description |
---|---|
Terrain Component | Any model component or terrain component in the scene. The position of the component is the center of the sphere. |
Gravity Acceleration | Gravity Acceleration. |
Voxel Cube Gravity
Property | Description |
---|---|
Voxel Terrain Component | Any voxel terrain component in the scene. |
Gravity Acceleration | Gravity Acceleration. |
Advanced
Property | Description |
---|---|
Start Active Dynamic | Whether to activate the component's physics simulation after the game is started This property will take effect when Simulate Physics = true. When Start Active Dynamic = false, the component will not automatically start physics simulation after the game is started, but will be created in the state of a kinematic Rigid Body. The kinematic Rigid Body needs to be set externally to change its position. |
Max Angular Velocity | Limit the maximum rotation angular velocity of the component when involved in the physics simulation. |
Linear Damping | Affect the linear velocity attenuation rate of the component when involved in the physics simulation. |
Angular Damping | Affect the angular velocity attenuation rate of the component when involved in the physics simulation. |
Sleep Threshold | Set the minimum energy threshold for a component to enter Sleep state when involved in the physics simulation. Components in Sleep state will not be involved in the simulation until they collide with other objects or are forced to wake up, then they will exit Sleep state and get involved in the physics simulation again. |
Wake Counter | Determine the minimum time for a component Rigid Body to enter Sleep state. The object will not enter sleep count until its kinetic energy is below Sleep Threshold. The object enters Sleep state after the sleep count ends. |
Stable Threshold | When the mass-normalized kinetic energy of the component Rigid Body is below this threshold, the object will tend to be stable. The stability here refers to that of the interaction among a large number of objects in the scene. |
Position Solver Iteration | Position iterations This property can be used to improve the quality of the constraint simulation. E.g. When a component is connected to a constraint component and instability such as jitter occurs during the simulation, the value of this property can be increased to make the simulation stable. Note: The larger the value of this property, the larger the performance consumption. |
Velocity Solver Iteration | Velocity iterations This property can be used to improve the accuracy of collision points in the physics simulation. When two objects colliding with each other are badly stuck, try increasing the value of this property to make the collision position of the two objects more accurate. Note: The larger the value of this property, the larger the performance consumption. |
Center Of Mass Offset | Used to offset the center of mass of a component Rigid Body from its original position. |
Inertia Tensor Scale | Used to scale the inertia tensor coefficient of the component Rigid Body based on its original inertia tensor. |
Dominance Group | Each component can be assigned to a Dominance Group with indexes from 1 to 10. And the higher the index, the higher the dominance level. The dominant component has infinite mass relative to the dominated component. E.g. If Object A Dominance Group = 1 and Object B Dominance Group = 2, then in the physics simulation, Object A is unable to collide with Object B. When Dominance Group = None, the component does not belong to any dominance group and has no dominance relationship with any dominance group with indexes from 1 to 10. This property is often used to solve the case in which some dynamic objects are easily bounced off after collided and squeezed by kinematic objects. |
Collision
Collision is the most commonly used physics property. And this set of properties are applied to both physics simulation and scene collision detection.
Property | Description |
---|---|
Collision Presets | Select a collision preset. A collision preset usually contains a Collision Channel type and a set of Collision Response parameters. Collision presets can be added/removed/edited etc. in the Collision Preset Editor. Collision Presets provided by the Engine:
|
Collision Enabled | Determine whether the component's collider will be involved in the physics simulation or scene collision query. Collision Types:
|
Channel Name | Determine the collision channel type of the component itself. Index the type of collision result in the Collision Responses property of the collided object. Add and edit the needed channel type in the Collision Preset Editor. The channel types defined by the Engine are as follows:
|
Collision Responses | The Responses represent a collision result. Generally it is used in combination with the Channel type to determine whether a certain object will generate collision for a certain Channel type. Optional Collision Response values:
|
Collision Determination Method
The above demonstrates the collision determination process of a flying bullet hitting the rock behind the player after penetrating the player and colliding with the camera.
- Step 1. The camera/player/rock component uses its own Channel property to compare with the corresponding Channel type in the Responses property of the bullet and get the collision response type.
- Step 2. The bullet component uses its own Channel property to compare with the corresponding Channel type in the Responses property of the camera/player/stone component respectively and get the collision type.
- Step 3. The two collision response types are combined to get the final collision result.
Step 1 | Bullet | Step 2 | Bullet | Step 3 | |
---|---|---|---|---|---|
A huge rock | Block | + | Block | = | Block |
Player | Overlap | + | Block | = | Overlap |
Camera | Ignore | + | Block | = | Ignore |
Summary |
---|
Block + Any = Any |
Ignore + Any = Ignore |
Overlap + Block/Overlap = Overlap |
Event Callback
Property | Description |
---|---|
Notify Contact Event | Physics simulates collision event callback.
|
Notify Overlap Event | Physics simulates penetration event callback.
|
Notify Sleep Event | Physics simulates sleep event callback.
|
Advanced
Property | Description |
---|---|
Use CCD | Continuous collision detection function. Effective only for components that are involved in physics simulation. It is recommended to be enabled only on components with excessive speed and penetrate other objects. Note: This property will cause a certain amount of performance consumption. |
Always Create Physics State | Always Create Component Physics State. When Always Create Physics State = true, the component will create physics collisions even if Collision Enable = No Collision. |
Generate Overlap Events | Whether to generate overlap events when the component moves. If Generate Overlap Events = true and the current component is the root component of Game Object, then the component will perform Sweep collision detection every time it moves, and make collision determination with other components which also have the Generate Overlap Events property enabled, and generate an Overlap event callback. Note: It can cause a significant performance consumption when many movable characters in the scene have this feature enabled. Thus when confirming whether there are objects within a certain range around the character, consider using the physics trigger. |
Can Character Step Up On |
|