5#pragma warning(disable : 4267)
6#pragma warning(disable : 4251)
11#include "eigen_matrix_defs.h"
15namespace GeometryTools{
25 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
64struct Plate {
Plane plane;
double radius;
double lx;
double ly;};
88struct AABB{
double xm;
double ym;
double zm;
double xp;
double yp;
double zp;
90AABB(
double XM,
double YM,
double ZM,
double XP,
double YP,
double ZP){xm=XM;ym=YM;zm=ZM;xp=XP;yp=YP;zp=ZP;}
91AABB(
const vec3& center,
const vec3& half_span){
92 xm = center.x()-half_span.x();
93 ym = center.y()-half_span.y();
94 zm = center.z()-half_span.z();
95 xp = center.x()+half_span.x();
96 yp = center.y()+half_span.y();
97 zp = center.z()+half_span.z();
99bool isContainedIn(
const AABB& box)
const{
return xm>=box.xm && ym>=box.ym && zm>=box.zm && xp<=box.xp && yp<=box.yp && zp<=box.zp;}
102AABB AxisAlignedBoundingBox(
const Point& point);
103AABB AxisAlignedBoundingBox(
const Segment& segment);
104AABB AxisAlignedBoundingBox(
const Ring& ring);
105AABB AxisAlignedBoundingBox(
const Disk& disk);
106AABB AxisAlignedBoundingBox(
const Plane& plane);
108AABB AxisAlignedBoundingBox(
const Sphere& sphere);
109AABB AxisAlignedBoundingBox(
const Capsule& capsule);
110AABB AxisAlignedBoundingBox(
const Torus& torus);
111AABB AxisAlignedBoundingBox(
const Chamfer& chamfer);
112AABB AxisAlignedBoundingBox(
const Plate& plate);
114AABB MergeAxisAlignedBoundingBox(
const AABB& A,
const AABB& B);
116#ifdef FH_VISUALIZATION
117void CreateCapsule( Ogre::ManualObject* capsule_manual,
double radius,
double length,
int N = 32, std::string material =
"DiffuseSpecular");
118void CreateChamfer( Ogre::ManualObject* chamfer_manual,
double majorRadius,
double minorRadius,
int N = 32, std::string material =
"DiffuseSpecular");
119void CreatePlate( Ogre::ManualObject* plate_manual,
double lx,
double ly,
double t,
int N = 32, std::string material =
"DiffuseSpecular");
120void CreateTorus( Ogre::ManualObject* chamfer_manual,
double majorRadius,
double minorRadius,
int N = 32, std::string material =
"DiffuseSpecular");
121void CreateSphere( Ogre::ManualObject* sphere_manual,
double radius,
int N = 32, std::string material =
"DiffuseSpecular");
122void CreateEquilateralTriangle( Ogre::ManualObject* sphere_manual,
double side,
double thickness, std::string material =
"DiffuseSpecular");
123void CreateBox( Ogre::ManualObject* manual,
double l0,
double l1,
double l2, std::string material =
"DiffuseSpecular");
125void CreateLinedrawingChamfer( Ogre::ManualObject* chamfer_manual,
double majorRadius,
double minorRadius, Ogre::ColourValue color,
int N = 8);
Definition: CollisionManager.h:6
Definition: GeometryTools.h:88
Definition: GeometryTools.h:60
every point inside 'radius' from 'ring'
Definition: GeometryTools.h:63
Definition: GeometryTools.h:52
Definition: GeometryTools.h:16
vec3 PA
current rate of change of minDistance
Definition: GeometryTools.h:22
double J_dot_V
minDistance differentiated with respect to spatial coordinates of object B
Definition: GeometryTools.h:19
double minDistance
[d(JA)/dt]*VA+[d(JB)/dt]*VB
Definition: GeometryTools.h:20
vec6 JacobianA
holds information of minimum distance between two shapes
Definition: GeometryTools.h:17
vec3 PB
vector from center A to the point-of-shortest-distance
Definition: GeometryTools.h:23
vec6 JacobianB
minDistance differentiated with respect to spatial coordinates of object A
Definition: GeometryTools.h:18
vec3 u
vector from center B to the point-of-shortest-distance
Definition: GeometryTools.h:24
double minDistance_dot
minimum distance between two shapes
Definition: GeometryTools.h:21
Definition: GeometryTools.h:38
every point inside 'radius' from 'disk'
Definition: GeometryTools.h:64
Definition: GeometryTools.h:28
Definition: GeometryTools.h:45
Definition: GeometryTools.h:32
every point inside 'radius' from 'segment'
Definition: GeometryTools.h:61
every point inside 'radius' from 'point'
Definition: GeometryTools.h:62