mirror of https://github.com/axmolengine/axmol.git
revert ccplane
This commit is contained in:
parent
e0349ae975
commit
4d379ed9bd
|
@ -92,17 +92,4 @@ PointSide Plane::getSide(const Vec3& point) const
|
||||||
return PointSide::IN_PLANE;
|
return PointSide::IN_PLANE;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointSide Plane::getSide(const Vec3& point, const Vec3& tolerance) const
|
|
||||||
{
|
|
||||||
float dist = dist2Plane(point);
|
|
||||||
float maxAbsDist = fabs(_normal.x * tolerance.x) + fabs(_normal.y * tolerance.y) + fabs(_normal.z * tolerance.z);
|
|
||||||
|
|
||||||
if (dist > maxAbsDist)
|
|
||||||
return PointSide::FRONT_PLANE;
|
|
||||||
else if (dist < -maxAbsDist)
|
|
||||||
return PointSide::BEHIND_PLANE;
|
|
||||||
else
|
|
||||||
return PointSide::IN_PLANE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_CC_END
|
NS_CC_END
|
||||||
|
|
|
@ -100,11 +100,6 @@ public:
|
||||||
*/
|
*/
|
||||||
PointSide getSide(const Vec3& point) const;
|
PointSide getSide(const Vec3& point) const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the side where the point is.
|
|
||||||
*/
|
|
||||||
PointSide getSide(const Vec3& point, const Vec3& tolerance) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Vec3 _normal; // the normal line of the plane
|
Vec3 _normal; // the normal line of the plane
|
||||||
float _dist; // original displacement of the normal
|
float _dist; // original displacement of the normal
|
||||||
|
|
Loading…
Reference in New Issue