Game Development Reference
In-Depth Information
{
friend class SceneNode;
protected:
ActorId
m_ActorId;
std::string
m_Name;
Mat4x4
m_ToWorld, m_FromWorld;
float
m_Radius;
RenderPass
m_RenderPass;
Material
m_Material;
AlphaType
m_AlphaType;
void SetAlpha(const float alpha)
{ m_AlphaType=AlphaMaterial; m_Material.SetAlpha(alpha); }
public:
const ActorId &ActorId() const { return m_ActorId; }
Mat4x4 const &ToWorld() const { return m_ToWorld; }
Mat4x4 const &FromWorld() const { return m_FromWorld; }
void Transform(Mat4x4 *toWorld, Mat4x4 *fromWorld) const;
const char * Name() const { return m_Name.c_str(); }
bool HasAlpha() const { return m_Material.HasAlpha(); }
virtual float Alpha() const { return m_Material.GetAlpha(); }
RenderPass RenderPass() const { return m_RenderPass; }
float Radius() const { return m_Radius; }
Material const &GetMaterial() const { return m_Material; }
};
void SceneNodeProperties::Transform(Mat4x4 *toWorld, Mat4x4 *fromWorld) const
{
if (toWorld)
*toWorld = m_ToWorld;
if (fromWorld)
*fromWorld = m_FromWorld;
}
All of the accessors to this class are const , which gives the read-only access I
wanted. The implementation of SceneNode will perform all of the modifying,
which is important since modifying some of these values can have repercussions
throughout the scene graph.
Search WWH ::




Custom Search