38
  Physics
  Physics (1)
 
 
Physics commands have been introduced with AW version 5.1 in 2011. So the commands for physics are relatively new and still unknown to most of us, also because they are not so often used in Activeworlds.
Physics commands
On AW Wiki you can read about physics and the commands related to physics
When you go the the user guide in the F9 tabs window, you will see these pages too.
general: http://wiki.activeworlds.com/index.php?title=Physics
  http://wiki.activeworlds.com/index.php?title=Category%3APhysics
  http://wiki.activeworlds.com/index.php?title=Object_scripting#Commands
trigger: http://wiki.activeworlds.com/index.php?title=Collide
commands: http://wiki.activeworlds.com/index.php?title=Addforce
  http://wiki.activeworlds.com/index.php?title=Addtorque
  http://wiki.activeworlds.com/index.php?title=Collider
  http://wiki.activeworlds.com/index.php?title=Ballsocket
  http://wiki.activeworlds.com/index.php?title=Colltag
  http://wiki.activeworlds.com/index.php?title=Hinge
  http://wiki.activeworlds.com/index.php?title=Velocity
Yellow Physics Arena
Basic Physics commands
 
Collider (collider primitives)
You can use any object for physics, from simple to complicated (read : high polygon) objects. If you want to use physics on such objects, it is better to use collider primitives (in the action command) instead of using the original shape of the object (because then , the computer needs to do less physics "calculations" when using the collider primitives). We have these collider primitives :
box * sphere * cone * cylinder * hull * capsule * tree
Each primitive has a different impact/reaction on the physics commands. "Box" can be used for walls, floors, panels ,...
"Tree" is used for polygonal meshes (for the original shape), but for very complex shapes ,this could be too much for the aw game engine , causing to restart AW.
create collider sphere
create collider tree
Static
The collider will remain where it is, no force can move it . "Collider static" will cause the object to react on collisions, but won't move itself.
create collider sphere static
create collider hull static
create collider tree ( -> Collider tree is always static, so no need to type"static" )
Nograv
nogravity, or nograv in short, will cause the object to behave like in outer space. Gravity will not affect the collider, but outside forces can affect it : it can move or be moved.
create collider sphere nograv
create collider capsule nograv
Mass
Mass will give gravity to the collider object ,and outside forces can move it. For mass, you can use positive values, also decimal values : e.g. mass=1 mass=100 mass=0.1. When you use mass=0 is the same as "static".
create collider sphere mass=.1
create collider cone mass=1
Avvel
Avvel (="avatar velocity") allows an avatar to interact with object on collision, e.g. to kick a ball. Avvel does not work with "tree" or with "static".
create collider box avvel
create collder sphere mass=1 avvel
Colltag
The colltag command is followed by a number (integer), and is used in combination/interaction with other objects with the same colltag number.
create colltag 33 (-> colltag is used with the collide command)
Addforce
addforce "adds a force" onto an object in a specified direction (x y z -axis) , optional : ltm (object axis instead of world axis) . Adding 3 extra coordinates for pitch , yaw and roll will make the object spin around its geometric center. You can add a name command.
create collider sphere; activate addforce 1 0 0 (-> the object will move along the x axis with a force of 1 newton)
create collider sphere; activate addforce 0 0 30 (-> the object will move along the z axis with a force of 30 newtons)
create collider sphere; activate addforce 0 0 -30 (-> the object will move along the z axis but in the opposite direction)
create collider sphere; activate addforce 10 0 0 ltm (-> ltm will make the object move on the object's axises instead of the world's axises )
create collider sphere;activate addforce 10 0 0 10 0 10 (-> the object will also spin around its x and z-axis ) (= pitch and roll)
addforce will react differently if the object has "nograv" (collider sphere nograv ) or if it has the object has a "mass" (collider sphere mass=1 )
Velocity
Velocity adds a speed onto an object in a specified direction (x y z-axis), optional : ltm (object axis instead of world axis) . Adding coordinates for pitch , yaw and roll will make the object spin around its geometric center. You can add a name command.
create collider sphere ; activate velocity 10 0 0 (-> the object will move along the x axis with a speed of 10 meters per second)
create collider sphere ; activate velocity 10 0 0 10 0 10 (-> the object will also spin around its x and z-axis ) (= pitch and roll)
Velocity will react differently if the object has "nograv" or if it has the object has a "mass".
Addtorque
Addtorque adds a rotation force onto the object (pitch for x-axis, yaw for y-axis and roll for z-axis) . Optional : ltm (object axis instead of world axis).You can add a name command.
create collider sphere; activate addtorque 10 0 0
create collider sphere; activate addtorque 0 0 -10
Addtorque will react differently if the object has "nograv" or if it has the object has a "mass".