Fix billboard text scene nodes having wrong rotation when attached to a parent node (.e.g. a kart)
This commit is contained in:
parent
fb9dc7af74
commit
00e6e7bcc2
@ -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),
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user