Workspace code for CurrentCamera
This commit is contained in:
parent
05788e557c
commit
bddfe3aba8
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
#include <App/V8/Tree/Instance.hpp>
|
||||
#include <App/V8/Tree/Model.hpp>
|
||||
|
||||
#include <OGRE/Ogre.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace RNR
|
||||
|
|
@ -14,9 +17,14 @@ namespace RNR
|
|||
|
||||
virtual void onChildAdded(RNR::Instance* childAdded);
|
||||
virtual void onChildRemoved(RNR::Instance* childRemoved);
|
||||
|
||||
Camera* getCurrentCamera() const;
|
||||
void setCurrentCamera(Camera *value);
|
||||
private:
|
||||
std::vector<Ogre::InstancedEntity*> m_objects;
|
||||
Ogre::InstanceManager* m_instMan;
|
||||
Ogre::SceneNode* m_worldspawn;
|
||||
|
||||
boost::shared_ptr<Camera> currentCamera;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include <App/V8/DataModel/Workspace.hpp>
|
||||
#include <App/V8/World/World.hpp>
|
||||
#include <App/V8/DataModel/BasePart.hpp>
|
||||
#include <App/V8/DataModel/Camera.hpp>
|
||||
|
||||
namespace RNR
|
||||
{
|
||||
|
|
@ -55,4 +56,19 @@ namespace RNR
|
|||
delete child_ent;
|
||||
}
|
||||
}
|
||||
|
||||
Camera* Workspace::getCurrentCamera() const
|
||||
{
|
||||
return currentCamera.get();
|
||||
}
|
||||
|
||||
void Workspace::setCurrentCamera(Camera *newCamera)
|
||||
{
|
||||
if (newCamera != currentCamera.get())
|
||||
{
|
||||
currentCamera = boost::shared_ptr<Camera>(newCamera);
|
||||
|
||||
// TODO: raise propertyChanged and currentCameraChangedSignal
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue