mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-10 01:33:51 +01:00
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:
parent
67fa713038
commit
2d880e4cfe
@ -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<f32> >& 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<f32> >& 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.
|
||||
|
@ -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<T> *edges) const
|
||||
//! Stores all 8 corners of the box into an array
|
||||
/** \param corners: Pointer to array of 8 corners. */
|
||||
void getEdges(vector3d<T> *corners) const
|
||||
{
|
||||
const core::vector3d<T> middle = getCenter();
|
||||
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.
|
||||
/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.
|
||||
|
Loading…
Reference in New Issue
Block a user