Page 1 of 1

Entity collision box

Posted: Sat Jun 08, 2019 4:18 pm
by eterevsky
I am trying to figure out a general way to find the collision box for an entity on the map. Every entity has entity.bounding_box, but this is not the same as the collision box. For entities that are not rotated it looks like you can find the collision box by taking entity.prototype.collision_box and moving it to entity.pos, but from what I can tell this doesn't work for cliffs, because the prototype collision box for cliff doesn't contain orientation.

What is the general algorithm for finding the collision box of an entity?

Re: Entity collision box

Posted: Sat Jun 08, 2019 4:43 pm
by Bilka
" it looks like you can find the collision box by taking entity.prototype.collision_box and moving it to entity.pos" That's what entity.bounding_box does for you. So what exactly is the problem with using that?

Re: Entity collision box

Posted: Sat Jun 08, 2019 4:47 pm
by darkfrei
Cliffs have unique name for every rotation.

Re: Entity collision box

Posted: Sat Jun 08, 2019 5:09 pm
by eterevsky
That's what entity.bounding_box does for you.
Bilka, looks like you are right. I was confused and thought and collision and bounding box are two different things. Now I checked again with a few entities, and it looks like bounding_box is just collision_box from prototype plus position. Thanks.

Re: Entity collision box

Posted: Sat Jun 08, 2019 5:51 pm
by eradicator
Bilka wrote: Sat Jun 08, 2019 4:43 pm " it looks like you can find the collision box by taking entity.prototype.collision_box and moving it to entity.pos" That's what entity.bounding_box does for you. So what exactly is the problem with using that?
Bounding_box has no description whatsoever in the api doc btw... ;)
Might even be worth writing an additional comment in EntityPrototype.collision_box.

Re: Entity collision box

Posted: Sat Jun 08, 2019 6:07 pm
by Bilka
eradicator wrote: Sat Jun 08, 2019 5:51 pm Bounding_box has no description whatsoever in the api doc btw... ;)
Fixed :)