clean up billboard text code
This commit is contained in:
parent
986fd8050a
commit
024f6f3fee
@ -29,7 +29,6 @@ STKTextBillboard::STKTextBillboard(core::stringw text, gui::ScalableFont* font,
|
|||||||
createGLMeshes();
|
createGLMeshes();
|
||||||
Mesh->drop();
|
Mesh->drop();
|
||||||
//setAutomaticCulling(0);
|
//setAutomaticCulling(0);
|
||||||
setReloadEachFrame(true); // FIXME: should not need that!!
|
|
||||||
updateAbsolutePosition();
|
updateAbsolutePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,13 +156,14 @@ void STKTextBillboard::OnRegisterSceneNode()
|
|||||||
{
|
{
|
||||||
if (IsVisible)
|
if (IsVisible)
|
||||||
{
|
{
|
||||||
SceneManager->registerNodeForRendering(this, scene::ESNRP_TRANSPARENT);
|
SceneManager->registerNodeForRendering(this, scene::ESNRP_SOLID);
|
||||||
|
|
||||||
scene::ICameraSceneNode* curr_cam = irr_driver->getSceneManager()->getActiveCamera();
|
scene::ICameraSceneNode* curr_cam = irr_driver->getSceneManager()->getActiveCamera();
|
||||||
core::vector3df cam_pos = curr_cam->getPosition();
|
core::vector3df cam_pos = curr_cam->getPosition();
|
||||||
core::vector3df text_pos = this->getAbsolutePosition();
|
core::vector3df text_pos = this->getAbsolutePosition();
|
||||||
float angle = atan2(text_pos.X - cam_pos.X, text_pos.Z - cam_pos.Z);
|
float angle = atan2(text_pos.X - cam_pos.X, text_pos.Z - cam_pos.Z);
|
||||||
this->setRotation(core::vector3df(0.0f, angle * 180.0f / M_PI, 0.0f));
|
this->setRotation(core::vector3df(0.0f, angle * 180.0f / M_PI, 0.0f));
|
||||||
|
updateAbsolutePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
ISceneNode::OnRegisterSceneNode();
|
ISceneNode::OnRegisterSceneNode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user