From a492530c602c291de1b091e0239c115174a89448 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 9 Jul 2012 13:35:27 +0000 Subject: [PATCH] test: fix an alignment issue with btVector3/vec3 casts. --- test/Physics/EasyPhysics.cpp | 2 +- test/Physics/LolBtPhysicsIntegration.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Physics/EasyPhysics.cpp b/test/Physics/EasyPhysics.cpp index 20dd63fd..686b7095 100644 --- a/test/Physics/EasyPhysics.cpp +++ b/test/Physics/EasyPhysics.cpp @@ -129,7 +129,7 @@ void EasyPhysics::SetMass(float mass) if (m_rigid_body) { SetLocalInertia(m_mass); - m_rigid_body->setMassProps(mass, LOL2BT_VEC3(m_local_inertia)); + m_rigid_body->setMassProps(mass, m_local_inertia); } } diff --git a/test/Physics/LolBtPhysicsIntegration.h b/test/Physics/LolBtPhysicsIntegration.h index 85dc51c8..07f7f725 100644 --- a/test/Physics/LolBtPhysicsIntegration.h +++ b/test/Physics/LolBtPhysicsIntegration.h @@ -26,7 +26,7 @@ namespace lol #define LOL2BT_SIZE 0.5f #define BT2LOL_SIZE 2.0f -#define LOL2BT_VEC3(ELEMENT) (*(btVector3*)(&(ELEMENT))) +#define LOL2BT_VEC3(ELEMENT) btVector3((ELEMENT).x, (ELEMENT).y, (ELEMENT).z) #define BT2LOL_VEC3(ELEMENT) (*(lol::vec3*)(&(ELEMENT))) #define LOL2BT_QUAT(ELEMENT) btQuaternion((ELEMENT).x, (ELEMENT).y, (ELEMENT).z, (ELEMENT).w)