Quick question. I happened to notice the following text at the end of the “Roaming Ralph” page of the manual:
But… I can’t seem to find any good direct references in the forums so far about suggestions for improvement. Is there any definitive “best” way to do it?
I imagine the answer depends on the kind of game you’re after… Mine is a free-roaming RPG-style setup. All I’m interested in is the height of the geometry beneath some specified point (usually the player). I can handle the calculations from there, but the text I’ve quoted has confused me.
Is it that the Collision Ray idea not so great, or is it simply the implamentation of it in RoamingRalph that isn’t good?
It is more efficient to use CollisionHandlerFloor instead of CollisionHandlerQueue. Or, if you use GeoMipTerrain, then getElevation() method.
Search forums to see examples.
Ah, I see. I did note that the Queue was in use, rather than the GroundHandler, but I didn’t guess that that was the source of inefficiency.
Thank you muchly.
Hope that I do not hijack your thread
I’m currently working on different approaches to do collision detection as good as possible (I will describe it in a later post if people are intersted). While working with Panda CD I discovered a small problem. I think it is a math problem but maybe anyone has a good idea to solve it properly. The problem:
There are two exactly aligend boxes (with exactly I mean float a == float b). The character stays on top of this boxes. When the character stays exactly on one side of one of this polygon a collision ray through the ground reports not the collision on the top but two collisions on the ground (maybe one from cube 1 and one from cube 2).
I think that this also may happen in Roaming Ralph. Surely there is test if there is no valid location, but in this case Ralph may stop walking at a location where there is no visible blocking object.
@Azraiyl: this indeed was highjcking a thread . you can use a small collision sphere at the feet of your player to let him walk across small gaps and to fix situations like yours.
collision queue and handlers aside. there are more ways of optimizing collision detection. using special collision geometry, or you self-optimize the geometry for collision with something like quad or octrees.