
11-23-2004, 11:14 PM
|
|
call me Chad, it's cooler
|
 |
Join Date: Aug 2002
Posts: 1,899
|
|
|
matrix of revolution
old_dx = vehicle_midx - middle_playerx
old_dy = vehilcle_midy - middle_playery
sin = sin(change_in_angle_of_car)
cos = cos(change_in_angle_of_car)
new_dx = old_dx*cos-old_dy*sin
new_dy = old_dy*cos+old_dx*sin
array = {-1,0, 1,0, -1,-1, 1,-1} holding the values of player position for each seat in car when car direction = 3 (theta = 0)
sin = sin(angle_of_car)
cos = cos(angle_of_car)
new_dx = array[player_pos_in_car*2]*cos-array[player_pos_in_car*2+1]*sin
new_dy = array[player_pos_in_car*2+1]*cos+array[player_pos_in_car*2]*sin
non-matrix of revolution
array = {1,pi/4, 1,3*pi/4} array of playerpos in car using polar coordinates
new_dx = array[player_pos_in_car*2]*cos(array[player_pos_in_car*2+1]+angle_of_car)
new_dy = array[player_pos_in_car*2]*sin(array[player_pos_in_car*2+1]+angle_of_car) |
|
|
|