diff --git a/src/collision_func_matrix.cpp b/src/collision_func_matrix.cpp index 02fee42c4..67780e590 100644 --- a/src/collision_func_matrix.cpp +++ b/src/collision_func_matrix.cpp @@ -318,6 +318,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeCollide; collision_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeCollide; + collision_matrix[GEOM_BOX][GEOM_ELLIPSOID] = + &ShapeShapeCollide; collision_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeCollide; collision_matrix[GEOM_SPHERE][GEOM_SPHERE] = @@ -332,6 +334,25 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeCollide; collision_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeCollide; + collision_matrix[GEOM_SPHERE][GEOM_ELLIPSOID] = + &ShapeShapeCollide; + + collision_matrix[GEOM_ELLIPSOID][GEOM_BOX] = + &ShapeShapeCollide; + collision_matrix[GEOM_ELLIPSOID][GEOM_SPHERE] = + &ShapeShapeCollide; + collision_matrix[GEOM_ELLIPSOID][GEOM_CAPSULE] = + &ShapeShapeCollide; + collision_matrix[GEOM_ELLIPSOID][GEOM_CONE] = + &ShapeShapeCollide; + collision_matrix[GEOM_ELLIPSOID][GEOM_CYLINDER] = + &ShapeShapeCollide; + collision_matrix[GEOM_ELLIPSOID][GEOM_CONVEX] = + &ShapeShapeCollide; + // TODO Louis: Ellipsoid - Plane + // TODO Louis: Ellipsoid - Halfspace + collision_matrix[GEOM_ELLIPSOID][GEOM_ELLIPSOID] = + &ShapeShapeCollide; collision_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeCollide; collision_matrix[GEOM_CAPSULE][GEOM_SPHERE] = @@ -347,6 +368,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &ShapeShapeCollide; collision_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeCollide; + collision_matrix[GEOM_CAPSULE][GEOM_ELLIPSOID] = + &ShapeShapeCollide; collision_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeCollide; collision_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeCollide; @@ -359,6 +382,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeCollide; collision_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeCollide; + collision_matrix[GEOM_CONE][GEOM_ELLIPSOID] = + &ShapeShapeCollide; collision_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeCollide; collision_matrix[GEOM_CYLINDER][GEOM_SPHERE] = @@ -375,6 +400,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &ShapeShapeCollide; collision_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeCollide; + collision_matrix[GEOM_CYLINDER][GEOM_ELLIPSOID] = + &ShapeShapeCollide; collision_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeCollide; collision_matrix[GEOM_CONVEX][GEOM_SPHERE] = @@ -391,6 +418,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &ShapeShapeCollide; collision_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeCollide; + collision_matrix[GEOM_CONVEX][GEOM_ELLIPSOID] = + &ShapeShapeCollide; collision_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeCollide; collision_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeCollide; @@ -404,6 +433,7 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeCollide; collision_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeCollide; + // TODO Louis: Ellipsoid - Plane collision_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeCollide; @@ -421,6 +451,7 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &ShapeShapeCollide; collision_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeCollide; + // TODO Louis: Ellipsoid - Halfspace collision_matrix[BV_AABB][GEOM_BOX] = &BVHShapeCollider::collide; collision_matrix[BV_AABB][GEOM_SPHERE] = @@ -436,6 +467,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &BVHShapeCollider::collide; collision_matrix[BV_AABB][GEOM_HALFSPACE] = &BVHShapeCollider::collide; + collision_matrix[BV_AABB][GEOM_ELLIPSOID] = + &BVHShapeCollider::collide; collision_matrix[BV_OBB][GEOM_BOX] = &BVHShapeCollider::collide; collision_matrix[BV_OBB][GEOM_SPHERE] = @@ -450,6 +483,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[BV_OBB][GEOM_PLANE] = &BVHShapeCollider::collide; collision_matrix[BV_OBB][GEOM_HALFSPACE] = &BVHShapeCollider::collide; + collision_matrix[BV_OBB][GEOM_ELLIPSOID] = + &BVHShapeCollider::collide; collision_matrix[BV_RSS][GEOM_BOX] = &BVHShapeCollider::collide; collision_matrix[BV_RSS][GEOM_SPHERE] = @@ -464,6 +499,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[BV_RSS][GEOM_PLANE] = &BVHShapeCollider::collide; collision_matrix[BV_RSS][GEOM_HALFSPACE] = &BVHShapeCollider::collide; + collision_matrix[BV_RSS][GEOM_ELLIPSOID] = + &BVHShapeCollider::collide; collision_matrix[BV_KDOP16][GEOM_BOX] = &BVHShapeCollider, Box>::collide; @@ -481,6 +518,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &BVHShapeCollider, Plane>::collide; collision_matrix[BV_KDOP16][GEOM_HALFSPACE] = &BVHShapeCollider, Halfspace>::collide; + collision_matrix[BV_KDOP16][GEOM_ELLIPSOID] = + &BVHShapeCollider, Ellipsoid>::collide; collision_matrix[BV_KDOP18][GEOM_BOX] = &BVHShapeCollider, Box>::collide; @@ -498,6 +537,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &BVHShapeCollider, Plane>::collide; collision_matrix[BV_KDOP18][GEOM_HALFSPACE] = &BVHShapeCollider, Halfspace>::collide; + collision_matrix[BV_KDOP18][GEOM_ELLIPSOID] = + &BVHShapeCollider, Ellipsoid>::collide; collision_matrix[BV_KDOP24][GEOM_BOX] = &BVHShapeCollider, Box>::collide; @@ -515,6 +556,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &BVHShapeCollider, Plane>::collide; collision_matrix[BV_KDOP24][GEOM_HALFSPACE] = &BVHShapeCollider, Halfspace>::collide; + collision_matrix[BV_KDOP24][GEOM_ELLIPSOID] = + &BVHShapeCollider, Ellipsoid>::collide; collision_matrix[BV_kIOS][GEOM_BOX] = &BVHShapeCollider::collide; collision_matrix[BV_kIOS][GEOM_SPHERE] = @@ -530,6 +573,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &BVHShapeCollider::collide; collision_matrix[BV_kIOS][GEOM_HALFSPACE] = &BVHShapeCollider::collide; + collision_matrix[BV_kIOS][GEOM_ELLIPSOID] = + &BVHShapeCollider::collide; collision_matrix[BV_OBBRSS][GEOM_BOX] = &BVHShapeCollider::collide; @@ -547,6 +592,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &BVHShapeCollider::collide; collision_matrix[BV_OBBRSS][GEOM_HALFSPACE] = &BVHShapeCollider::collide; + collision_matrix[BV_OBBRSS][GEOM_ELLIPSOID] = + &BVHShapeCollider::collide; collision_matrix[HF_AABB][GEOM_BOX] = &HeightFieldShapeCollider::collide; @@ -564,6 +611,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &HeightFieldShapeCollider::collide; collision_matrix[HF_AABB][GEOM_HALFSPACE] = &HeightFieldShapeCollider::collide; + collision_matrix[HF_AABB][GEOM_ELLIPSOID] = + &HeightFieldShapeCollider::collide; collision_matrix[HF_OBBRSS][GEOM_BOX] = &HeightFieldShapeCollider::collide; @@ -581,6 +630,8 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { &HeightFieldShapeCollider::collide; collision_matrix[HF_OBBRSS][GEOM_HALFSPACE] = &HeightFieldShapeCollider::collide; + collision_matrix[HF_OBBRSS][GEOM_ELLIPSOID] = + &HeightFieldShapeCollider::collide; collision_matrix[BV_AABB][BV_AABB] = &BVHCollide; collision_matrix[BV_OBB][BV_OBB] = &BVHCollide; @@ -600,6 +651,7 @@ CollisionFunctionMatrix::CollisionFunctionMatrix() { collision_matrix[GEOM_OCTREE][GEOM_CONVEX] = &Collide; collision_matrix[GEOM_OCTREE][GEOM_PLANE] = &Collide; collision_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &Collide; + collision_matrix[GEOM_OCTREE][GEOM_ELLIPSOID] = &Collide; collision_matrix[GEOM_BOX][GEOM_OCTREE] = &Collide; collision_matrix[GEOM_SPHERE][GEOM_OCTREE] = &Collide; diff --git a/src/distance_func_matrix.cpp b/src/distance_func_matrix.cpp index a91e57ca0..ca295473a 100644 --- a/src/distance_func_matrix.cpp +++ b/src/distance_func_matrix.cpp @@ -291,6 +291,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { distance_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeDistance; distance_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeDistance; + distance_matrix[GEOM_BOX][GEOM_ELLIPSOID] = + &ShapeShapeDistance; distance_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeDistance; distance_matrix[GEOM_SPHERE][GEOM_SPHERE] = @@ -305,6 +307,25 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { distance_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeDistance; distance_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeDistance; + distance_matrix[GEOM_SPHERE][GEOM_ELLIPSOID] = + &ShapeShapeDistance; + + distance_matrix[GEOM_ELLIPSOID][GEOM_BOX] = + &ShapeShapeDistance; + distance_matrix[GEOM_ELLIPSOID][GEOM_SPHERE] = + &ShapeShapeDistance; + distance_matrix[GEOM_ELLIPSOID][GEOM_CAPSULE] = + &ShapeShapeDistance; + distance_matrix[GEOM_ELLIPSOID][GEOM_CONE] = + &ShapeShapeDistance; + distance_matrix[GEOM_ELLIPSOID][GEOM_CYLINDER] = + &ShapeShapeDistance; + distance_matrix[GEOM_ELLIPSOID][GEOM_CONVEX] = + &ShapeShapeDistance; + // TODO Louis: Ellipsoid - Plane + // TODO Louis: Ellipsoid - Halfspace + distance_matrix[GEOM_ELLIPSOID][GEOM_ELLIPSOID] = + &ShapeShapeDistance; distance_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeDistance; distance_matrix[GEOM_CAPSULE][GEOM_SPHERE] = @@ -320,6 +341,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &ShapeShapeDistance; distance_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeDistance; + distance_matrix[GEOM_CAPSULE][GEOM_ELLIPSOID] = + &ShapeShapeDistance; distance_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeDistance; distance_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeDistance; @@ -332,6 +355,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { distance_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeDistance; distance_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeDistance; + distance_matrix[GEOM_CONE][GEOM_ELLIPSOID] = + &ShapeShapeDistance; distance_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeDistance; distance_matrix[GEOM_CYLINDER][GEOM_SPHERE] = @@ -348,6 +373,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &ShapeShapeDistance; distance_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeDistance; + distance_matrix[GEOM_CYLINDER][GEOM_ELLIPSOID] = + &ShapeShapeDistance; distance_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeDistance; distance_matrix[GEOM_CONVEX][GEOM_SPHERE] = @@ -364,6 +391,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &ShapeShapeDistance; distance_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeDistance; + distance_matrix[GEOM_CONVEX][GEOM_ELLIPSOID] = + &ShapeShapeDistance; distance_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeDistance; distance_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeDistance; @@ -377,6 +406,7 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { distance_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeDistance; distance_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeDistance; + // TODO Louis: Ellipsoid - Plane distance_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeDistance; @@ -394,6 +424,7 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &ShapeShapeDistance; distance_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeDistance; + // TODO Louis: Ellipsoid - Halfspace /* AABB distance not implemented */ /* @@ -425,6 +456,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &BVHShapeDistancer::distance; distance_matrix[BV_OBB][GEOM_HALFSPACE] = &BVHShapeDistancer::distance; + distance_matrix[BV_OBB][GEOM_ELLIPSOID] = + &BVHShapeDistancer::distance; distance_matrix[BV_RSS][GEOM_BOX] = &BVHShapeDistancer::distance; distance_matrix[BV_RSS][GEOM_SPHERE] = @@ -440,6 +473,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &BVHShapeDistancer::distance; distance_matrix[BV_RSS][GEOM_HALFSPACE] = &BVHShapeDistancer::distance; + distance_matrix[BV_RSS][GEOM_ELLIPSOID] = + &BVHShapeDistancer::distance; /* KDOP distance not implemented */ /* @@ -498,6 +533,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &BVHShapeDistancer::distance; distance_matrix[BV_kIOS][GEOM_HALFSPACE] = &BVHShapeDistancer::distance; + distance_matrix[BV_kIOS][GEOM_ELLIPSOID] = + &BVHShapeDistancer::distance; distance_matrix[BV_OBBRSS][GEOM_BOX] = &BVHShapeDistancer::distance; @@ -515,6 +552,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &BVHShapeDistancer::distance; distance_matrix[BV_OBBRSS][GEOM_HALFSPACE] = &BVHShapeDistancer::distance; + distance_matrix[BV_OBBRSS][GEOM_ELLIPSOID] = + &BVHShapeDistancer::distance; distance_matrix[HF_AABB][GEOM_BOX] = &HeightFieldShapeDistancer::distance; @@ -532,6 +571,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &HeightFieldShapeDistancer::distance; distance_matrix[HF_AABB][GEOM_HALFSPACE] = &HeightFieldShapeDistancer::distance; + distance_matrix[HF_AABB][GEOM_ELLIPSOID] = + &HeightFieldShapeDistancer::distance; distance_matrix[HF_OBBRSS][GEOM_BOX] = &HeightFieldShapeDistancer::distance; @@ -549,6 +590,8 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { &HeightFieldShapeDistancer::distance; distance_matrix[HF_OBBRSS][GEOM_HALFSPACE] = &HeightFieldShapeDistancer::distance; + distance_matrix[HF_OBBRSS][GEOM_ELLIPSOID] = + &HeightFieldShapeDistancer::distance; distance_matrix[BV_AABB][BV_AABB] = &BVHDistance; distance_matrix[BV_OBB][BV_OBB] = &BVHDistance; @@ -565,6 +608,7 @@ DistanceFunctionMatrix::DistanceFunctionMatrix() { distance_matrix[GEOM_OCTREE][GEOM_CONVEX] = &Distance; distance_matrix[GEOM_OCTREE][GEOM_PLANE] = &Distance; distance_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &Distance; + distance_matrix[GEOM_OCTREE][GEOM_ELLIPSOID] = &Distance; distance_matrix[GEOM_BOX][GEOM_OCTREE] = &Distance; distance_matrix[GEOM_SPHERE][GEOM_OCTREE] = &Distance;