Commit 3a40f567 authored by cutealien's avatar cutealien

Add function ISceneNode::getTransformedBoundingBoxEdges.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4446 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 758c1ff0
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Add function ISceneNode::getTransformedBoundingBoxEdges.
- Improve automatic compiling under solaris (proposed by curaga) - Improve automatic compiling under solaris (proposed by curaga)
- Add in IGUICheckBox: setDrawBackground, isDrawBackgroundEnabled, setDrawBorder, isDrawBorderEnabled - Add in IGUICheckBox: setDrawBackground, isDrawBackgroundEnabled, setDrawBorder, isDrawBorderEnabled
- IGUISpinBox now passes on the EGET_BUTTON_CLICKED, EGET_EDITBOX_CHANGED and EGET_EDITBOX_ENTER events from it's sub-elements. - IGUISpinBox now passes on the EGET_BUTTON_CLICKED, EGET_EDITBOX_CHANGED and EGET_EDITBOX_ENTER events from it's sub-elements.
......
...@@ -174,7 +174,9 @@ namespace scene ...@@ -174,7 +174,9 @@ namespace scene
//! Get the axis aligned, transformed and animated absolute bounding box of this node. //! Get the axis aligned, transformed and animated absolute bounding box of this node.
/** \return The transformed bounding box. */ /** Note: The result is still an axis-aligned bounding box, so it's size
changes with rotation.
\return The transformed bounding box. */
virtual const core::aabbox3d<f32> getTransformedBoundingBox() const virtual const core::aabbox3d<f32> getTransformedBoundingBox() const
{ {
core::aabbox3d<f32> box = getBoundingBox(); core::aabbox3d<f32> box = getBoundingBox();
...@@ -182,6 +184,18 @@ namespace scene ...@@ -182,6 +184,18 @@ namespace scene
return box; return box;
} }
//! Get a the 8 corners of the original bounding box transformed and
//! animated by the absolute transformation.
/** Note: The result is _not_ identical to getTransformedBoundingBox().getEdges(),
but getting an aabbox3d of these edges would then be identical.
\param edges Receives an array with the transformed edges */
virtual const void getTransformedBoundingBoxEdges(core::array< core::vector3d<f32> >& edges) const
{
edges.set_used(8);
getBoundingBox().getEdges( edges.pointer() );
for ( u32 i=0; i<8; ++i )
AbsoluteTransformation.transformVect( edges[i] );
}
//! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call. //! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.
/** NOTE: For speed reasons the absolute transformation is not /** NOTE: For speed reasons the absolute transformation is not
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment