mobkit
- collision info is now saved on the entity as self.colinfo so it's also accessible from callbacks (for MT 5.2 and older it's always nil)
- mobkit.get_box_displace_cols() changed return format, it now returns a 2 dimensional array
get_box_displace_cols returns an array of all node columns a box would enter if it were displaced by a specified vector. The following image shows the result columns as highlighted.
return array format:
{
{{x=,z=}, {x=,z=}, ...}
{{x=,z=}, ...}
...
}
It's 2 dimensional because sometimes making an a few nodes long move isn't going to be possible (e.g. a steep slope), then you may only take into consideration only result[1] and be able to make a move of 1 node.
This function is intended as the basis of movement behaviors of entities of arbitrary collision box sizes (both over and under 1n).
Just iterate over the result and test the nodes within these columns to check if and how an entity can go in the specified direction.
If it turns out it has to jump/step up use get_box_intersect_cols() to get the columns needed to determine if there's enough room above to make the jump.
-