21 #define DEBUG_RENDER_SHAPE_CONTACTS 0
32 class GeometryContactPtr;
38 class ShapeContactColliderUtils;
47 : normal(n), prevNormal(prev), nextNormal(next)
51 ShapeCurvature& operator=(
const ShapeCurvature& rhs)
53 this->normal = rhs.normal;
54 this->prevNormal = rhs.prevNormal;
55 this->nextNormal = rhs.nextNormal;
64 agx::Vec3 calculateCurvatureOrthogonalNormal()
const
66 agx::Vec3 orthoVector = prevNormal ^ nextNormal;
74 prevNormal.normalize();
75 nextNormal.normalize();
91 agx::Vec3 totDir = prevNormal + nextNormal;
114 ShapeContactEdge& operator=(
const ShapeContactEdge& rhs)
116 this->m_shape = rhs.m_shape;
117 this->m_edgeNormal = rhs.m_edgeNormal;
118 this->m_edgeStart = rhs.m_edgeStart;
119 this->m_edgeEnd = rhs.m_edgeEnd;
120 this->m_localShapeSurfaceProjectedPosition = rhs.m_localShapeSurfaceProjectedPosition;
121 this->m_previousLocalShapePosition = rhs.m_previousLocalShapePosition;
122 this->m_worldVectorFromLastProjection = rhs.m_worldVectorFromLastProjection;
123 this->getLocalCurvature() = rhs.m_localCurvature;
130 const ShapeContactColliderUtils* colliderUtils,
const agx::Vec3& normal,
const agx::Vec3& wpOnSurface,
144 ShapeCurvature transformCurvatureToWorld(
const ShapeCurvature& localCurvature)
const;
145 ShapeCurvature transformCurvatureToShape(
const ShapeCurvature& worldCurvature)
const;
147 ShapeCurvature getWorldCurvature()
const;
148 ShapeCurvature getShapeLocalCurvature()
const;
154 void clearClampShapes();
162 void setWorldEdgeNormal(
const agx::Vec3& worldEdgeDir);
163 void setShapeEdgeNormal(
const agx::Vec3& shapeEdgeDir);
168 void resetEdgeLength(
agx::Real edgeHalfLength);
170 ShapeContactEdge::ClampDirection getClampDirection(
agx::Real edgeDefaultLength)
const;
172 void renderDebug(
const agx::Vec4& color)
const;
182 void setEdgeStart(
const agx::Real& lengthToStartAlongEdgeDir);
185 void setEdgeEnd(
const agx::Real& lengthToEndAlongEdgeDir);
188 void setLocalShapeSurfaceProjectedPosition(
agx::Vec3 pos);
189 agx::Vec3 getLocalShapeSurfaceProjectedPosition()
const;
191 void setPreviousLocalShapePosition(
agx::Vec3 pos);
192 agx::Vec3 getPreviousLocalShapePosition()
const;
194 void setWorldPositionIfThisEdgeIsUsed(
agx::Vec3 worldPos);
195 agx::Vec3 getWorldPositionIfThisEdgeIsUsed()
const;
197 void setWorldVectorFromLastProjection(
agx::Vec3 vec);
198 agx::Vec3 getWorldVectorFromLastProjection()
const;
200 ShapeCurvature& getLocalCurvature();
201 const ShapeCurvature& getLocalCurvature()
const;
202 void setLocalCurvature(ShapeCurvature& newLocalCurvature);
204 void setWorldNormal(
const agx::Vec3& worldNormal);
207 void setWorldSurfaceProjectedPosition(
const agx::Vec3& worldPos);
208 agx::Vec3 getWorldSurfaceProjectedPosition()
const;
218 agx::Vec3 m_localShapeSurfaceProjectedPosition;
220 agx::Vec3 m_worldVectorFromLastProjection;
222 ShapeCurvature m_localCurvature;