Fixed several recursive header issues, refactored Math lib, began implementing core mathematical functions as wrappers around stdmath, will implement SSE and lookup tables later.
This commit is contained in:
@@ -333,13 +333,28 @@ namespace J3ML::Geometry
|
||||
@see ToPolyhedron(). */
|
||||
//PBVolume<6> ToPBVolume() const;
|
||||
|
||||
|
||||
Matrix4x4 ViewProjMatrix() const { return viewProjectionMatrix; }
|
||||
Matrix4x4 ComputeViewProjMatrix() const;
|
||||
|
||||
Vector3 Project(const Vector3& point) const {
|
||||
Vector4 projectedPoint = ViewProjMatrix().Mul(Vector4(point, 1.f));
|
||||
projectedPoint.NormalizeW();
|
||||
return projectedPoint.XYZ();
|
||||
}
|
||||
|
||||
/// Tests if the given object is fully contained inside this Frustum.
|
||||
/** This function returns true if the given object lies inside this Frustum, and false otherwise.
|
||||
@note The comparison is performed using less-or-equal, so the faces of this Frustum count as being inside, but
|
||||
due to float inaccuracies, this cannot generally be relied upon.
|
||||
@todo Add Contains(Circle/Disc/Sphere/Capsule).
|
||||
@see Distance(), Intersects(), ClosestPoint(). */
|
||||
bool Contains(const Vector3 &point) const;
|
||||
bool Contains(const Vector3 &point) const {
|
||||
const float eps = 1e-3f;
|
||||
const float position = 1.f + eps;
|
||||
const float neg = -position;
|
||||
Vector3 projected = Project(point);
|
||||
}
|
||||
bool Contains(const LineSegment &lineSegment) const;
|
||||
bool Contains(const Triangle &triangle) const;
|
||||
bool Contains(const Polygon &polygon) const;
|
||||
|
Reference in New Issue
Block a user