Re: [GD-General] C style math libraries versus "proper" C++ maths
Brought to you by:
vexxed72
From: Richard F. <ra...@de...> - 2006-03-26 12:22:27
|
Thanks for the help, the C++ library is now marginally faster than the C library, and now i can approve it for general use at our company. I'm gonna love being able to change my code from: Vector relativeStart, lineDirection; VectorSubtract( &relativeStart, pos, lineStart ); VectorSubtract( &lineDirection, lineEnd, lineStart ); F32 lineLength =3D VectorLength( lineDirection ); VectorMultiply( &lineDirection, 1.0f / lineLength ); to: Vec3 relativeStart( pos - lineStart ), lineDirection( lineEnd - lineStart ); F32 lineLength =3D lineDirection.GetLength(); lineDirection /=3D lineLength; thanks again guys |