There we go again. With a proper level, my method seems way to slow. Framrates drop to 20fps on my galaxy -> Not good :/
So I'm back to square one again. I'm finally so far to say "screw this all, lets get that ellipsoid rolling".
So far I had no success in getting it to work. As said, I want to check if a given object (now defined as an ellipsoid) collides with the world. I measured out, that a ellipsoid with the radius values 76,22,15 (X,Y,Z respectively) would be the optimal choice. But how do I get the collision check running? My code so far looks like this:
While sEllipsoid is a SimpleVector with x,y,z set to the values above, and SimpleVector.ORIGIN is used to tell that I want to check the collision at the current position (0,0,0 in objectspace), without any moving at all. The if clause always returns true, so what did I do wrong? :/ Oh, by the way, The collision modes are set as
Any ideas? Oh, and may there be a better choice for collision detection, since I only want to check IF a collision is happening at the current position? E.g. I dont need that "moving in direction xxx" stuff, just a simple collision true/false check :/
So long,
Kernle
So I'm back to square one again. I'm finally so far to say "screw this all, lets get that ellipsoid rolling".
So far I had no success in getting it to work. As said, I want to check if a given object (now defined as an ellipsoid) collides with the world. I measured out, that a ellipsoid with the radius values 76,22,15 (X,Y,Z respectively) would be the optimal choice. But how do I get the collision check running? My code so far looks like this:
Code Select
if(!mPlayerObject.checkForCollisionEllipsoid(SimpleVector.ORIGIN, sEllipsoid, 1).equals(sEllipsoid))
endGame();
While sEllipsoid is a SimpleVector with x,y,z set to the values above, and SimpleVector.ORIGIN is used to tell that I want to check the collision at the current position (0,0,0 in objectspace), without any moving at all. The if clause always returns true, so what did I do wrong? :/ Oh, by the way, The collision modes are set as
Code Select
mPlayerObject.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
mWorldObject.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
Any ideas? Oh, and may there be a better choice for collision detection, since I only want to check IF a collision is happening at the current position? E.g. I dont need that "moving in direction xxx" stuff, just a simple collision true/false check :/
So long,
Kernle