By David 'Oddball' Williamson
Welcome to the Advanced Body Editor (ABE) for use with the PhysLite physics module. ABE is used to constructed generic AdvBody objects that can be loaded, using PhysLite, by your games and appps. I would always recommend making your own purpose built editor for your games, but ABE is perfectly usable for constructing basic TAdvBody objects.
The application is split into three main sections, the workspace, view options, and the edit panel, which are explained in detail below.
The workspace is where you can interact directly with the TAdvBody that you are creating, and it shows the changes made manually too. Most operations are performed by clicking or dragging nodes, or by clicking directly onto the workspace. Available operations are always described in the status bar at the bottom. The action required is enclosed in square brackets [], and progression is represented by the greater than > symbol. Possible actions are LMB and RMB, these mean left mouse button and right mouse button respectfully. Node means the action must be on a node. Drag means to drag the mouse whilst still holding the relivent mouse button down. An example of a series of actions may be [LMB>NODE>DRAG>NODE]. This means click the left mouse button on a node and whilst holding down the button drag the mouse pointer to another node before releasing it. What actions are available depends directly upon which edit mode is selected.
This panel alters how the workspace is viewed. Click on a zoom level to zoom in or out. Clicking reset view will reset the workspace to center on the TAdvBody and changes the zoom level to x1.
AdvBody editing mode can be accessed by selecting the body tab. In this mode the body can be edited as a whole.
These buttons allow a body to be opened or saved.
Using move you can move the whole body. Click the node with the left mouse button then simply drag the body to the new location and release.
Like move, rotate affects the whole body. Left click the node and drag to rotate.
Use manual editing for fine tuning position and rotation. Other options within manual editing are naming your AdvBody, and cleaning all component indexes.
Mass edit mode will often be the first port of call when creating a new AdvBody.
In this mode clicking anywhere on the workspace will create a mass. A new mass will be created with mass and radius of 10, and a unique colGroup of 1. See manual editing below for more on ColGroups.
Click a node to remove the mass from the body.
Whilst in this mode click on a node and drag to move a mass.
In this mode left click and drag a node to change the radius of a mass.
Clicking a node in this mode will toggle wheither a mass is frozen or thawed.
The starting velocity of a mass can be set in this mode.
It is important to note that the friction, name and colgroup of a mass can only be set from manual editting. ColGroups work slightly different from the PhysLite engine. Setting an absolute value or a value of 0 work normally. However, when setting a unique colGroup you also give it a numerical value. This allows PhysLite to assign the same unique value to multiple masses. Use this when you need a body to collide with other bodies of the same type, but don't want the masses within the same body to interact with each other.
Click the Constraint tab to start creating and editing constraints.
To add a constraint you must connect two masses together by clicking the node of one mass, and then dragging the point to the second mass.
When in this mode clicking a node will remove the constraint from the body.
Use manual editing to alter the rest length and stiffness of a constraint manually. Stiffness is altered using the slider. Clicking auto rest length will set rest length to the actual length of the constraint.
Click the rig tab to add and edit rigs.
To add a rig simply click a node. When a rig is added it has image 0 as it's image and isn't associated with a constraint. It is important to use the manual edit to set these. If no images have been loaded into the body yet then you will not be able to add a rig.
Left clicking a node whilst in this mode will remove the rig from the body.
Click and drag a node to rotate a rig. This sets the angle offset from it's associate constraint.
Left click and drag a node to visually scale the rig image.
All aspects of a rig can be edited here. It is important to remember that a rig will not be assigned a constraint until you manually do it from here.
Image mode is used for adding images to the body. Images are not named and simply assigned an index.
Clicking Add opens a file requester. Simply choose the image you wish to load.
From here you can set the image flags and position the image handle. Changes made here will affect all rigs using the image.
This area is a simple simulation space for testing your creations. Whilst the simulation is playing you can grab a mass and drag the body about with the mouse pointer.
Clicking reset returns the body back to it's starting position.
The play/pause button starts and stops the simulation.
Step allows you to progress the simulation one frame at a time.
Set the gravity of the simulation. It's recomended to use the same value that your game will use.
Set the frames per second of the simulation. When testing you should set Hertz to the Hertz your game will run at.
Sets the PhysLite iterations value. This can help guage what value to use for your game.
The bounds can be altered whilst the simulation is paused by drag a node to the desired location.