Hey, I was just wondering if somehow there was a separate physics sweep system (like there’s ray casting). Atm, I need cylinder sweeping. So, is this in jME? If it’s somewhere that I’ve missed, please tell me lol, thanks!
physicsSpace.sweepTest()?
Amazing… I didn’t see that! Hmm… I seem to be having some trouble with the results… The locations are always small numbers, like -0.067814164. Am I doing something wrong?
[java]List <PhysicsSweepTestResult> r= new ArrayList<PhysicsSweepTestResult>();
this.getPhysicsSpace().sweepTest(c, new Transform(geom.getWorldTranslation().add(new Vector3f(0,6,0))), new Transform(geom.getWorldTranslation()), r);
for (int i = 0; i < r.size(); i++) {
Vector3f pt = r.get(i).getHitNormalLocal();
System.out.println("* Collision #" + i);
System.out.println(" Hit= " + pt);
}[/java]
Thanks!
That’s the normal vector, you’re looking for the position
Ahahaha!!! THAT makes more sense… For some reason I was thinking of a completely DIFFERENT normal XD lol, the only problem is that THAT’S the only somewhat position/Vector3f thing there is… There isn’t a getContactPoint or anything like that. There’s only a getCollisionObject, but if I just get the location of the object then I won’t get the data that I want (I want the hit position, like a ray, only with a cylinder collision shape ). Is the problem there that PhysicsSweepTestResult doesn’t extend CollisionResults? Thanks.
-NomNom
I think the issue is that there isn’t a single point where the collision actually occurs. If you think about it, when two volumes sink into each other there’s a whole volume inside them that is the “collision point”
Hmmm… That makes sense… Guess I have to stick to rays, then, lol. Thanks!
-NomNom