Ive been trying to get my chase camera to always be directly behind my model but it ends up directly right of model.
also I want non arc strafing, I want strafe to be perpendicular to dir model is facing. I tried a ThirdPersonHandler but had no luck and the model would only strafe when moving forward.
thanks in advance for reply.
private void buildChaseCamera() {
HashMap props = new HashMap();
props.put(ThirdPersonMouseLook.PROP_ROTATETARGET, "true");
props.put(ThirdPersonMouseLook.PROP_MAXROLLOUT, "6");
props.put(ThirdPersonMouseLook.PROP_MINROLLOUT, "3");
props.put(ThirdPersonMouseLook.PROP_MAXASCENT, ""+45 * FastMath.DEG_TO_RAD);
props.put(ChaseCamera.PROP_INITIALSPHERECOORDS, new Vector3f(5, 0, 30 * FastMath.DEG_TO_RAD));
props.put(ChaseCamera.PROP_DAMPINGK, "4");
props.put(ChaseCamera.PROP_SPRINGK, "0");//controls camera sway on movment
props.put(ChaseCamera.PROP_STAYBEHINDTARGET, "true");
chaser = new ChaseCamera(cam, robot1, props);
chaser.setMaxDistance(10);
chaser.setMinDistance(10);
}
private void buildInput() {
input = new robotMotionHandler(robot1, properties.getRenderer());
}
robotMotionHandler is FlagRushHandler I only changed right/left rotates to right/left strafes
KeyNodeStrafeRightAction strafeRight = new KeyNodeStrafeRightAction(node, 10f);
addAction(strafeRight, "strafeRight", true);
KeyNodeStrafeLeftAction strafeLeft = new KeyNodeStrafeLeftAction(node, 10f);
addAction(strafeLeft, "strafeLeft", true);
Im going for quake3 movement but thirdperson .
edit: ok I got it mostly working with ThirdPersonHandler but the strafe is still a huge arc.
and if I change it to strafe properly I cant rotate with the mouse at all. :?
no the arc strafing remains even when I get the camera to stay behind model.I have no idea how to fix it I was waiting for the developers to get to it or someone in the forums post a fix. as for getting the camera to stay behind model, I use these properties for my chaser cam.
/**
* When true, the controlled target will do turns by moving forward and
* turning at the same time. When false, a turn will cause immediate
* rotation to the given angle.
*/
handlerProps.put(ThirdPersonHandler.PROP_DOGRADUAL, "true");
handlerProps.put(ThirdPersonHandler.PROP_TURNSPEED, ""+(1.0f * FastMath.PI));
/**
* if true, backwards movement will not cause the target to rotate around to
* point backwards. (useful for vehicle movement) Default is false.
*/
handlerProps.put(ThirdPersonHandler.PROP_LOCKBACKWARDS, "true");
/**
* if true, strafe movements will always be target aligned, even if other
* movement is camera aligned. Default is false.
*/
handlerProps.put(ThirdPersonHandler.PROP_STRAFETARGETALIGN, "false");
/**
* if true, movements of the character are in relation to the current camera
* view. If false, they are in relation to the current target's facing
* vector. Default is true.
*/
handlerProps.put(ThirdPersonHandler.PROP_CAMERAALIGNEDMOVE, "false");
/**
* if true, left and right keys will rotate the target instead of moving them.
* Default is false.
*/
handlerProps.put(ThirdPersonHandler.PROP_ROTATEONLY, "false");