Hiyas,
I’m working on a project in jme3 and was not happy with the way the current collision detection was implemented (actually… I also had no need for any advanced physics and really didn’t care for how the movement of a physics node was implemented as well), so I wrote a simple collision detection system using rays and very simple physics for gravity only (as it is all I am concerned with for the type of game I am working on.
My primary issue with the implemented collision detection system and why I chose to not use it:
The way it works presently is: Collision happens and then the physics node reacts to the collision
The way I wanted it to work was: Collision is evaluated prior to happening and then stopped before it happens.
Now, the way I implemented collision detection was to use rays to evaluated absolute X, absolute Z, the player nodes relative Z and then Y–all depending on rotation and movement. (i.e. no need to check if their head has collided with the ceiling if they are not jumping… however I always need to check if they are falling… unless on the upswing of jumping, etc)
It takes a total of 4 rays per pass, per object that implements a movable class I wrote to evaluate collision properly.
Sooooo… here it my questions:
- What are the performance issues with ray collision as compared to mesh collision?
- collidesWith (on a geometry) method seems to be a potential resource drain… Is it? (though, the physics node was not working when I decided to take this approach).
Hope this makes sense… and thanks in advance for your insight!