mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-22 09:56:22 +01:00
public: mathlib: fix incorrect usage of DotProductAbs, it will give the integer result, while float is expected
This commit is contained in:
parent
fa6f564c12
commit
b7ed779f71
@ -210,9 +210,9 @@ void Matrix3x4_TransformAABB( const matrix3x4 world, const vec3_t mins, const ve
|
|||||||
VectorSubtract( maxs, localCenter, localExtents );
|
VectorSubtract( maxs, localCenter, localExtents );
|
||||||
|
|
||||||
Matrix3x4_VectorTransform( world, localCenter, worldCenter );
|
Matrix3x4_VectorTransform( world, localCenter, worldCenter );
|
||||||
worldExtents[0] = DotProductAbs( localExtents, world[0] ); // auto-transposed!
|
worldExtents[0] = DotProductFabs( localExtents, world[0] ); // auto-transposed!
|
||||||
worldExtents[1] = DotProductAbs( localExtents, world[1] );
|
worldExtents[1] = DotProductFabs( localExtents, world[1] );
|
||||||
worldExtents[2] = DotProductAbs( localExtents, world[2] );
|
worldExtents[2] = DotProductFabs( localExtents, world[2] );
|
||||||
|
|
||||||
VectorSubtract( worldCenter, worldExtents, absmin );
|
VectorSubtract( worldCenter, worldExtents, absmin );
|
||||||
VectorAdd( worldCenter, worldExtents, absmax );
|
VectorAdd( worldCenter, worldExtents, absmax );
|
||||||
|
@ -85,7 +85,6 @@ CONSTANTS AND HELPER MACROS
|
|||||||
|
|
||||||
#define VectorIsNAN(v) (IS_NAN(v[0]) || IS_NAN(v[1]) || IS_NAN(v[2]))
|
#define VectorIsNAN(v) (IS_NAN(v[0]) || IS_NAN(v[1]) || IS_NAN(v[2]))
|
||||||
#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
|
#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
|
||||||
#define DotProductAbs(x,y) (abs((x)[0]*(y)[0])+abs((x)[1]*(y)[1])+abs((x)[2]*(y)[2]))
|
|
||||||
#define DotProductFabs(x,y) (fabs((x)[0]*(y)[0])+fabs((x)[1]*(y)[1])+fabs((x)[2]*(y)[2]))
|
#define DotProductFabs(x,y) (fabs((x)[0]*(y)[0])+fabs((x)[1]*(y)[1])+fabs((x)[2]*(y)[2]))
|
||||||
#define DotProductPrecise(x,y) ((double)(x)[0]*(double)(y)[0]+(double)(x)[1]*(double)(y)[1]+(double)(x)[2]*(double)(y)[2])
|
#define DotProductPrecise(x,y) ((double)(x)[0]*(double)(y)[0]+(double)(x)[1]*(double)(y)[1]+(double)(x)[2]*(double)(y)[2])
|
||||||
#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0])
|
#define CrossProduct(a,b,c) ((c)[0]=(a)[1]*(b)[2]-(a)[2]*(b)[1],(c)[1]=(a)[2]*(b)[0]-(a)[0]*(b)[2],(c)[2]=(a)[0]*(b)[1]-(a)[1]*(b)[0])
|
||||||
|
Loading…
Reference in New Issue
Block a user