multiply scale before construct physics

This commit is contained in:
yangxiao 2015-05-14 10:44:08 +08:00
parent e659373648
commit 5b8b4fed50
1 changed files with 3 additions and 0 deletions

View File

@ -695,6 +695,9 @@ bool Physics3DCollisionCallbackDemo::init()
float scale = 2.0f; float scale = 2.0f;
std::vector<Vec3> trianglesList = Bundle3D::getTrianglesList("Sprite3DTest/boss.c3b"); std::vector<Vec3> trianglesList = Bundle3D::getTrianglesList("Sprite3DTest/boss.c3b");
for (auto& it : trianglesList) {
it *= scale;
}
rbDes.mass = 0.0f; rbDes.mass = 0.0f;
rbDes.shape = Physics3DShape::createMesh(&trianglesList[0], (int)trianglesList.size() / 3); rbDes.shape = Physics3DShape::createMesh(&trianglesList[0], (int)trianglesList.size() / 3);