KrisLibrary  1.0.0
math3d/clip.h
Go to the documentation of this file.
1 #ifndef MATH3D_CLIP_H
2 #define MATH3D_CLIP_H
3 
4 #include "Plane2D.h"
5 #include "Polygon2D.h"
6 #include "AABB2D.h"
7 #include "Plane3D.h"
8 #include "Polyhedron3D.h"
9 #include "AABB3D.h"
10 #include "Box3D.h"
11 
17 namespace Math3D {
20 
21 using namespace Math;
22 
30 bool ClipLine1D(Real q, Real p, Real& umin, Real& umax);
31 
34 inline bool ClipLine1D(Real x0, Real a, Real b, Real& umin, Real& umax)
35 {
36  return ClipLine1D(a*x0-b,a,umin,umax);
37 }
38 
41 bool ClipLine(const Vector2& x, const Vector2& v, const Plane2D& b, Real& u1, Real& u2);
43 bool ClipLine(const Vector2& x, const Vector2& v, const AABB2D& b, Real& u1, Real& u2);
45 bool ClipLine(const Vector2& x, const Vector2& v, const ConvexPolygon2D& b, Real& u1, Real& u2);
46 bool ClipLine(const Vector3& x, const Vector3& v, const Plane3D& b, Real& u1, Real& u2);
47 bool ClipLine(const Vector3& x, const Vector3& v, const Box3D& b, Real& u1, Real& u2);
48 bool ClipLine(const Vector3& x, const Vector3& v, const AABB3D& b, Real& u1, Real& u2);
49 bool ClipLine(const Vector3& x, const Vector3& v, const ConvexPolyhedron3D& b, Real& u1, Real& u2);
50 
52 }
53 
54 #endif
bool ClipLine1D(Real q, Real p, Real &umin, Real &umax)
Clipping primitive in 1D.
Definition: math3d/clip.cpp:5
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
A 3D axis-aligned bounding box.
Definition: AABB3D.h:13
A convex polyhedron given in a dual representation, planes and vertices of convex hull...
Definition: Polyhedron3D.h:19
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:13
A 2D plane classRepresents plane with a normal and offset such that x on the plane satisfy dot(normal...
Definition: Plane2D.h:20
A convex connected polygon such that the vertices are in ccw order.
Definition: Polygon2D.h:61
Contains all definitions in the Math package.
Definition: WorkspaceBound.h:12
A 2D vector class.
Definition: math3d/primitives.h:41
A 2D axis-aligned bounding box.
Definition: AABB2D.h:13
A 3D boxThe box is the unit cube [0,1]^3 set in the scaled local coordinate system. That is, one corner is at the origin, and it has dimensions [dims.x,dims.y,dims.z] in the coordinates given by {xbasis,ybasis,zbasis}.
Definition: Box3D.h:21
bool ClipLine(const Vector2 &x, const Vector2 &v, const Plane2D &b, Real &u1, Real &u2)
Definition: math3d/clip.cpp:24