Obstacle bodies can be manipulated in many ways. This page also contains shape manipulation functions. See also the Technical Wiki page for physics API.
Definitions of commonly used functions (credits to the Tech Wiki by yorshex for some definitions):
mgCreateBody(x,y,z,rx,ry,rz) - Returns a body, placed at x, y, z, rotated rx, ry, rz.
mgSetPos(b,x,y,z) - Sets the position of body b to x, y, z.
mgGetPos(b) - Returns the position x, y, z of body b.
mgSetRot(b,rx,ry,rz) - Sets the angle of body b to rx, ry, rz.
mgGetRot(b) - Returns the angle rx, ry, rz of body b.
mgSetVel(b,x,y,z) - Sets the velocity of body b.
mgSetAngVel(b,x,y,z) - Sets the angular velocity of body b.
mgMove(b,x,y,z,d,s) - Moves body b to position x, y, z. d controls how much other forces are damped, and s controls the applied speed.
mgRotate(b,rx,ry,rz,d,s) - Rotates body b to angle rx, ry, rz. d controls how much other angular forces are damped, and s controls the applied speed.
mgReleaseMotion(b) - Cancels mgMove() effects on body b.
mgBodyIsBroken(b) - Returns true or false depending on whether body b is broken or not.
mgRaycast(x1,y1,z1,x2,y2,z2,u) - Shoots a ray from x1, y1, z1 to x2, y2, z2. If the ray collides with something, it returns coordinates of the collision point. If the ray doesn't collide with anything, it returns false. Effects of u are unknown.
mgCreateBox(b,w,h,d,x,y,z,rx,ry,rz) - Creates a box in the body b of width, height and depth: w, h and d respectively, at position x, y, z, and angle rx, ry, rz.
mgCreateCylinder(b,r,w,x,y,z,rx,ry,rz) - Creates a cylinder in the body b of radius and width: r and w respectively, at position x, y, z, and angle rx, ry, rz.
mgCreateMesh(b,m,x,y,z,rx,ry,rz) - Creates a mesh of the name m in the body b, at position x, y, z, and angle rx, ry, rz. (Meshes are located in the meshes folder)
mgMaterial(m) - Sets the material of the next created shapes to m. (Materials are defined in materials.xml)
mgSetShapeScale(sx,sy,sz) - Sets the scale of the next created shapes to sx, sy, sz.