vectormath2bullet.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef AOS_VECTORMATH_BULLET_CONVERT_H
00031 #define AOS_VECTORMATH_BULLET_CONVERT_H
00032
00033
00035 #if defined(__CELLOS_LV2__) || defined (USE_SYSTEM_VECTORMATH)
00036 #include <vectormath_aos.h>
00037 #else
00038 #include "BulletMultiThreaded/vectormath/scalar/cpp/vectormath_aos.h"
00039 #endif
00040
00041 #include "LinearMath/btVector3.h"
00042 #include "LinearMath/btQuaternion.h"
00043 #include "LinearMath/btMatrix3x3.h"
00044
00045 inline Vectormath::Aos::Vector3 getVmVector3(const btVector3& bulletVec)
00046 {
00047 return Vectormath::Aos::Vector3(bulletVec.getX(),bulletVec.getY(),bulletVec.getZ());
00048 }
00049
00050 inline btVector3 getBtVector3(const Vectormath::Aos::Vector3& vmVec)
00051 {
00052 return btVector3(vmVec.getX(),vmVec.getY(),vmVec.getZ());
00053 }
00054 inline btVector3 getBtVector3(const Vectormath::Aos::Point3& vmVec)
00055 {
00056 return btVector3(vmVec.getX(),vmVec.getY(),vmVec.getZ());
00057 }
00058
00059 inline Vectormath::Aos::Quat getVmQuat(const btQuaternion& bulletQuat)
00060 {
00061 Vectormath::Aos::Quat vmQuat(bulletQuat.getX(),bulletQuat.getY(),bulletQuat.getZ(),bulletQuat.getW());
00062 return vmQuat;
00063 }
00064
00065 inline btQuaternion getBtQuat(const Vectormath::Aos::Quat& vmQuat)
00066 {
00067 return btQuaternion (vmQuat.getX(),vmQuat.getY(),vmQuat.getZ(),vmQuat.getW());
00068 }
00069
00070 inline Vectormath::Aos::Matrix3 getVmMatrix3(const btMatrix3x3& btMat)
00071 {
00072 Vectormath::Aos::Matrix3 mat(
00073 getVmVector3(btMat.getColumn(0)),
00074 getVmVector3(btMat.getColumn(1)),
00075 getVmVector3(btMat.getColumn(2)));
00076 return mat;
00077 }
00078
00079
00080 #endif //AOS_VECTORMATH_BULLET_CONVERT_H