From 5aabf22c16dab6a2230845f90fe5fdf67eeeca32 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 2 Mar 2012 16:47:13 +0100 Subject: [PATCH] collision shape scale fix --- bullet/physic.cpp | 3 ++- bullet/physic.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bullet/physic.cpp b/bullet/physic.cpp index 294b37978..07bad3053 100644 --- a/bullet/physic.cpp +++ b/bullet/physic.cpp @@ -210,12 +210,13 @@ namespace Physic delete mShapeLoader; } - RigidBody* PhysicEngine::createRigidBody(std::string mesh,std::string name) + RigidBody* PhysicEngine::createRigidBody(std::string mesh,std::string name,float scale) { //get the shape from the .nif mShapeLoader->load(mesh,"General"); BulletShapeManager::getSingletonPtr()->load(mesh,"General"); BulletShapePtr shape = BulletShapeManager::getSingleton().getByName(mesh,"General"); + shape->Shape->setLocalScaling(btVector3(scale,scale,scale)); //create the motionState CMotionState* newMotionState = new CMotionState(this,name); diff --git a/bullet/physic.hpp b/bullet/physic.hpp index 750761965..88e3699ae 100644 --- a/bullet/physic.hpp +++ b/bullet/physic.hpp @@ -135,7 +135,7 @@ namespace Physic * Create a RigidBody.It does not add it to the simulation, but it does add it to the rigidBody Map, * so you can get it with the getRigidBody function. */ - RigidBody* createRigidBody(std::string mesh,std::string name); + RigidBody* createRigidBody(std::string mesh,std::string name,float scale); /** * Add a RigidBody to the simulation