can you tell me why this collision mode results in crash/segmentation fault?

Started by William, September 16, 2023, 00:58:36

Previous topic - Next topic

William

Collisions(GroupCharacters,GroupEnvironment,2,2)
Collisions(GroupCharacters,GroupCharacters,2,2)
with true to collision with children of the entities and there arent any.
groupcharacters = 3 groupenvironment = 2

ellipsoid to polygon and sliding on collision modes.

it crashes upon execution. i wish to have collisions between terrain and entities and between entities. there are also a force of gravity moving entity down until Y is 0.1 but really Y does not equal 0.1  as collision happens above that slightly. so it cannot check for 2 collisions of the same entity type while  an collision? each loop the entity is moved negative Y i believe and collision occurs.
im still interested in oldschool app/gamedev

Midimaster

with CountCollisions(MyEntity) you can count how many collisions a specific entity had. And with CollisionEntity(MyEntity,index) you can find out which other Entities were involved in this collisions.

Player:TEntity  = LoadMesh(....
Terrain:TEntity = CreatePlane(..
Cube:TEntity    = CreateCube(...
...
'check player's collisions:
count:Int = CountCollisions(Player)
For local i:int=1 to count
    local contact:TEntity = CollisionEntity(Player,i)
    If contact=Terrain
         .....
    ElseIf contact=Cube
         .....
    Endif
Next

The quality of detecting the collisions is defined by the size of the collision radius. So start first with too big collision boxes and ignore, that these leads to graphic artifacts or too soon messages. You can do the fine tuning later.

f.e. a too small collision radius can result in not detecting the collision

Example: You defined the radius 0.03 for both objects and the objects stand with a distance of 0.05:
Object A x= 23.05
Object B x= 23.10

Now you move Object A +0.1. Now it stands "behind" object 2
Object A x= 23.15
Object B x= 23.10

So we would suppose, there was a "collision". But both object never were closed enough (<0.03) to trigger a "collision" event. BlitzMax does not scan "the way" but only the given waypoints. And those were 23.05 and 23.10 and 23.15


To help you in your specific question we need more code!
...back from Egypt