Files
assimp/include/aiVector3D.inl
aramis_acg 559daf900d NFF finished except cone implementation.
Added fixes by lynxeye to make assimp work with GCC 4.
Website - again a backup of the current version.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@130 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2008-09-11 20:50:15 +00:00

34 lines
1.1 KiB
C++

/** @file Inline implementation of vector3D operators */
#ifndef AI_VECTOR3D_INL_INC
#define AI_VECTOR3D_INL_INC
#include "aiVector3D.h"
#ifdef __cplusplus
#include "aiMatrix3x3.h"
#include "aiMatrix4x4.h"
/** Transformation of a vector by a 3x3 matrix */
inline aiVector3D operator * (const aiMatrix3x3& pMatrix, const aiVector3D& pVector)
{
aiVector3D res;
res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z;
res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z;
res.z = pMatrix.c1 * pVector.x + pMatrix.c2 * pVector.y + pMatrix.c3 * pVector.z;
return res;
}
/** Transformation of a vector by a 4x4 matrix */
inline aiVector3D operator * (const aiMatrix4x4& pMatrix, const aiVector3D& pVector)
{
aiVector3D res;
res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z + pMatrix.a4;
res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z + pMatrix.b4;
res.z = pMatrix.c1 * pVector.x + pMatrix.c2 * pVector.y + pMatrix.c3 * pVector.z + pMatrix.c4;
return res;
}
#endif // __cplusplus
#endif // AI_VECTOR3D_INL_INC