Hey everyone, I’ve been working on a chasecamera ray casting situation all day. I have a couple of issues.
This is my code for the ray casting and collision checks on the chasecamera and its moving object:
CollisionResults results = new CollisionResults();
Ray ray = new Ray(cam.getLocation(), cam.getDirection());
teaGeom.collideWith(ray, results);
if(results.size()>0){
CollisionResult closest = results.getClosestCollision();
chaseCam.getMinDistance();
}
I’m using the TestChaseCamera tutorial but I thought something might go through if I worked on the simpleUpdate method with CollisionResults and Ray. I keep getting the feeling that the camera isn’t meant for collision detection like the Zelda one is.
would it seem better if I used:
if(results.size()>0){
CollisionResult closest = results.getClosestCollision();
closest.setContactPoint(teaGeom.getLocalTranslation())
I kind of feel like if you wrote out what you are trying to do, step by step, in english… it would in no way resemble the code you are randomly trying to make work.
thanks mit. and atm I’m taking a break from programming. I’ve been head to the wall with tutorials for three weeks. I literally can type three just off of memory. Thanks guys.