UDN
Search public documentation

PhATUserGuide
Licensees can log in.

Red links require licensee log in.

Interested in the Unreal engine?
Check out the licensing page.

Questions about UDN itself?
Contact the UDN Staff

Unreal Physics Asset Tool (PhAT) User Guide

Document Summary: Guide to using the Unreal Physics Asset Tool.

Document Summary: Created by James Golding. Maintained by Richard Nalezynski.

Introduction

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.

Using PhAT

Opening PhAT

In the Generic Browser in UnrealEd, make sure that Physical Assets are selected for filtering. Select a Package (make sure to fully load, to be safe), and simply double-click on an asset; or right-click on an asset and and select Physics Editor (PhAT).

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.

Creating a Physics Asset

To create a physics asset, navigate to the Generic Browser and find the skeletal object 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 asset option .

PhAT Overview

Editor Layout

Menu Bar

Edit Menu

  • Undo
  • Redo
  • Change Default Skeletal Mesh

Tools Menu

  • Reset Entire Asset
  • Reset Skeletal Bone Collision
  • Apply Selected Physical Material to All Bodies
  • Copy Joint Settings to All Joints

Window Menu

  • Properties
  • Tree

Tool Bar

What follows is a description of each of the toolbar buttons, from left to right as they appear on the toolbar.

Icon Name Description
PhAT_BodyMode.jpg / PhAT_ConstraintMode.jpg Editing Mode (B)/(C) Toggle between editing physical bodies or constraints.
PhAT_WorldSpace.jpg / PhAT_LocalSpace.jpg Movement Space (W)/(L)  
PhAT_TransMode.jpg Translation Mode (W)  
PhAT_RotMode.jpg Rotation Mode (E)  
PhAT_ScaleMode.jpg Scaling Mode (R)  
PhAT_Snap.jpg Snap (A)  
PhAT_CopyProps.jpg COPY PROPERTIES TO...  
PhAT_InstanceProps.jpg Instance Properties (I)  
PhAT_StartSim.jpg / PhAT_StopSim.jpg Toggle Simulation (S)  
PhAT_ShowMesh.jpg / PhAT_WireMesh.jpg / PhAT_HideMesh.jpg Cycle Mesh Rendering Mode (H)  
PhAT_ShowColl.jpg / PhAT_WireColl.jpg / PhAT_HideColl.jpg Cycle Collision Rendering Mode (J)  
PhAT_ConPos.jpg / PhAT_ConLimit.jpg / PhAT_ConHide.jpg Cycle Constraint Rendering Mode (K)  
Lock.jpg Show Fixed Bodies  
PhAT_ShowFloor.jpg Draw Ground Box  
PhAT_ShowSkel.jpg Toggle Graphics Hierarchy  
PhAT_ShowContacts.jpg Toggle View Contacts  
PhAT_HighlightVert.jpg Show Selected Bone Influences  
PhAT_ShowCOM.jpg Toggle Mass Properties  
PhAT_DisablePair.jpg Disable Collision With...  
PhAT_EnablePair.jpg Enable Collision With...  
PhAT_Weld.jpg Weld to This Body... (D)  
PhAT_AddBone.jpg Add New Body  
PhAT_AddSphere.jpg Add Sphere  
PhAT_AddSphyl.jpg Add Sphyl  
PhAT_AddBox.jpg Add Box  
PhAT_DelPrim.jpg Delete Current Primitive (DEL)  
PhAT_DupPrim.jpg Duplicate Current Primitive  
PhAT_ConFrame.jpg Reset Constraint Reference  
PhAT_BSJoint.jpg Convert to Ball-and-Socket  
PhAT_Hinge.jpg Convert to Hinge  
PhAT_Prismatic.jpg Convert to Prismatic  
PhAT_Skel.jpg Convert to Skeletal  
PhAT_DelJoint.jpg Delete Current Constraint  
PhAT_ShowAnimSkel.jpg Show Animation Skeleton  

Properties Pane

Disabling

KMeshProps

AggGeom  
COMNudge An offset applied on top of the body's PhysX-calculated Center of Mass.

RB_BodySetup

bBlockNonZeroExtent  
bBlockZeroExtent  
bFixed  
bNoCollision  
bNoImpactEvents  
BoneName  
MassScale  
PhysicalMaterial See the Physical Material page for more information.

Tree Window

Controls

Mouse Controls

LMB Select limb/joint or widget axis
SHIFT-LMB will do a non-uniform transform if possible (scaling along one axis)
X Lock Selection
CTRL-RMB grab onto the physics asset (only in a live simulation)

Keyboard Controls

W Move Mode
E Rotate Mode
R Scale Mode
Spacebar Cycle Widget Mode
B Switch between Body and Constraint mode
A Turn on Snap
C Copy properties from/to
S Simulation start/stop
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
DEL Delete constraint/body
HOME Center view on selected Body or Constraint
L + DRAG Orbit directional light
[ Enable collision between selected body and another
] Disable collision with the selected body and another

Hot Keys

Working with Phyics Assets

Modifying a physics asset

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 interpenetrating 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.

Collision primitives / bodies

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.

Fig1_1.jpg

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 toggle through the render modes for the skeletal object (or press H) to switch to wireframe or invisible mode.

Fig1_2.jpg

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.

There are some options you can set in the properties panel on a body:

SleepFamily Controls how aggresively the physics engine will put an object to sleep.
bNoCollision Disables physics collision for this object. It will still have physics applied to it though.
bAlwaysFullAnimWeight If TRUE, and bEnableFullAnimWeightBodies is TRUE in the SkeletalMeshComponent, the physics of this body will always be used to update the graphics bone, regardless of what PhysicsWeight is set to. This is useful for 'always on' flappy parts like pony-tails or cloth-like bones. The SkeletalMeshActor class will automatically 'unfix' these bodies, so they will still wake even if the Physics mode is not PHYS_RigidBody. This allows you to have flappy parts on animated characters (e.g. in cinematics). In this case you do need to set bHasPhysicsAssetInstance to TRUE on the SkeletalMeshComponent though.

If you open up the individual shapes within the AggGeom you can set some additional options:

bNoRBCollision 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.
bPerPolyShape 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.

Constraints

Toggling the Body mode button will switch to Constraint mode, and the rendering of the physical asset will change to show purple wireframe 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.

Constr_1.jpg

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 _SwingLimit_s, 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.

RotatedConstraint.jpg

You can find more information on the various constraint settings on the Physics Constraint Reference page.

Miscellaneous

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).