Fixed bug 3017433, billboard text node should generate stuff in OnAnimate, not OnRegisterSceneNode

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3591 dfc29bdd-3216-0410-991c-e03cc46cb475
master
bitplane 2011-02-06 04:49:26 +00:00
parent 62c41e4d3e
commit 128d1e8fe8
2 changed files with 13 additions and 6 deletions

View File

@ -236,7 +236,7 @@ void CBillboardTextSceneNode::setText(const wchar_t* text)
//! pre render event
void CBillboardTextSceneNode::OnRegisterSceneNode()
void CBillboardTextSceneNode::OnAnimate(u32 timeMs)
{
if (!IsVisible || !Font || !Mesh)
return;
@ -256,7 +256,7 @@ void CBillboardTextSceneNode::OnRegisterSceneNode()
if (textLength<0.0f)
textLength=1.0f;
// const core::matrix4 &m = camera->getViewFrustum()->Matrices[ video::ETS_VIEW ];
//const core::matrix4 &m = camera->getViewFrustum()->Matrices[ video::ETS_VIEW ];
// make billboard look to camera
core::vector3df pos = getAbsolutePosition();
@ -319,7 +319,10 @@ void CBillboardTextSceneNode::OnRegisterSceneNode()
BBox = Mesh->getBoundingBox();
core::matrix4 mat( getAbsoluteTransformation(), core::matrix4::EM4CONST_INVERSE );
mat.transformBoxEx(BBox);
}
void CBillboardTextSceneNode::OnRegisterSceneNode()
{
SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT);
ISceneNode::OnRegisterSceneNode();
}

View File

@ -44,7 +44,7 @@ namespace scene
//! sets the color of the text
virtual void setTextColor(video::SColor color);
//! Returns type of the scene node
virtual ESCENE_NODE_TYPE getType() const { return ESNT_TEXT; }
@ -61,7 +61,7 @@ namespace scene
{
public:
CBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
CBillboardTextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
gui::IGUIFont* font,const wchar_t* text,
const core::vector3df& position, const core::dimension2d<f32>& size,
video::SColor colorTop, video::SColor shade_bottom);
@ -69,6 +69,10 @@ namespace scene
//! destructor
virtual ~CBillboardTextSceneNode();
//! sets the vertex positions etc
virtual void OnAnimate(u32 timeMs);
//! registers the node into the transparent pass
virtual void OnRegisterSceneNode();
//! renders the node.
@ -82,7 +86,7 @@ namespace scene
//! sets the color of the text
virtual void setTextColor(video::SColor color);
//! sets the size of the billboard
virtual void setSize(const core::dimension2d<f32>& size);
@ -90,7 +94,7 @@ namespace scene
virtual const core::dimension2d<f32>& getSize() const;
virtual video::SMaterial& getMaterial(u32 i);
//! returns amount of materials used by this scene node.
virtual u32 getMaterialCount() const;