I’m using the collision and navigation system in the same way as David Yazel’s Quake3 level loader (dummy avatar node) for first-person navigation and it’s working fine so far, but I’m having trouble making the view get close enough to walls so that it’s right up against it, but doesn’t see through the actual geometry. For instance, when you put your head next to a wall and look straight ahead, all you see is the wall to your right, but in my program you see through the geometry on the right. In case that didn’t make sense, a screenshot:
http://www.csc.calpoly.edu/~ehdoty/thing.jpg
This is actually with some relatively small values for the size of the bounding sphere and collision node. If I make the bounds or collider node a little bigger, this doesn’t happen, but then, for instance, I can’t fit through the crack that you see straight ahead. I’d like the view node to be small so it can go wherever.
Here’s some code (from the quake3 loader) illustrating the dummy navigation node, if you’re not familiar with it:
// build a dummy node to represent the avatar for collision and movement
// purposes. we do this by creating a branch group with set bounds around an
// avatar of 1.83 meters high. Then we make a collider node of an ellipsoid which is
// half as wide as it is tall.
TransformGroup aTG = new TransformGroup();
Node n = new BranchGroup();
n.setBoundsAutoCompute(false);
n.setBounds(new BoundingSphere(new Point3f(0, 0.915f, 0), 0.915f));
aTG.addChild(n);
converter.getRoot().addChild(aTG);
avatarNode = new ColliderNode(n, ColliderNode.CT_ELLIPSOID, ColliderNode.CT_ELLIPSOID, true, new Coord3f(0.5f, 1, 0.5f));
cs.addCollider(avatarNode);
Do I need to modify the view somehow to make it not always be in the center of the screen so if I get close to the wall, it moves as well? I’m not sure if this is simple or more complicated than I think. Any suggestions? Thanks 