diff --git a/changes.txt b/changes.txt index 6093285b..ca62b2a9 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,7 @@ Changes in 1.8 (??.0?.2010) + - Add function to SViewFrustum to get corners of the near plane (patch provided by Matt Kline, aka slavik262) + - ParticleFadeOutAffector::setFadeOutTime can no longer be set to invalid values - ParticleFadeOutAffector uses now throughout u32 for fadeOutTime (found by greenya) diff --git a/include/SViewFrustum.h b/include/SViewFrustum.h index 6c97c26f..d2972d43 100644 --- a/include/SViewFrustum.h +++ b/include/SViewFrustum.h @@ -72,6 +72,18 @@ namespace scene //! returns the point which is on the far right bottom corner inside the the view frustum. core::vector3df getFarRightDown() const; + //! returns the point which is on the near left upper corner inside the the view frustum. + core::vector3df getNearLeftUp() const; + + //! returns the point which is on the near left bottom corner inside the the view frustum. + core::vector3df getNearLeftDown() const; + + //! returns the point which is on the near right top corner inside the the view frustum. + core::vector3df getNearRightUp() const; + + //! returns the point which is on the near right bottom corner inside the the view frustum. + core::vector3df getNearRightDown() const; + //! returns a bounding box enclosing the whole view frustum const core::aabbox3d &getBoundingBox() const; @@ -183,6 +195,46 @@ namespace scene return p; } + inline core::vector3df SViewFrustum::getNearLeftUp() const + { + core::vector3df p; + planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( + planes[scene::SViewFrustum::VF_TOP_PLANE], + planes[scene::SViewFrustum::VF_LEFT_PLANE], p); + + return p; + } + + inline core::vector3df SViewFrustum::getNearLeftDown() const + { + core::vector3df p; + planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( + planes[scene::SViewFrustum::VF_BOTTOM_PLANE], + planes[scene::SViewFrustum::VF_LEFT_PLANE], p); + + return p; + } + + inline core::vector3df SViewFrustum::getNearRightUp() const + { + core::vector3df p; + planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( + planes[scene::SViewFrustum::VF_TOP_PLANE], + planes[scene::SViewFrustum::VF_RIGHT_PLANE], p); + + return p; + } + + inline core::vector3df SViewFrustum::getNearRightDown() const + { + core::vector3df p; + planes[scene::SViewFrustum::VF_NEAR_PLANE].getIntersectionWithPlanes( + planes[scene::SViewFrustum::VF_BOTTOM_PLANE], + planes[scene::SViewFrustum::VF_RIGHT_PLANE], p); + + return p; + } + inline const core::aabbox3d &SViewFrustum::getBoundingBox() const { return boundingBox; @@ -296,13 +348,13 @@ namespace scene { if (planes[i].classifyPointRelation(line.start) == core::ISREL3D_FRONT) { - line.start = line.start.getInterpolated(line.end, + line.start = line.start.getInterpolated(line.end, planes[i].getKnownIntersectionWithLine(line.start, line.end)); wasClipped = true; } if (planes[i].classifyPointRelation(line.end) == core::ISREL3D_FRONT) { - line.end = line.start.getInterpolated(line.end, + line.end = line.start.getInterpolated(line.end, planes[i].getKnownIntersectionWithLine(line.start, line.end)); wasClipped = true; }