mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
collision shape scale fix
This commit is contained in:
parent
21b8456453
commit
5aabf22c16
@ -210,12 +210,13 @@ namespace Physic
|
|||||||
delete mShapeLoader;
|
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
|
//get the shape from the .nif
|
||||||
mShapeLoader->load(mesh,"General");
|
mShapeLoader->load(mesh,"General");
|
||||||
BulletShapeManager::getSingletonPtr()->load(mesh,"General");
|
BulletShapeManager::getSingletonPtr()->load(mesh,"General");
|
||||||
BulletShapePtr shape = BulletShapeManager::getSingleton().getByName(mesh,"General");
|
BulletShapePtr shape = BulletShapeManager::getSingleton().getByName(mesh,"General");
|
||||||
|
shape->Shape->setLocalScaling(btVector3(scale,scale,scale));
|
||||||
|
|
||||||
//create the motionState
|
//create the motionState
|
||||||
CMotionState* newMotionState = new CMotionState(this,name);
|
CMotionState* newMotionState = new CMotionState(this,name);
|
||||||
|
@ -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,
|
* 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.
|
* 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
|
* Add a RigidBody to the simulation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user