Update comments about getEdges (it's about corners...)

Wish I could rename those functions, but that breaks a bit too much. So at least document that getEdges is about getting corners and not about getting edges.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6590 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2024-01-29 15:41:42 +00:00
parent 67fa713038
commit 2d880e4cfe
2 changed files with 20 additions and 20 deletions

View File

@ -190,17 +190,17 @@ namespace scene
return box; return box;
} }
//! Get a the 8 corners of the original bounding box transformed and //! Get a the 8 corners of the original bounding box transformed by the
//! animated by the absolute transformation. //! absolute transformation.
/** Note: The result is _not_ identical to getTransformedBoundingBox().getEdges(), /** Note: The result is _not_ identical to getTransformedBoundingBox().getEdges(),
but getting an aabbox3d of these edges would then be identical. but getting an aabbox3d of these corners would then be identical.
\param edges Receives an array with the transformed edges */ \param corners Receives an array with the transformed corners */
virtual void getTransformedBoundingBoxEdges(core::array< core::vector3d<f32> >& edges) const virtual void getTransformedBoundingBoxEdges(core::array< core::vector3d<f32> >& corners) const
{ {
edges.set_used(8); corners.set_used(8);
getBoundingBox().getEdges( edges.pointer() ); getBoundingBox().getEdges( corners.pointer() );
for ( u32 i=0; i<8; ++i ) 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. //! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.

View File

@ -145,15 +145,15 @@ class aabbox3d
return 2*(e.X*e.Y + e.X*e.Z + e.Y*e.Z); return 2*(e.X*e.Y + e.X*e.Z + e.Y*e.Z);
} }
//! Stores all 8 edges of the box into an array //! Stores all 8 corners of the box into an array
/** \param edges: Pointer to array of 8 edges. */ /** \param corners: Pointer to array of 8 corners. */
void getEdges(vector3d<T> *edges) const void getEdges(vector3d<T> *corners) const
{ {
const core::vector3d<T> middle = getCenter(); const core::vector3d<T> middle = getCenter();
const core::vector3d<T> diag = middle - MaxEdge; const core::vector3d<T> diag = middle - MaxEdge;
/* /*
Edges are stored in this way: Corners are stored in this way:
Hey, am I an ascii artist, or what? :) niko. Hey, am I an ascii artist, or what? :) niko.
/3--------/7 /3--------/7
/ | / | / | / |
@ -165,14 +165,14 @@ class aabbox3d
0---------4/ 0---------4/
*/ */
edges[0].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);
edges[1].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);
edges[2].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);
edges[3].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);
edges[4].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);
edges[5].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);
edges[6].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);
edges[7].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. //! Repairs the box.