public override void Update(GameTime gameTime)
{
base.Update(gameTime);
_drawableElement.WorldMatrix = ReferringEntity.WorldMatrix;
_drawableElement.Scale = ReferringEntity.Scale;
_drawableElement.GlobalPosition = ReferringEntity.GlobalPosition;
if (_drawableElement.Mesh != null)
{
if (IsBillboard)
{
var box = _drawableElement.Mesh.LocalBounds;
box.Min = box.Min * ReferringEntity.Scale;
box.Max = box.Max * ReferringEntity.Scale;
box.Min.X = MathHelper.Min(box.Min.X, box.Min.Z);
box.Min.Z = box.Min.X;
box.Max.X = MathHelper.Max(box.Max.X, box.Max.Z);
box.Max.Z = box.Max.X;
box.Min += ReferringEntity.GlobalPosition;
box.Max += ReferringEntity.GlobalPosition;
_drawableElement.BoundingBox = box;
}
else
{
_drawableElement.UpdateBounds();
}
}
}