|
|
|
@ -63,7 +63,9 @@ namespace CSVWorld
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// normal delete (e.g closing a scene subview)
|
|
|
|
|
// normal delete (e.g closing a scene subview or ~Object())
|
|
|
|
|
// the scene node is destroyed so the mappings should be removed
|
|
|
|
|
//
|
|
|
|
|
// TODO: should think about using some kind of reference counting within RigidBody
|
|
|
|
|
void PhysicsSystem::removeObject(const std::string &sceneNodeName)
|
|
|
|
|
{
|
|
|
|
@ -114,6 +116,25 @@ namespace CSVWorld
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Object::clear() is called when reference data is changed. It clears all
|
|
|
|
|
// contents of the SceneNode and removes the physics object
|
|
|
|
|
//
|
|
|
|
|
// A new physics object will be created and assigned to this sceneNodeName by
|
|
|
|
|
// Object::update()
|
|
|
|
|
void PhysicsSystem::removePhysicsObject(const std::string &sceneNodeName)
|
|
|
|
|
{
|
|
|
|
|
std::string referenceId = mSceneNodeToRefId[sceneNodeName];
|
|
|
|
|
|
|
|
|
|
if(referenceId != "")
|
|
|
|
|
{
|
|
|
|
|
if(mRefIdToSceneNode.find(referenceId) == mRefIdToSceneNode.end())
|
|
|
|
|
{
|
|
|
|
|
mEngine->removeRigidBody(referenceId);
|
|
|
|
|
mEngine->deleteRigidBody(referenceId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PhysicsSystem::replaceObject(const std::string &sceneNodeName, float scale,
|
|
|
|
|
const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, bool placeable)
|
|
|
|
|
{
|
|
|
|
|