[Quake2world-dev] r638 - quake2world/trunk/src

jdolan at jdolan.dyndns.org jdolan at jdolan.dyndns.org
Sat Oct 3 13:17:10 UTC 2009


Author: jdolan
Date: 2009-10-03 13:17:10 +0000 (Sat, 03 Oct 2009)
New Revision: 638

Modified:
   quake2world/trunk/src/files.h
   quake2world/trunk/src/shared.c
   quake2world/trunk/src/shared.h
Log:
Minor cleanup.

Modified: quake2world/trunk/src/files.h
===================================================================
--- quake2world/trunk/src/files.h	2009-10-03 13:15:52 UTC (rev 637)
+++ quake2world/trunk/src/files.h	2009-10-03 13:17:10 UTC (rev 638)
@@ -43,8 +43,8 @@
 } dmd2triangle_t;
 
 typedef struct {
-	byte v[3];  // scaled byte to fit in frame mins/maxs
-	byte n;  // index in bytedirs, see anorms.h
+	byte v[3];  // vertex scaled to fit in frame mins/maxs
+	byte n;  // normal index into anorms.h
 } dmd2vertex_t;
 
 typedef struct {

Modified: quake2world/trunk/src/shared.c
===================================================================
--- quake2world/trunk/src/shared.c	2009-10-03 13:15:52 UTC (rev 637)
+++ quake2world/trunk/src/shared.c	2009-10-03 13:17:10 UTC (rev 638)
@@ -209,13 +209,13 @@
 
 
 /*
- * TangentVector
+ * TangentVectors
  *
  * Projects the normalized directional vectors on to the normal's plane.
  * The fourth component of the resulting tangent vector represents sidedness.
  */
-void TangentVectors(vec3_t normal, vec3_t sdir, vec3_t tdir,
-		vec4_t tangent, vec3_t binormal){
+void TangentVectors(const vec3_t normal, const vec3_t sdir, const vec3_t tdir,
+		vec4_t tangent, vec3_t bitangent){
 
 	vec3_t s, t;
 
@@ -231,14 +231,14 @@
 	VectorNormalize(tangent);
 
 	// resolve sidedness, encode as fourth tangent component
-	CrossProduct(normal, tangent, binormal);
+	CrossProduct(normal, tangent, bitangent);
 
-	if(DotProduct(t, binormal) < 0.0)
+	if(DotProduct(t, bitangent) < 0.0)
 		tangent[3] = -1.0;
 	else
 		tangent[3] = 1.0;
 
-	VectorScale(binormal, tangent[3], binormal);
+	VectorScale(bitangent, tangent[3], bitangent);
 }
 
 

Modified: quake2world/trunk/src/shared.h
===================================================================
--- quake2world/trunk/src/shared.h	2009-10-03 13:15:52 UTC (rev 637)
+++ quake2world/trunk/src/shared.h	2009-10-03 13:17:10 UTC (rev 638)
@@ -147,6 +147,7 @@
 #define VectorAdd(a,b,c)		(c[0]=a[0]+b[0],c[1]=a[1]+b[1],c[2]=a[2]+b[2])
 #define VectorScale(a,s,b)		(b[0]=a[0]*(s),b[1]=a[1]*(s),b[2]=a[2]*(s))
 #define VectorCopy(a,b)			(b[0]=a[0],b[1]=a[1],b[2]=a[2])
+#define Vector4Copy(a,b)		(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3])
 #define VectorClear(a)			(a[0]=a[1]=a[2]=0)
 #define VectorNegate(a,b)		(b[0]=-a[0],b[1]=-a[1],b[2]=-a[2])
 #define VectorSet(v, x, y, z)	(v[0]=(x), v[1]=(y), v[2]=(z))
@@ -196,7 +197,7 @@
 
 void ProjectPointOnPlane(vec3_t dst, const vec3_t p, const vec3_t normal);
 void PerpendicularVector(vec3_t dst, const vec3_t src);
-void TangentVectors(vec3_t normal, vec3_t sdir, vec3_t tdir, vec4_t tangent, vec3_t binormal);
+void TangentVectors(const vec3_t normal, const vec3_t sdir, const vec3_t tdir, vec4_t tangent, vec3_t bitangent);
 void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees);
 
 int Com_GlobMatchStar(const char *pattern, const char *text);



More information about the Quake2World-dev mailing list