diff options
Diffstat (limited to 'src/renderergl2')
-rw-r--r-- | src/renderergl2/tr_extramath.c | 7 | ||||
-rw-r--r-- | src/renderergl2/tr_extramath.h | 3 | ||||
-rw-r--r-- | src/renderergl2/tr_vbo.c | 15 |
3 files changed, 13 insertions, 12 deletions
diff --git a/src/renderergl2/tr_extramath.c b/src/renderergl2/tr_extramath.c index fe787ef1..84816a61 100644 --- a/src/renderergl2/tr_extramath.c +++ b/src/renderergl2/tr_extramath.c @@ -156,6 +156,13 @@ void Mat4SimpleInverse( const mat4_t in, mat4_t out) out[ 3] = 0.0f; out[ 7] = 0.0f; out[11] = 0.0f; out[15] = 1.0f; } +void VectorLerp( vec3_t a, vec3_t b, float lerp, vec3_t c) +{ + c[0] = a[0] * (1.0f - lerp) + b[0] * lerp; + c[1] = a[1] * (1.0f - lerp) + b[1] * lerp; + c[2] = a[2] * (1.0f - lerp) + b[2] * lerp; +} + qboolean SpheresIntersect(vec3_t origin1, float radius1, vec3_t origin2, float radius2) { float radiusSum = radius1 + radius2; diff --git a/src/renderergl2/tr_extramath.h b/src/renderergl2/tr_extramath.h index af7c3804..f1ea5767 100644 --- a/src/renderergl2/tr_extramath.h +++ b/src/renderergl2/tr_extramath.h @@ -77,6 +77,9 @@ static ID_INLINE int VectorCompare5(const vec5_t v1, const vec5_t v2) return 1; } +void VectorLerp( vec3_t a, vec3_t b, float lerp, vec3_t c); + + qboolean SpheresIntersect(vec3_t origin1, float radius1, vec3_t origin2, float radius2); void BoundingSphereOfSpheres(vec3_t origin1, float radius1, vec3_t origin2, float radius2, vec3_t origin3, float *radius3); diff --git a/src/renderergl2/tr_vbo.c b/src/renderergl2/tr_vbo.c index 8eb85d41..dc0f33be 100644 --- a/src/renderergl2/tr_vbo.c +++ b/src/renderergl2/tr_vbo.c @@ -559,14 +559,11 @@ R_CreateIBO2 IBO_t *R_CreateIBO2(const char *name, int numIndexes, glIndex_t * inIndexes, vboUsage_t usage) { IBO_t *ibo; - int i, j; + int i; glIndex_t *indexes; int indexesSize; - int indexesCount; - glIndex_t *tri; - glIndex_t index; int glUsage; switch (usage) @@ -605,16 +602,10 @@ IBO_t *R_CreateIBO2(const char *name, int numIndexes, glIndex_t * inInd indexesSize = numIndexes * sizeof(glIndex_t); indexes = ri.Hunk_AllocateTempMemory(indexesSize); - indexesCount = 0; - for(i = 0, tri = inIndexes; i < numIndexes; i += 3, tri += 3) + for(i = 0; i < numIndexes; i++) { - for(j = 0; j < 3; j++) - { - index = tri[j]; - memcpy(indexes + indexesOfs, &index, sizeof(glIndex_t)); - indexesOfs += sizeof(glIndex_t); - } + indexes[i] = inIndexes[i]; } ibo->indexesSize = indexesSize; |