Game Development Reference
In-Depth Information
HRESULT OnRender();
HRESULT OnRestore();
HRESULT OnLostDevice();
HRESULT OnUpdate(const int deltaMilliseconds);
shared_ptr<ISceneNode> FindActor(ActorId id);
bool AddChild(ActorId id, shared_ptr<ISceneNode> kid)
{
if (id.valid())
{
// This allows us to search for this later based on actor id
m_ActorMap[*id] = kid;
}
shared_ptr<LightNode> pLight = dynamic_pointer_cast<LightNode>(kid);
if (pLight != NULL &&
m_LightManager->m_Lights.size()+1 < MAXIMUM_LIGHTS_SUPPORTED)
{
m_LightManager->m_Lights.push_back(pLight);
}
return m_Root->VAddChild(kid);
}
bool RemoveChild(ActorId id)
{
if (id == INVALID_ACTOR_ID)
return false;
shared_ptr<ISceneNode> kid = FindActor(id);
shared_ptr<LightNode> pLight = dynamic_pointer_cast<LightNode>(kid);
if (pLight != NULL)
m_LightManager->m_Lights.remove(pLight);
m_ActorMap.erase(id);
return m_Root->VRemoveChild(id);
}
// Camera accessor / modifier
void SetCamera(shared_ptr<CameraNode> camera) { m_Camera = camera; }
const shared_ptr<CameraNode> GetCamera() const { return m_Camera; }
void PushAndSetMatrix(const Mat4x4 &toWorld);
void PopMatrix()
const Mat4x4 *GetTopMatrix() ;
LightManager *GetLightManager() { return m_LightManager; }
Search WWH ::




Custom Search