Okay, at the top we "need" the following constant block:
#Constant ELLIP_2_POLY=2
#Constant RESP_SLIDE=2
#Constant DYN_NO_RESP=0
We'll ask you to update that block when we make upgrades, and you'll get a new block to put there. Basically this gives us an "ellip-2-poly" collision method, with a sliding response method, and a "no dynamic" response method. This will be expanded to include a "ellip-2-ellip" coll method, sticky collision, and more. So that's what it's for.
Next you have the collision type ID's, you can create your own, this is in the comments as well.
#Constant TYPE_CAM = 10
#Constant TYPE_WORLD = 11
Next we have collision definitions:
SetCollisionsPro( TYPE_CAM, TYPE_WORLD, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP )
This may seem useless as of right now, but this allows you to define which objects can collide with which objects.
IE: You can create an alien type and make a definition so it collides with spaceship meshes, and humanoids that collide with earth objects. Here's an example of how this might look:
#Constant TYPE_HUMANOID = 10
#Constant TYPE_EARTH_MESH = 11
#Constant TYPE_ALIEN = 12
#Constant TYPE_SPACESHIP = 13
SetCollisionsPro( TYPE_HUMANOID, TYPE_EARTH_MESH, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP )
SetCollisionsPro( TYPE_ALIEN, TYPE_SPACESHIP, ELLIP_2_POLY, RESP_SLIDE, DYN_NO_RESP )
The next part would be to define which objects are of what type ID. We need to do define our aliens, and earthlings, etc. We also might want to set the ellipsoid size of our aliens and earthlings at the same time. Here's what an example might look like:
for EarthMesh=1 to 10
CollisionTypePRO( EarthMesh, TYPE_EARTH_MESH )
next EarthMesh
for Earthling=11 to 50
CollisionTypePRO( Earthling, TYPE_HUMANOID )
SetObjRadiusPRO( Earthling, 2, 4, 2 )
next Earthling
for SpaceShip=51 to 70
CollisionTypePRO( SpaceShip, TYPE_SPACESHIP )
next SpaceShip
for Alien=71 to 100
CollisionTypePRO( Alien, TYPE_ALIEN )
SetObjRadiusPRO( Alien, 3, 7, 3 )
next Alien
And that's about all there is to it.
All you do to make collision work is:
rem Call this once before you draw the screen
RunCollisionPRO()
And this would make the Aliens collide with the spaceships and the humanoids will collide with the Earth objects.
There is a nice command to disable/enable the collision of an object. So if you have a spaceship that is far away and don't need to test collision with it you go like:
DeActivateObjPRO( SpaceShip_Obj )
And if the time comes where you need to test collision with the mesh again you go like:
ActivateObjPRO( SpaceShip_Obj )
------
New stuff coming and things to note:
You cannot rotate the mesh after defining it. This is being changed for the next release, so you'll be able to rotate your meshes.
If an ellip is pressed up against a mesh when it moves, the ellip may go through the mesh. (this is where dynamic response comes into play. Dynamic response will come out with the shareware copy of the DLL)
Ellip-2-ellip collision is coming out in the next release. So you can make the aliens/humans safely and quickly collide with one another.
And more is on the way!
Let me know if you have any more questions.