//! returns the axis aligned bounding box of this node\r
const core::aabbox3d<f32>& CBillboardSceneNode::getBoundingBox() const\r
{\r
- // Really wrong when scaled.\r
+ // Really wrong when scaled (as the node does not scale it's vertices - maybe it should?)\r
return BBoxSafe;\r
}\r
\r
if (core::equals(Size.Height, 0.0f))\r
Size.Height = 1.0f;\r
\r
- const f32 avg = (Size.Width + Size.Height)/6;\r
- BBoxSafe.MinEdge.set(-avg,-avg,-avg);\r
- BBoxSafe.MaxEdge.set(avg,avg,avg);\r
+ const f32 extent = 0.5f*sqrt(Size.Width*Size.Width + Size.Height*Size.Height);\r
+ BBoxSafe.MinEdge.set(-extent,-extent,-extent);\r
+ BBoxSafe.MaxEdge.set(extent,extent,extent);\r
}\r
\r
\r
TopEdgeWidth = 1.0f;\r
}\r
\r
- const f32 avg = (core::max_(Size.Width,TopEdgeWidth) + Size.Height)/6;\r
- BBoxSafe.MinEdge.set(-avg,-avg,-avg);\r
- BBoxSafe.MaxEdge.set(avg,avg,avg);\r
+ const f32 extent = 0.5f*sqrt(Size.Width*Size.Width + Size.Height*Size.Height);\r
+ BBoxSafe.MinEdge.set(-extent,-extent,-extent);\r
+ BBoxSafe.MaxEdge.set(extent,extent,extent);\r
}\r
\r
\r