Add more transparent node sorting algorithms

Adding 2 algorithms to sort by distance to camera plane instead of camera position.
This is better in quite a few situations and extra cost is just one vector subtraction per node and an additional function parameter per call, I think that's worth it. So made the camera-plane to object-center now the new default.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6573 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2023-11-22 16:34:55 +00:00
parent 3c4ac201ce
commit 3752bd9bd4
4 changed files with 63 additions and 30 deletions

View File

@ -111,18 +111,24 @@ namespace scene
//! Which can be used to do some custom sorting via scene-graph (mainly useful if you only have to that once)
ETNS_NONE,
//! Distance from node origin to camera
//! Distance from node origin to camera position
ETNS_ORIGIN,
//! Distance from node center to camera
//! Distance from node center to camera position
ETNS_CENTER,
//! Distance from the nearest of the 2 transformed bounding-box extend corners to camera
ETNS_BBOX_EXTENTS,
//! Distance from node origin to camera plane
ETNS_PLANE_ORIGIN,
//! Distance from node center to camera plane
ETNS_PLANE_CENTER,
//! Default sorting Irrlicht uses currently
//! This may change in the future
ETNS_DEFAULT = ETNS_CENTER
ETNS_DEFAULT = ETNS_PLANE_CENTER
};
class IAnimatedMesh;