Is it possible to know which entity 'A' collides with if there are 200 entities in the environment?
In purebasic you can count the occuring collisions at any given time. World physics must be enabled, entities must have bodies.
The official examineworldcollisions.pb example might be helpful.
Examineworldcollisions counts the collisions and returns false, when there are no, any other if there is one or more to check.
Using Nextworldcollision() you can iterate trough the list of collisions created with the examine.
First and Secondworldcollisionentity() get the participants of the examined collision.
Code: Select all
If ExamineWorldCollisions(#False) ;False here means, we do not need extra data for the collision, like normals
While NextWorldCollision()
entityA = FirstWorldCollisionEntity() ;These two are colliding in this collision
entityB = SecondWorldCollisionEntity()
Wend
EndIf
Bear in mind, that there are some transformation bug, that never had been fixed.
When you create a game object for physics in a modeler, or a mesh on the fly: create it centered around origo 0,0,0
If you don't, your simple physics bodies (cylinders) won't be in sync with your entity. Your compound objects will be, but the center of mass will remain at 0,0,0.
( the last can be used to create an all-the-way-up weeble wobble as a feature, since there are no command to set the center of mass, only to get)
Static objects shall be fine. If any given time you have doubts, use:
PS: I wish you luck with your project, hoping i have helped a bit and did not say too many stupid things...
