From 7a8fcb55f33db3f72a3639f39676ce4ccf8095a4 Mon Sep 17 00:00:00 2001 From: Bryce Hutchings Date: Mon, 27 May 2002 06:57:16 +0000 Subject: [PATCH] reflection byte function for sparks --- reaction/game/q_math.c | 12 ++++++++++++ reaction/game/q_shared.h | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/reaction/game/q_math.c b/reaction/game/q_math.c index 9927d1dc..5e9e46c9 100644 --- a/reaction/game/q_math.c +++ b/reaction/game/q_math.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.6 2002/05/27 06:55:02 niceass +// reflection byte function for sparks +// // Revision 1.5 2002/01/11 19:48:30 jbravo // Formatted the source in non DOS format. // @@ -1298,4 +1301,13 @@ void PerpendicularVector( vec3_t dst, const vec3_t src ) VectorNormalize( dst ); } +// By NiceAss. Used for reflection of sparks on metal surfaces +int ReflectVectorByte(vec3_t dir, vec3_t plane) { + vec3_t final; + float dot; + dot = DotProduct( dir, plane ); + VectorMA( dir, -2*dot, plane, final ); + + return DirToByte(final); +} \ No newline at end of file diff --git a/reaction/game/q_shared.h b/reaction/game/q_shared.h index db6e2a64..5665622c 100644 --- a/reaction/game/q_shared.h +++ b/reaction/game/q_shared.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.8 2002/05/27 06:57:16 niceass +// reflection byte function for sparks +// // Revision 1.7 2002/01/11 19:48:30 jbravo // Formatted the source in non DOS format. // @@ -765,7 +768,7 @@ void MakeNormalVectors( const vec3_t forward, vec3_t right, vec3_t up ); void MatrixMultiply(float in1[3][3], float in2[3][3], float out[3][3]); void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); void PerpendicularVector( vec3_t dst, const vec3_t src ); - +int ReflectVectorByte(vec3_t dir, vec3_t plane); //=============================================