Posted By: Gumby22don
bounce for c_trace - 05/22/09 04:41
Hi,
Could someone help me setting up a manual bounce calculation - only just realised the bounce isn't set by c_trace, only by c_move. normal is still set, and the following is my guess at how bounce is calculated, but my head hurts so I can't think :P
note tempGun is the speed of the fired weapon. so "speed" in the manual's decription.
Is this even remotely close to correct?
Thanks,
Don
have a great day
Could someone help me setting up a manual bounce calculation - only just realised the bounce isn't set by c_trace, only by c_move. normal is still set, and the following is my guess at how bounce is calculated, but my head hurts so I can't think :P
note tempGun is the speed of the fired weapon. so "speed" in the manual's decription.
Code:
//bounce = speed + 2*dot(normal,-speed)*normal, while speed = distance vector to target, normal = target surface normal. vec_set(tempV1, tempGun); vec_scale(tempV1, -1); tempV2 = vec_dot(normal, tempV1); vec_set(tempBounce, normal); vec_scale(tempBounce, tempV2 * 2); //new Bounce
Is this even remotely close to correct?
Thanks,
Don
have a great day