1 void _Movetype_Physics_Follow(entity this) // SV_Physics_Follow
3 entity e = this.move_aiment; // TODO: networking?
5 // LordHavoc: implemented rotation on MOVETYPE_FOLLOW objects
6 if(this.move_angles == this.move_punchangle)
8 this.move_origin = e.move_origin + this.view_ofs;
13 ang_x = -this.move_punchangle_x;
14 ang_y = this.move_punchangle_y;
15 ang_z = this.move_punchangle_z;
17 v_x = this.view_ofs_x * v_forward_x + this.view_ofs_y * v_right_x + this.view_ofs_z * v_up_x;
18 v_y = this.view_ofs_x * v_forward_y + this.view_ofs_y * v_right_y + this.view_ofs_z * v_up_y;
19 v_z = this.view_ofs_x * v_forward_z + this.view_ofs_y * v_right_z + this.view_ofs_z * v_up_z;
20 ang_x = -e.move_angles_x;
21 ang_y = e.move_angles_y;
22 ang_z = e.move_angles_z;
24 this.move_origin_x = v_x * v_forward_x + v_y * v_forward_y + v_z * v_forward_z + e.move_origin_x;
25 this.move_origin_x = v_x * v_right_x + v_y * v_right_y + v_z * v_right_z + e.move_origin_y;
26 this.move_origin_x = v_x * v_up_x + v_y * v_up_y + v_z * v_up_z + e.move_origin_z;
29 this.move_angles = e.move_angles + this.v_angle;
30 _Movetype_LinkEdict(this, false);