Question with Collisions??

Blitz3D Forums/Blitz3D Beginners Area/Question with Collisions??

W(Posted 2006) [#1]
Hey guys I had a quick question on collisions. Is there any way to perform polygon to polygon collison checking??

-I am asking because in my game the player and the enemies both have an entityradius of .99. which I kinda need so that they won't beable to go through the level,and the player won't beable to back up to a wall and see through it.
- To get to the point I need to perform a melee attack and I need to be really close to the enemy to do so, so how should I handle my collisions in this case??


jhocking(Posted 2006) [#2]
You can get polygon-polygon collision using a 3rd party collision library, like coldet. However, for the specific situation you describe you don't really want polygon-polygon collision detection. Instead, use hitboxes. That is, assign a collision box to each of the characters' bones. Don't have characters collide with each other directly, but instead have their bones collide with each other.


W(Posted 2006) [#3]
Thanks joe, when you say "hitboxes", you mean assigning my characters entitybox's right??


W(Posted 2006) [#4]
I am still not sure what you meant by 'hitboxes' can anyone explain them 2 me??


jhocking(Posted 2006) [#5]
The idea with hitboxes is that you don't test for collisions against the character, you test for collisions with the character's bones. This assumes a skeletal animated model. You use CountChildren/GetChild to loop through all the bones, or use FindChild to locate bones by name, and assign them a handle. You then use that handle to setup collision detection for the bones.

I think EntityBox will work, but I'm not sure. It's been a while, and plus I'm at work so I can't check. The main issue is, do the EntityBox's rotate with the bone as it animates? I think so, so that'll work, but if not then you can just create the boxes as 0 alpha meshes.


WolRon(Posted 2006) [#6]
Not sure about EntityBox, but I know that EntityRadius is always vertical (axis is orientated with Global Y axis), so there's a good chance that EntityBox is the same way.


W(Posted 2006) [#7]
So if I use hitboxes, I could theoretically check character models for which bones I shoot as well then, right?? This way I could check for better collisions and distinguish where I hit the enemies, so that I know how much health to take away from the enemy.

- Could someone show me a tutorial or explanation on how to create\utilize hitboxes??


octothorpe(Posted 2006) [#8]
I know that EntityRadius is always vertical (axis is orientated with Global Y axis)


Spheres have axis?!


Sledge(Posted 2006) [#9]
Gawd love us.


Sir Gak(Posted 2006) [#10]
Spheres have axis, if they rotate. Look at the Earth with its north and south poles.


WolRon(Posted 2006) [#11]
Remember though that MeshesIntersect is a relatively slow command to use...


Sledge(Posted 2006) [#12]
You wouldn't test the entire "art" mesh with meshesintersect() - a child "arm" specifically for collisions would be, what, three polygons. Zones for other areas could be similarly lite. That way you get custom hitboxes that (i)definitely rotate and (ii)report correctly when the two meshes in question are both in motion.