Please, Please .. Use code tags. So hard to read. Yes I mixed the vec_set() and vec_sub() entities

Code:
vec_set(temp, vector(-200, -mouse_force.x*MOUSE_FORCE, mouse_force.y *  MOUSE_FORCE) );
clamp(temp.z, -CAMERA_OFFSET,CAMERA_OFFSET);
vec_rotate(temp,vector(camera.pan,camera.tilt,0)); // or player pan
vec_add(temp,player.x);
vec_set(camera.x,temp);
vec_set(vec_temp,camera.x);
vec_sub(vec_temp,player.x);
vec_to_angle(camera.pan,vector(vec_temp.x,vec_temp.y,0);


I removed the time_step(s) but you can add them. Also I add camera.tilt in but I'm not sure I should have, maybe Superku will correct me.

Read this post about cameras and wall detection http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=424436#Post424436
Much better then this code below ..
Code:
vec_add(tempVect, my.x);
if(c_trace(my.x, tempVect, IGNORE_ME | IGNORE_PASSABLE)!=0){
     vec_set(camera.x, target); 
}
else{
    vec_set(camera.x, tempVect);
}




Code:
camera.arc = 70;
	camera.clip_near = 0;
	my.pan -= 0.5 * mickey.x * time_step;
	camera.pan += ang(my.pan - camera.pan) * time_step * 0.8; 
	camera.tilt -= 0.5 * mickey.y * time_step;
	camera.tilt = clamp(camera.tilt,-30,30);
	vec_set(cam_offset.x,vector(35,-25,40));
	vec_rotate(cam_offset.x,camera.pan);
	vec_add(cam_offset.x,my.x);
	cam_pos.x = cam_offset.x + fcos((camera.pan),fcos(camera.tilt,-100));
	cam_pos.y = cam_offset.y + fsin((camera.pan),fcos(camera.tilt,-100));
	cam_pos.z = cam_offset.z + fsin(camera.tilt,-100);


You can do this ^ if you wan to work that hard.. Funny fcos,fsin not in the manual anymore, must still be around for compatibility.


Posting a big block of code like this is hard to work with. Please now that we know your code pick direct questions from it and take them one at a time. Also you keep talking about Batman movement it would help me if you post a link to a video that show what you want to do. I have never played batman, don't really want to go fishing.

Last edited by Malice; 06/29/13 07:32.