Search public documentation:
UE3 Home > Unreal Editor and Tools > Physics Asset Tool User Guide
UE3 Home > Physics > Physics Asset Tool User Guide
UE3 Home > Physics > Physics Asset Tool User Guide
- Physics Asset Tool User Guide
- Opening PhAT
- PhAT Interface
- Creating a Physics Asset
- Modifying a physics asset
- Collision primitives / bodies
- Previewing Animations
The Unreal Physics Editor - PhAT (Physics Asset Tool) - is an integrated tool in the Unreal Editor designed specifically to manipulate physical setups for skeletal objects.
The PhAT Physics Editor can be opened by double-clicking any physics asset or through the right-click context menu of a physics asset in the Content Browser. Either of these will open up that particular physics asset in the PhAT Physics Editor for editing. NOTE: While it is possible (and sometimes desired) to have more than one PhAT window open at a time, it is recommended that you not have more than one actively simulating at the same time, as performance will be degraded.
The PhAT Physics Editor is divided into the following regions:
- Undo - Undo last completed action.
- Redo - Redo last undone action.
- Change Default Skeletal Mesh - Sets the currently selected skeletal mesh asset in the Content Browser as the default skeletal mesh for the physics asset.
- Reset Entire Asset - Opens initial body creation dialog and replaces entire physics asset using the new settings.
- Reset Selected Bone Collision - Clears any collision modifications made to the selected bodies. of the skeletal mesh.
- Apply Selected Physical Material to All Bodies - Assigns the currently selected Physical Material in the Content Browser to all of the bodies in the physics asset. Disabled if no Physical Material is selected.
- Copy Joint Settings to All Joints - Copies the properties of the currently selected constraint to all of the constraints in the physics asset. Has no effect if no constraint is selected.
- Properties - Toggles display of the Properties Pane.
- Tree - Toggles display of the Tree Pane.
|Toggles between editing physical bodies or constraints.|
|Toggles between working in World space and Local space coordinates for transform tools.|
|Sets the translation widget active.|
|Sets the rotation widget active.|
|Sets the scale widget active.|
|Toggles snapping for transform tools. Translation moves in 0.25 increments without snapping; 2.0 increments with snapping. Rotation rotates in 1.0 increments without snapping; 15.0 increments with snapping.|
|Copies properties of currently selected body/constraint to the next selected body/constraint.|
|Toggles between displaying body properties or instance properties in the Properties Pane when in Body editing mode.|
|Toggles preview of the physics simulation for the physics asset in the Preview Pane.|
|Cycles the mesh rendering mode between lit rendered mesh, wireframe, and hidden.|
|Cycles the collision rendering mode between geometry, wireframe, and hidden.|
|Cycles the constraint rendering mode between position, limits, and hidden.|
|Toggles display of fixed bodies in red.|
|Toggles display of the floor grid mesh in the Preview Pane.|
|Toggles display of the default skeletal mesh's skeleton and bone names in the Preview Pane.|
|Toggles display of the vertices weighted to the currently selected bone/body in the Tree Pane|
|Toggles display of mass properties for the bodies of the physics asset when the simulation preview is enabled.|
|Disables collision between the currently selected body in the Tree Pane and the next selected body.|
|Enables collision between the currently selected body in the Tree Pane and the next selected body.|
|Welds the currently selected body in the Tree Pane to the next selected body.|
|Adds a new body to the next selected bone on the Tree Pane. Requires double-click. Creates a box by default.|
|Adds a new sphere body to the currently selected bone in the Tree Pane.|
|Adds a new sphyl body to the currently selected bone in the Tree Pane.|
|Adds a new box body to the currently selected bone in the Tree Pane.|
|Delets the currently selected body in the Tree Pane.|
|Creates a duplicate of the currently selected body in the Tree Pane.|
|Converts the currently selected constraint in the Tree Pane to a ball and socket joint.|
|Converts the currently selected constraint in the Tree Pane to a hinge joint.|
|Converts the currently selected constraint in the Tree Pane to a prismatic joint.|
|Converts the currently selected constraint in the Tree Pane to a skeletal joint.|
|Deletes the currently selected constraint in the Tree Pane.|
|Allows you to select and play an animation from the Preview Anim Set on the skeletal mesh when the simulation preview is enabled.|
|Toggles display of the skeletal mesh's skeleton as driven by the preview animation when the simulation preview is enabled|
- Preview Anim Set - Sets the AnimSet used for previewing animations in the Preview Pane during simulation preview.
- Physics Blend - Sets the blending between physics driving the skeleton and the preview animation dirving the skeleton.
- Blend On Poke - If true, the preview mesh will be driven by the preview animation until poked (Ctrl + LMB) in the Preview Pane. It then snaps to the physics simulation, pauses for Poke Pause Time, and blends back to the animation over Poke Blend Time.
- Poke Pause Time - Sets the amount of time to show the physics simulation when Blend On Poke is true.
- Poke Blend Time - Sets the amount of time it takes to blend back to the animation when Blend On Poke is true.
- Angular Spring Scale - Sets an overall spring scale multiplier applied to all motors.
- Angular Damping Scale - Sets an overall damping scale multiplier applied to all motors.
- Draw Contacts -
- Sim Speed - Sets the playback speed of the preview (physics simulation or preview animation).
- Floor Gap - Sets the distance above the floor the skeletal mesh is position when at rest.
- Grav Scale - Sets a multiplier for the gravity of the simulation preview.
- Prompt On Bone Delete -
- Show Constraints As Points - If true, constraints will be displayed as points in the Preview Pane. Otherwise, they are displayed as crosses.
- Show Names In Hierarchy - If true, the names of the bones will be displayed in the Preview Pane when the skeletal mesh's skeleton is being displayed.
- Handle Linear Damping - Sets the linear damping of the spring used when grabbing (Ctrl + RMB + Drag) the physics asset during the simulation preview.
- Handle Linear Stiffness - Sets the linear stiffness of the spring used when grabbing (Ctrl + RMB + Drag) the physics asset during the simulation preview.
- Handle Angular Damping - Sets the angular damping of the spring used when grabbing (Ctrl + RMB + Drag) the physics asset during the simulation preview.
- Handle Angular Stiffness - Sets the angular stiffness of the spring used when grabbing (Ctrl + RMB + Drag) the physics asset during the simulation preview.
- Poke Strength - Sets the strength of the impulse applied when poking (Ctrl + LMB) the physics asset in during the simulation preview.
- Sky Brightness - Sets the brightness of the ambient light in the Preview Pane.
- Brightness - Sets the brightness of the directional light in the Preview Pane.
- Angular Snap - Sets the snapping increment for rotations in the Preview Pane when snapping is enabled.
- Linear Snap - Sets the snapping increment for translations in the Preview Pane when snapping is enabled.
- Constraint Draw Size - Sets the size at which constraints are drawn in the Preview Pane.
|LMB||Select limb/joint or widget axis|
|SHIFT + LMB||will do a non-uniform transform if possible (scaling along one axis)|
|CTRL + LMB||Poke the physics asset (only in a live simulation)|
|CTRL + RMB + Drag||Grab onto the physics asset (only in a live simulation)|
|L + DRAG||Orbit directional light|
|Spacebar||Cycle Widget Mode|
|B||Switch between Body and Constraint mode|
|A||Turn on Snap|
|C||Copy properties from/to|
|H||Cycle render mode for asset|
|J||Cycle render mode for bodies|
|K||Cycle render mode for constraints|
|D||Weld bodies together (must be parent-child pair)|
|Q||Cycle constraint X -> Y -> Z|
|HOME||Center view on selected Body or Constraint|
|[||Enable collision between selected body and another|
|]||Disable collision with the selected body and another|
To create a physics asset, navigate to the Content Browser and find the skeletal mesh asset you wish to have a physical setup for. Right click on it and select Create Physics Asset from the context menu. This will open a dialog that provides you with options for the creation of a physics asset based on the skeletal structure and vertex weighting for that mesh. This dialog can be reached again while inside of PhAT by using the Reset Entire Asset option in the Tools menu.
Once PhAT is open, you will see your asset floating in space over a default floor. The object should also be enveloped in several boxes or sphere/sphyls depending on the options chosen in the collision primitives section of the Create physics asset dialog. Most likely, these collision primitives are not optimally placed and may be inter-penetrating in an undesired manner. If this is the case, PhAT has several tools for manipulating these primitives. For these examples, we will use Phys_Capsule3_Physics, which is in PhysicsObjects.upk, which should be in the Packages folder.
There are three different collision primitives that can be created and modified inside of PhAT. These three are boxes (that can be uniformly and non-uniformly scaled), capsules (can be scaled uniformly or along their length or width), and spheres (that can only be scaled uniformly). Modifying collision primitives for physical assets is easily accomplished using PhAT. Open Phys_Capsule3_Physics in PhAT, and notice that there are wireframe spheres and capsules surrounding the object. These wireframe objects are the collision primitives for the bones in this object. To see how these are used, press the Simulate button and watch the behavior of the object. When you are ready, press Simulate again to stop it. Select one of the collision primitives by left clicking on it, and it should highlight orange, while primitives immediately adjacent to it turn white. This signifies that collision has been disabled between these collision bodies, as the constraint is handling the interaction between them. Press the X key to lock the selection so we don't accidentally unselect the primitive or select another one. The word LOCK will appear in the lower left corner of the window. There is an axis gizmo at the center of this primitive, which can be used to move, rotate, and scale the collision bodies. Make sure you are in move mode by either pressing the W key or clicking on the Move mode button. Now left click and drag on the blue gizmo line (Z axis) and the body should move along that axis. As previously mentioned, the same controls can be used to rotate and scale bodies. To rotate a body, either press E to enter rotation mode, or click on the Rotate button in the toolbar. The translation gizmo should turn into a rotation gizmo with 3 wire rings representing each axis. If you have trouble seeing the gizmo, you can Cycle Mesh Rendering Mode (or press H) to wireframe or invisible mode. Each of these rings is used to rotate along that axis the same manner in which movement was done, by left clicking and dragging. This isn't very obvious when rotating a spherical body, but should be very obvious when done to a box or capsule body. Scaling is done the same way as translation; however it supports non-uniform scaling as well. Switch to Scale mode by pressing R or clicking on the Scale button. The gizmo should appear the same as it did with Move, however left click will scale the entire body up or down depending on which direction you drag. Shift-Left click however will only scale along the axis you click on. It is important to note that attempting to non-uniformly scale a sphere body will cause the sphere to scale uniformly. Adding and removing bodies is also easy to do. Selecting a body and then clicking on any of the Add Primitive buttons will drop that primitive at the bone's origin. Once that is done, the body can be moved, rotated, and scaled to the desired position. There is no limit to the number of collision bodies per bone, but performance will become an issue with a large number of bones and bodies in a single physical asset.
- Sleep Family - Sets the method used to determine when to put the body to sleep.
- Bone Name - Displays the name of the bone with which the body is associated.
- Fixed - If true, the body will have no physics applied to it. it will be fixed relative to the world.
- No Collision - If true, the body will not collide with anything.
- Block Zero Extent - If true, the body will block zero extent checks, such as instant hit weapon traces.
- Block Non Zero Extent - If true, the body will block non-zero extent checks, such as player collisions.
- Enable Continuous Collision Detection - If true, the continuous collision detection system is used. This can be useful to keep bodies moving at high speeds from passing through geometry, but comes at the expense of slower calculations.
- Always Full Anim Weight - If true, the body will always have physics applied to it regardless of the Physics Weight value. This is useful for bodies that should always be driven by physics such as cloth or pony tails.
- Consider For Bounds - If true, this body will factor into the bounds determination. The fewer bodies that are used in determining the bounds, the faster the calculation will be each frame.
- Phys Material - Sets the Physical Material used by this body. See the Physical Material page for more information.
- Mass Scale - Sets a multiplier for the mass of the body. This value is multiplied by the default mass which is based on the volume of the body.
- Pre Cached Phys Scale - Sets a list of scales at which to pre-cache physics for this body.
- COMNudge - An offset applied on top of the body's PhysX-calculated Center of Mass.
- Agg Geom
- No RBCollision - If true, this shape is completely ignored for physics. It will not only have no collision, but will also not contribute to the mass/inertia tensor of the body. Setting this on all shapes within a body is invalid.
- Per Poly Shape - If true, this shape will be considered by Unreal line traces even if this bone is defined as using per-poly collision with the PerPolyCollisionBones option.
- Enable Bone Spring Linear - If true, a linear 'spring' between the physics body for this bone and the world-space location of the animation bone is enabled.
- Enable Bone Spring Angular - If true, a angular 'spring' between the physics body for this bone and the world-space location of the animation bone is enabled.
- Disable On Overextension - If true, the bone spring will automatically disable if it ever gets longer than the Overextension Threshold.
- Notify Owner On Overextension - If true, a notification is sent to the Owning Actor when overextended is sent by calling Actor::OnRigidBody.
- Teleport On Overextension - If true, this will teleport the whole Physics Asset Instance if this spring gets too long to reduce the error to zero. Note: Having this enabled on more than one body in a single physics asset will have unpredictable results.
- Use Kin Actor For Bone Spring - If true, when using bone springs, connect them to a kinematic body and animate that rather than animating the attachment location on the 'world'. This adds some overhead, but tracks rapidly moving targets better.
- Make Spring To Base Collision Component - If true, when using bone springs, connect them to the physics body of the Base's Collision Component. When using this option, SetBoneSpringTarget must be given a matrix for this bone relative to the other bone, rather than relative to the world.
- Bone Linear Spring - Sets the strength of the linear spring to the animated bone.
- Bone Linear Damping - Sets the damping of the linear spring to the animated bone.
- Bone Angular Spring - Sets the strength of the angular spring to the animated bone.
- Bone Angular Damping - Sets the damping of the linear spring to the animated bone.
- Overextension Threshold - If Disable On Overextension is true, the bone spring will be disabled if it stretches more than this amount.
- Only Collide With Pawns - If true, this body should only collide with other bodies with their components marked by bConsiderPawnForRBCollision. This is useful for flappy bits which should not collide with the world.
- Enable Collision Response - If true, this enables a physics response for this body. If false, contacts are still generated and reported. This is useful for sensor bodies.
- Push Body - If true, this body will be denoted as a "push" body. This also disables collision response.
- Phys Material Override - Sets the physical material to use for this body, overriding that of the actor using the physics asset or the material assigned to it.
- Contact Report Force Threshold - Sets the threshold used by the force-based collision reporting system. if the value is negative, the system will be disabled for this body.
- Instance Mass Scale - Per-instance multiplier to scale the mass.
- Instance Damping Scale - Per-instance scaling of linear/angular damping for this body.
- Custom Gravity Factor - A multiplier for the custom gravity applied to the body, allowing bodies to individually control how custom gravity settings affect them.
Toggling the Body mode button will switch to Constraint mode, and the rendering of the physical asset will change to show purple wire frame crosses at the bone locations. The constraints are the representations of how the bones are going to be held together when the simulation is run. Select a constraint the same way a body is selected, and you'll see the limits of that constraint. By default, a constraint is unlimited, and is represented as just the normal gizmo, but once limits are set, this will change to reflect the values entered by the user. For twist limits, a line is created along the axis of twist, with an X at the end if there is no value set for the limit, but if a limit is set the representation is a green arc at the end of the line with another yellow line bisecting the arc. This yellow line shows the current position of the bone within the twist limits. For swing limits, the representation without a value set in either Swing1LimitAngle or Swing2LimitAngle is a green line extending equally in both directions along the axis of the constraint. Pressing Q with a constraint selected will cycle to the next axis if that needs to be changed. If a value is entered into one of the SwingLimits, the green line will change to a green cone, and the yellow line inside of it shows the current position of the bone again. If both swing and twist limits are entered, the twist limits will appear at the end of the yellow line inside the green cone. With the constraint selected, change the values so you can see the limits change. Once you've done that, simulate the asset to see the results of your tweaks. You can turn on rendering the constraint (either the one selected or all of them) by cycling through modes in the Cycle Constraint Rendering Mode button or pressing K. With this enabled, you'll be able to see the yellow line move around within the constraint and stop when it reaches the limits. Constraints can be rotated and moves in the same way that bodies can, however, the difference here is that holding down shift to move a constraint will separate the starting location from the constraint location (causing the constraint to snap back together when the simulation starts), and rotating the constraint will rotate the limits but not the current rotation of the joint, which is useful for setting up non-symmetrical joints such as elbows. It is important to note that if you rotate a constraint so that the limits are beyond the current position of the joint, when the asset is simulated all of the joints will move to satisfy the limits in the first frame, thus causing motion immediately upon simulating the asset.
- Joine Name - The name of the joint. This will be the same as the Constraint Bone 1 in a physics asset.
- Constraint Bone 1 - The name of the first bone that the joint should connect.
- Constraint Bone 2 - The name of the second bone that the joint should connect.
- Enable Projection - If true, when distance error between bodies exceeds 0.1 units or rotation error exceeds 10 degrees, the body will be projected to fix this.
- Linear Limit Soft - By default the linear limits are `hard'. If you set this to true they are treated as springy instead and you can `push' into them.
- Linear Breakable - If true, this joint can be broken by applying a linear force to it (basically pulling the joint apart).
- Linear X/Y/ZSetup
- bLimited - If true, there is a limit on this degree of freedom. If false, linear movement is not limited at all.
- Limit Size - If bLimited is true, how much movement is allowed in this direction. Set this to zero to completely 'lock' this degree of freedom.
- Linear Limit Stiffness - If Linear Limit Soft is true, this controls the stiffness of the limit spring.
- Linear Limit Damping - If Linear Limit Soft is true, this controls the damping of the limit spring.
- Linear Break Threshold - If Linear Breakable is true, this is the force that is needed to break the joint.
- Swing Limited - If true, the angle between the two bodies is limited to a cone.
- Twist Limited - If true, the twist between the two bodies is limited.
- Swing Limit Soft - By default the swing cone limit is `hard'. If this is set to true it is springy instead and can be pushed into.
- Twist Limit Soft - By default the twist limit is `hard'. If this is set to true it is springy instead and can be pushed into.
- Angular Breakable - If true, this joint can be broken by applying a torque to it (basically twisting the joint apart).
- Swing 1LImit Angle - Defines one dimension of the swing limit cone in degrees.
- Swing 2Limit Angle - Defines the other dimension of the swing limit cone in degrees.
- Twist Limit Angle - Defines the amount of twist that is allowed between the two constrained bodies.
- Swing Limit Stiffness - If Swing Limit Soft is true, this controls the stiffness of the cone.
- Swing Limit Damping - If Swing Limit Soft is true, this controls the damping of the cone.
- Twist Limit Stiffness - If Twist Limit Soft is true, this controls the stiffness of the twist limit.
- Twist Limit Damping - If Twist Limit Soft is true, this controls the damping of the twist limit
- Angular Break Threshold - If Angular Breakable is true, this is the torque required to break this joint.
- Is Pulley - If true, this joint will be treated as a pulley type
- Maintain Min Distance - If true, no `slack' is allowed in the `ropes' and they are treated a bit like rods instead, so you can push up on one object and the other will be pushed down.
- Pulley Ratio - The gear ratio on the pulley. If its not 1.0, pulling on one side will result in less movement on the other, but with more force.
- Linear XPosition Drive - Enable position drive on the linear X axis.
- Linear XVelocity Drive - Enable velocity drive on the linear X axis.
- Linear YPosition Drive - Enable position drive on the linear Y axis.
- Linear YVelocity Drive - Enable velocity drive on the linear Y axis.
- Linear ZPosition Drive - Enable position drive on the linear Z axis.
- Linear ZVelocity Drive - Enable velocity drive on the linear Z axis.
- Linear Position Target - If linear position drive is enabled, this is the target relative position that the joint will try to achieve.
- Linear Velocity Target - If linear velocity drive is enabled, this is the target relative linear velocity that the joint will try to achieve.
- Linear Drive Spring - If linear position drive is enabled, this is the stiffness of the drive spring.
- Linear Drive Damping - If linear position drive is enabled, this is the damping of the drive spring.
- Linear Drive Force Limit - If linear velocity drive is enabled, this is the maximum force that will be applied to attain LinearVelocityTarget.
- Swing Position Drive - Enable position drive on the swing axes.
- Swing Velocity Drive - Enable velocity drive on the swing axes.
- Twist Position Drive - Enable position drive around the twist axis.
- Twist Velocity Drive - Enable velocity drive around the twist axis.
- Angular Slerp Drive - Advanced option. Specifies the method that is used for applying drive to the joint.
- Angular Position Target - If angular position drive is enabled, this is the target relative quaternion that the joint will try to achieve.
- Angular Velocity Target - If angular velocity drive is enabled, this is the target relative angular velocity that the joint will try to achieve.
- Angular Drive Spring - If angular position drive is enabled, this is the stiffness of the drive spring.
- Angular Drive Damping - If angular position drive is enabled, this is the damping of the drive spring.
- Angular Drive Force Limit - If angular velocity drive is enabled, this is the maximum torque that will be applied to attain AngularVelocityTarget.
Disabling collision between adjacent primitives is done automatically when the physics asset is created, as it is much faster to rely on the constraints to keep them separate than to use collision to do so. Deleting all of the collision bodies for a given bone will cause the bone and constraint to be removed from the asset. A better method of doing this is to weld the bodies together using the Weld button (or by pressing D).
It is possible to preview skeletal animations on the default skeletal mesh as well as blending between animations and physics simulation of the bodies of the physics asset. To do this, first you must assign an AnimSet containing the animations you wish to preview to the Preview Anim Set in the editor proeprties (proeprties visible with nothing selected). This can be done simply by selecting the AnimSet in the Content Browser and then pressing the button next to the Preview Anim Set property. Once assigned, the listbox in the toolbar should change from being empty to displaying -None-. At this point, the listbox is still disabled so no animation can be selected. To select an animation to play, you must begin the physics simulation preview by pressing the button in the toolbar. The listbox should now be enabled showing a list of all the animations contained in the Preview Anim Set. You can now select an animation from the list and then press the button to cause the skeletal mesh to begin playing the animation. Of course, the physics simulation is taking precedence so you won't see much effect in the Preview Pane. To see the animation playing, you can adjust the Physics Blend property in the editor properties. Another option is to enable Blend On Poke. This will cause the animation to have full weighting until the physics asset is 'poked' in the Preview Pane.