Menu

Collisions

UltraBas

Collisions src_type, dest_type ,method, response

Enable collision detecting; every time an [UpdateWorld] command is performed, the library will automatically check if two or more entities are colliding, and will react to that (so, you don't need to check at every cycle if there are some colliding entity, the library will do that for you)

Not all entities will be checked: only collision between entity of type src_type with entities of type dest_type will be detected (since some entities might not need to be checked for collisions, or might need to react in a different way)

You can set the type of an entity with [EntityType] (the type is a simple number: all entities of the same type will behave in the same way)

method is the collision detection method:

1: ellipsoid-to-ellipsoid collisions (fastest, but not much accurate: you need to set ellipsoid radius with EntityRadius)

2: ellipsoid-to-polygon collisions (the most precise, but slower)

3: ellipsoid-to-box collisions (need to set box size with EntityBox)

response is what the source entity does when a collision occurs:

1: entity will stop

2: slide1 - full sliding collision

3: slide2 - prevent entities from sliding down slopes


Related

Wiki: Alphabetical-commands
Wiki: Category-commands
Wiki: UpdateWorld

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.