Loading...
Searching...
No Matches
ConvexObj.h
1
19
20#pragma once
21#include "Vec3.h"
22#include <random>
23namespace CommonMath
24{
25
27
30 struct Boundary
31 {
33
41 {
42 point = p;
43 normal = n;
44 }
45
47
52 {
53 }
54
57 };
58
60
66 {
67 public:
68 virtual ~ConvexObj()
69 {
70 // Empty destructor
71 }
72
74
79 virtual Boundary GetTangentPlane(Vec3 testPoint) = 0;
80
82
86 virtual bool IsPointInside(Vec3 testPoint) = 0;
87
88 virtual Vec3 GetRandomPositionInside(std::default_random_engine randomGen) = 0;
89 };
90
91} // namespace CommonMath
An abstract class that defines the required properties of convex objects.
Definition ConvexObj.h:66
virtual bool IsPointInside(Vec3 testPoint)=0
Check whether a given point is inside the convex object.
virtual Boundary GetTangentPlane(Vec3 testPoint)=0
Find a separating plane between the convex object and given point.
3D vector class with common vector operations.
Definition Vec3.h:36
A struct defining the properties of a plane.
Definition ConvexObj.h:31
Boundary(Vec3 p, Vec3 n)
Constructor.
Definition ConvexObj.h:40
Boundary()
Default constructor.
Definition ConvexObj.h:51
Vec3 point
A point on the plane.
Definition ConvexObj.h:55
Vec3 normal
A unit vector normal to the plane.
Definition ConvexObj.h:56