Fix billboard text scene nodes having wrong rotation when attached to a parent node (.e.g. a kart)

This commit is contained in:
Marianne Gagnon 2014-08-03 20:17:11 -04:00
parent fb9dc7af74
commit 00e6e7bcc2
2 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,18 @@ STKTextBillboard::STKTextBillboard(core::stringw text, gui::ScalableFont* font,
updateAbsolutePosition();
}
void STKTextBillboard::updateAbsolutePosition()
{
if (Parent)
{
// Override to not use the parent's rotation
AbsoluteTransformation = getRelativeTransformation();
AbsoluteTransformation.setTranslation(AbsoluteTransformation.getTranslation() + Parent->getAbsolutePosition());
}
else
AbsoluteTransformation = getRelativeTransformation();
}
scene::IMesh* STKTextBillboard::getTextMesh(core::stringw text, gui::ScalableFont* font)
{
font->doDraw(text, core::rect<s32>(0, 0, 1000, 1000), video::SColor(255,255,255,255),

View File

@ -62,6 +62,8 @@ public:
const irr::core::rect<irr::s32>& destRect,
const irr::core::rect<irr::s32>& sourceRect,
const irr::video::SColor* const colors);
virtual void updateAbsolutePosition() OVERRIDE;
};
#endif