Migrating to UNIGINE from Unreal Engine: Physics
The physics system in Unreal Engine is powered by the PhysX 3.3 physics engine, UNIGINE uses its own built-in Physics module.
In UNIGINE, physics simulation can be enabled both when you enter Play mode and right in the editor. Click the Physics toggle in the top toolbar (if the button is greyed out, toggle Animation on via the button next to it):
To disable simulation and reset the state of all physics-driven objects, uncheck the toggle and the world will return to its previously saved state.
Enabling Collisions#
In UE4, any PrimitiveComponent (ShapeComponent, StaticMeshComponent, SkeletalMeshComponent, etc.) can be a physical object. Unreal Engine combines the concepts of the potentially physical and the potentially visible into PrimitiveComponent.
In UNIGINE, the concepts for physics-driven object and visible geometry are separated. Some Object types are capable of being physics-driven (e.g. Static Mesh, Skinned Mesh, Water Mesh, etc.). In the Physics tab of the Parameters window you can assign a Physical Body to an object, which can be considered physical approximations of real-life objects. One of them is Rigid Body simulating the most commonly used rigid body dynamics.
Global Physics settings, such as the global gravity vector and quality, are available in the Settings window:
Collisions / Shapes#
Collision Shapes in UNIGINE play the part of Collisions in UE4, shapes are assigned to a physical body in the Shapes section. Here's the list of shape types compared to the UE4 Collisions:
Unreal Engine | UNIGINE |
---|---|
Box Simplified Collision | Box |
Sphere Simplified Collision | Sphere |
Capsule Simplified Collision | Capsule |
— | Cylinder |
Auto Convex Collision | Convex Hull |
You can combine several shapes to define a more complex collision shape in UNIGINE:
Static Collider#
UNIGINE features two types of collisions, you can apply any option to make an object to be static collider:
-
Shape - Shape collision: between two objects with physical properties assigned (i.e. between their shapes).
To create a static collider perform the following:
- Assign a Dummy Body to the node.
- Add collision shapes.
-
Shape - Surface collision: between an object with physical properties assigned and a non-physical object (i.e. between a shape and a mesh surface).
To make a mesh surface (e.g. of an ObjectMeshStatic) provide static collisions, just enable the Collision flag for it:
Thus, you can really quickly enable collisions with the scene geometry, however, this method may be more performance consuming than the other one, especially if the world contains a large number of polygons.
Dynamic (Rigidbody) Collider#
To create such a physics-driven collider object in UNIGINE, you assign a Rigid Body to it and create the required set of Shapes to define its collision geometry.
Kinematic Collider#
Kinematic Collider is the term for an object that is logic-driven but affects other physically based objects in the scene (for example, a character or a door).
In UNIGINE, you should use an object surface with the Collision flag enabled to provide Shape-Surface collisions. When being moved (e.g. from code), such an object acts as a kinematic collider and influences physics-driven objects.
Collision Channels#
In UE4, channel-based collision detection is defined by configuring the Collision Responses and Trace Responses settings:
In UNIGINE, selective collision detection is controlled by the Collision Mask of both shapes and surfaces depending on the type of collision detection used:
Shape Collision Mask |
Surface Collision Mask |
Two objects will collide only if their Collision Masks match (one bit at least).
For more details proceed to the dedicated article:
Constraints#
Unreal Engine Constraints are represented by Joints in UNIGINE. Joints are used to connect physically-driven objects and restrict their movement relative to each other. While in UE4 you configure constraints by pairing the Stable Mesh and the Constrained Mesh components, UNIGINE provides a set of joint types useful in different tasks:
Ragdoll#
In Unreal Engine, a Skeletal Mesh can be subject to physics-driven animation in order to simulate a ragdoll, for this purpose it requires a Physics Asset set up and applied to it.
In UNIGINE, Ragdoll is a special type of body used to simulate ragdoll dynamics. It operates on rigid bodies, shapes and joints to simulate limbs of an arbitrary skinned model. Ragdoll creation is available only for Skinned Meshes.
To switch between a bone-based animation and ragdoll simulation, use the Frame-based animation feature.
Physical Materials#
UE4 uses Physical Materials to specify a set of physical parameters, such as friction and bouncing effects of colliding objects.
In UNIGINE, the Friction and Restitution parameters are available for shapes and surfaces and taken into account depending on the type of collision detection used:
Shape Collision Mask |
Surface Collision Mask |
Vehicles#
In UE4, the Wheeled Vehicle Blueprint class covers the creation of vehicles.
In UNIGINE, wheeled vehicles can be created either manually by using the Wheel Joints or by using the High-Level Car Physics system based on C++ components.