forked from mirror/openmw-tes3mp
Made some recommended changes
This commit is contained in:
parent
042bceb547
commit
f4e7bd6dfd
10 changed files with 24 additions and 20 deletions
|
@ -36,7 +36,7 @@ namespace MWClass
|
|||
MWRender::Rendering rendering (cellRender, ref->ref, ref->mData);
|
||||
cellRender.insertMesh("meshes\\" + model);
|
||||
cellRender.insertActorPhysics();
|
||||
ref->mData.setHandle (rendering.end (ref->mData.isEnabled()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,15 +30,14 @@ namespace MWClass
|
|||
}
|
||||
}
|
||||
|
||||
void Lockpick::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const
|
||||
void Lockpick::insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const
|
||||
{
|
||||
ESMS::LiveCellRef<ESM::Tool, MWWorld::RefData> *ref =
|
||||
ptr.get<ESM::Tool>();
|
||||
|
||||
assert (ref->base != NULL);
|
||||
std::string handle = ptr.getRefData().getHandle();
|
||||
if(!handle.empty()){
|
||||
physics.insertObjectPhysics(handle);
|
||||
if(ptr.getRefData().getBaseNode()){
|
||||
physics.insertObjectPhysics(ptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace MWClass
|
|||
virtual void insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||
///< Add reference into a cell for rendering
|
||||
|
||||
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics) const;
|
||||
virtual void insertObject(const MWWorld::Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||
|
||||
virtual std::string getName (const MWWorld::Ptr& ptr) const;
|
||||
///< \return name (the one that is to be presented to the user; not the internal one);
|
||||
|
|
|
@ -85,10 +85,10 @@ MWRender::Player& RenderingManager::getPlayer(){
|
|||
void RenderingManager::removeCell (MWWorld::Ptr::CellStore *store){
|
||||
|
||||
}
|
||||
void RenderingManager::addObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store){
|
||||
void RenderingManager::addObject (const MWWorld::Ptr& ptr){
|
||||
|
||||
}
|
||||
void RenderingManager::removeObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store){
|
||||
void RenderingManager::removeObject (const MWWorld::Ptr& ptr){
|
||||
|
||||
}
|
||||
void RenderingManager::moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position){
|
||||
|
|
|
@ -57,12 +57,14 @@ class RenderingManager: private RenderingInterface {
|
|||
|
||||
void removeCell (MWWorld::Ptr::CellStore *store); // TODO do we want this?
|
||||
|
||||
void addObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store);
|
||||
void removeObject (const MWWorld::Ptr& ptr, MWWorld::Ptr::CellStore *store);
|
||||
void addObject (const MWWorld::Ptr& ptr);
|
||||
void removeObject (const MWWorld::Ptr& ptr);
|
||||
|
||||
void moveObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& position);
|
||||
void scaleObject (const MWWorld::Ptr& ptr, const Ogre::Vector3& scale);
|
||||
void rotateObject (const MWWorld::Ptr& ptr, const::Ogre::Quaternion& orientation);
|
||||
|
||||
/// \param store Cell the object was in previously (\a ptr has already been updated to the new cell).
|
||||
void moveObjectToCell (const MWWorld::Ptr& ptr, const Ogre::Vector3& position, MWWorld::Ptr::CellStore *store);
|
||||
|
||||
void setPhysicsDebugRendering (bool);
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MWWorld
|
|||
{
|
||||
|
||||
}
|
||||
void Class::insertObject(const Ptr& ptr, MWWorld::PhysicsSystem& physics) const{
|
||||
void Class::insertObject(const Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace MWWorld
|
|||
|
||||
|
||||
virtual void insertObjectRendering (const Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const;
|
||||
virtual void insertObject(const Ptr& ptr, MWWorld::PhysicsSystem& physics) const;
|
||||
virtual void insertObject(const Ptr& ptr, MWWorld::PhysicsSystem& physics, MWWorld::Environment& environment) const;
|
||||
///< Add reference into a cell for rendering (default implementation: don't render anything).
|
||||
|
||||
virtual void enable (const Ptr& ptr, MWWorld::Environment& environment) const;
|
||||
|
|
|
@ -183,15 +183,15 @@ namespace MWWorld
|
|||
throw std::logic_error ("can't find player");
|
||||
}
|
||||
|
||||
void PhysicsSystem::insertObjectPhysics(const std::string& handle){
|
||||
Ogre::SceneNode* node = mRender.getScene()->getSceneNode(handle);
|
||||
addObject (handle, handle, node->getOrientation(),
|
||||
void PhysicsSystem::insertObjectPhysics(const MWWorld::Ptr& ptr){
|
||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
||||
addObject (node->getName(), node->getName(), node->getOrientation(),
|
||||
node->getScale().x, node->getPosition());
|
||||
}
|
||||
|
||||
void PhysicsSystem::insertActorPhysics(const std::string& handle){
|
||||
Ogre::SceneNode* node = mRender.getScene()->getSceneNode(handle);
|
||||
addActor (handle, handle, node->getPosition());
|
||||
void PhysicsSystem::insertActorPhysics(const MWWorld::Ptr& ptr){
|
||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
||||
addActor (node->getName(), node->getName(), node->getPosition());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ namespace MWWorld
|
|||
bool toggleCollisionMode();
|
||||
std::pair<std::string, float> getFacedHandle (MWWorld::World& world);
|
||||
|
||||
void insertObjectPhysics(const std::string& handle);
|
||||
void insertObjectPhysics(const MWWorld::Ptr& ptr);
|
||||
|
||||
void insertActorPhysics(const std::string& handle);
|
||||
void insertActorPhysics(const MWWorld::Ptr& ptr);
|
||||
|
||||
private:
|
||||
OEngine::Render::OgreRenderer &mRender;
|
||||
|
|
|
@ -55,6 +55,9 @@ namespace MWWorld
|
|||
{
|
||||
return mBaseNode->getName();
|
||||
}
|
||||
Ogre::SceneNode* getBaseNode(){
|
||||
return mBaseNode;
|
||||
}
|
||||
void setBaseNode(Ogre::SceneNode* base){
|
||||
mBaseNode = base;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue