Game Development Reference
In-Depth Information
const Color &diffuseColor,
const Mat4x4 *to,
const Mat4x4 *from=NULL)
{
m_pParent= NULL;
m_Props.m_ActorId = actorId;
m_Props.m_Name = name;
m_Props.m_RenderPass = renderPass;
m_Props.m_AlphaType = AlphaOpaque;
VSetTransform(to, from);
SetRadius(0);
m_Props.m_Material.SetDiffuse(diffuseColor);
}
virtual ~SceneNode();
virtual const SceneNodeProperties * const VGet() const { return &m_Props; }
virtual void VSetTransform(
const Mat4x4 *toWorld, const Mat4x4 *fromWorld=NULL);
virtual HRESULT VOnRestore(Scene *pScene);
virtual HRESULT VOnUpdate(Scene *, DWORD const elapsedMs);
virtual HRESULT VPreRender(Scene *pScene);
virtual bool VIsVisible(Scene *pScene) const;
virtual HRESULT VRender(Scene *pScene) { return S_OK; }
virtual HRESULT VRenderChildren(Scene *pScene);
virtual HRESULT VPostRender(Scene *pScene);
virtual bool VAddChild(shared_ptr<ISceneNode> kid);
virtual bool VRemoveChild(ActorId id);
void SetAlpha(float alpha) { m_Props.SetAlpha(alpha); }
float GetAlpha() const { return m_Props.Alpha(); }
Vec3 GetPosition() const { return m_Props.m_ToWorld.GetPosition(); }
void SetPosition(const Vec3 &pos) { m_Props.m_ToWorld.SetPosition(pos); }
Vec3 GetDirection(const Vec3 &pos) const
{ return m_Props.m_ToWorld.GetDirection (pos); }
void SetRadius(const float radius) { m_Props.m_Radius = radius; }
void SetMaterial(const Material &mat) { m_Props.m_Material = mat; }
};
Every scene node has an STL vector<> of scene nodes attached to it. These child
nodes, child nodes of child nodes, and so on create the scene graph hierarchy. Most
Search WWH ::




Custom Search