diff --git a/include/ISceneNode.h b/include/ISceneNode.h index 18c5bff8..ef7b0c63 100644 --- a/include/ISceneNode.h +++ b/include/ISceneNode.h @@ -190,17 +190,17 @@ namespace scene return box; } - //! Get a the 8 corners of the original bounding box transformed and - //! animated by the absolute transformation. + //! Get a the 8 corners of the original bounding box transformed 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 void getTransformedBoundingBoxEdges(core::array< core::vector3d >& edges) const + but getting an aabbox3d of these corners would then be identical. + \param corners Receives an array with the transformed corners */ + virtual void getTransformedBoundingBoxEdges(core::array< core::vector3d >& corners) const { - edges.set_used(8); - getBoundingBox().getEdges( edges.pointer() ); + corners.set_used(8); + getBoundingBox().getEdges( corners.pointer() ); for ( u32 i=0; i<8; ++i ) - AbsoluteTransformation.transformVect( edges[i] ); + AbsoluteTransformation.transformVect( corners[i] ); } //! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call. diff --git a/include/aabbox3d.h b/include/aabbox3d.h index 78bdee38..7d143d54 100644 --- a/include/aabbox3d.h +++ b/include/aabbox3d.h @@ -145,15 +145,15 @@ class aabbox3d return 2*(e.X*e.Y + e.X*e.Z + e.Y*e.Z); } - //! Stores all 8 edges of the box into an array - /** \param edges: Pointer to array of 8 edges. */ - void getEdges(vector3d *edges) const + //! Stores all 8 corners of the box into an array + /** \param corners: Pointer to array of 8 corners. */ + void getEdges(vector3d *corners) const { const core::vector3d middle = getCenter(); const core::vector3d diag = middle - MaxEdge; /* - Edges are stored in this way: + Corners are stored in this way: Hey, am I an ascii artist, or what? :) niko. /3--------/7 / | / | @@ -165,14 +165,14 @@ class aabbox3d 0---------4/ */ - edges[0].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z + diag.Z); - edges[1].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z + diag.Z); - edges[2].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z - diag.Z); - edges[3].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z - diag.Z); - edges[4].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z + diag.Z); - edges[5].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z + diag.Z); - edges[6].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z - diag.Z); - edges[7].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z - diag.Z); + corners[0].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z + diag.Z); + corners[1].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z + diag.Z); + corners[2].set(middle.X + diag.X, middle.Y + diag.Y, middle.Z - diag.Z); + corners[3].set(middle.X + diag.X, middle.Y - diag.Y, middle.Z - diag.Z); + corners[4].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z + diag.Z); + corners[5].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z + diag.Z); + corners[6].set(middle.X - diag.X, middle.Y + diag.Y, middle.Z - diag.Z); + corners[7].set(middle.X - diag.X, middle.Y - diag.Y, middle.Z - diag.Z); } //! Repairs the box.