From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Geometry/ComputionalGeometry.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Runtime/Geometry/ComputionalGeometry.h (limited to 'Runtime/Geometry/ComputionalGeometry.h') diff --git a/Runtime/Geometry/ComputionalGeometry.h b/Runtime/Geometry/ComputionalGeometry.h new file mode 100644 index 0000000..42f5e47 --- /dev/null +++ b/Runtime/Geometry/ComputionalGeometry.h @@ -0,0 +1,19 @@ +#ifndef COMPUTIONALGEOMETRY_H +#define COMPUTIONALGEOMETRY_H + +class Vector2f; +class Vector3f; +class Plane; + +float SignedTriangleArea2D (const Vector2f& a, const Vector2f& b, const Vector2f& c); +float SignedTriangleArea2D (const Vector3f* v); +float TriangleArea3D (const Vector3f& a, const Vector3f& b, const Vector3f& c); +float CalculateProjectedBoxArea2D (const Vector3f* v); +float CalculateTriangleAreaRotationless (Vector3f* v, float inFovy, float inScreenWidth, float inScreenHeight, Vector3f& viewPoint); +float CalculateTriangleAreaRadialFrustum (Vector3f* v, float inFovy, float inNear, float inFar, float inScreenHeight); +float CalculateBoxAreaRadialFrustum (Vector3f* v, float inFovy, float inNear, float inFar, float inScreenHeight); +float CalculateBoxAreaRadialFrustum2 (Vector3f* v, float a, float b, float c); +float CalculateTriangleAreaRadialFrustum2 (Vector3f* v, float a, float b, float c); +int ClipPolygonAgainstPlane(int vertexCount, const Vector3f *vertex, const Plane& plane, char *location, Vector3f *result); + +#endif -- cgit v1.1-26-g67d0