Please describe a fuction..
How exactly does PR_SphereInEntity work? Does it make a bounding box around the entity, or does it use polytopes? If you could tell me a little about the workings of that function, I would appreciate it. Thank you.
-Rich
It compares the distance between the entity origin and location you pass in against the sum of the radii. The radius of the entity is taken from entity->shape->bbox.radius.
If the distance is greater than the sum of the radii there is no collision. There is hardly any math involved and only 6 compares which makes it an excellent choice for quick rejection tests.
If the distance is greater than the sum of the radii there is no collision. There is hardly any math involved and only 6 compares which makes it an excellent choice for quick rejection tests.
No good for CHR''s though.
Chris what''s equivalent for CHR''s?
Thanks in advance for helping!
Petrovski
Chris what''s equivalent for CHR''s?
Thanks in advance for helping!
Petrovski
Actually characters have entities in them. You can check the radius of the first entity : char->LayerEntities[0].
You may need to adjust the radius if the character is scaled, or just put the value you want in it there.
You may need to adjust the radius if the character is scaled, or just put the value you want in it there.
Chris, could PR do the scaling of the radius and the bbox for us and hold the value in the structure? I find having to do multiplies for bbox and radius on every frame a waste of cycles..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement