KrisLibrary  1.0.0
Circle3D.h
1 #ifndef MATH3D_CIRCLE3D_H
2 #define MATH3D_CIRCLE3D_H
3 
4 #include "Point.h"
5 
6 namespace Math3D {
7 
8 struct Line3D;
9 struct Plane3D;
10 struct Sphere3D;
11 struct AABB3D;
12 
21 struct Circle3D
22 {
23  bool setIntersection(const Sphere3D& s,const Plane3D& p);
24  Real distance(const Point3D& v) const;
25  Real closestPoint(const Point3D& v,Point3D& closest) const;
26  Real boundaryDistance(const Point3D& v) const;
27  bool intersects(const Circle3D& c) const;
28  bool intersects(const Sphere3D& s) const;
29  bool intersects(const Line3D& l,Real* t=NULL) const;
30  bool intersects(const Plane3D& p) const;
31  bool boundaryIntersects(const Sphere3D& s) const;
32  void getPlane(Plane3D& p) const;
33  void getAABB(AABB3D&) const;
34 
35  bool Read(File& f);
36  bool Write(File& f) const;
37 
38  Point3D center;
39  Vector3 axis;
40  Real radius;
41 };
42 
43 } //namespace Math3D
44 
45 #endif
A 3D plane classRepresents plane with a normal and offset such that x on the plane satisfy dot(normal...
Definition: Plane3D.h:19
A 3D vector class.
Definition: math3d/primitives.h:136
Real closestPoint(const Point3D &v, Point3D &closest) const
Returns distance to closest.
Definition: Circle3D.cpp:52
A 3D axis-aligned bounding box.
Definition: AABB3D.h:13
A 3D sphere class.
Definition: Sphere3D.h:21
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:13
bool setIntersection(const Sphere3D &s, const Plane3D &p)
Returns false if they don't intersect.
Definition: Circle3D.cpp:27
A 2D circle in 3D space class.
Definition: Circle3D.h:21
A 3D line class.
Definition: Line3D.h:18
A cross-platform class for reading/writing binary data.
Definition: File.h:47