I've been using the Kingdom Hearts movement and camera for a while now, and never really had any problems when I was using blocks in wed. Now all my levels are models, and I'm having issues with clipping. I've been trying for the past few days to solve this but haven't been able to. I'm wondering if someone could help me out, I just want the camera to not clip through models, any help will be appreciated. Below is the camera function.

FUNCTION handle_camera() {
camera_pan -= mouse_force.x * 12 * time;
camera_tilt += mouse_force.y * 8 * time;
camera_tilt = clamp(camera_tilt,-70,50);

camera.pan = camera_pan;
temp = fcos(camera_tilt,-camera_distance);
vec_set(camera_move_to.x,vector(my.x + fcos(camera.pan,temp),my.y + fsin(camera.pan,temp),my.z + 20 + fsin(camera_tilt,-camera_distance)));

temp = min(1,2 * time);
camera.x += temp*(camera_move_to.x - camera.x);
camera.y += temp*(camera_move_to.y - camera.y);
camera.z += temp*(camera_move_to.z - camera.z);

vec_diff(temp.x,camera.x,my.x);
vec_normalize(temp.x,16);
vec_add(temp.x,camera.x);


IF (c_trace(my.x,temp.x,ignore_me) > 0) {
vec_diff(temp.x,my.x,target.x);
vec_normalize(temp.x,16);
vec_set(camera.x,target.x);
vec_add(camera.x,temp.x);
}

vec_diff(temp.x,my.x,camera.x);
vec_to_angle(camera.pan,temp.x);
}

Last edited by Skeksis; 05/21/08 13:46.