PlaneConvex

Working example of a plane convex type, now groundplane does not need to create a box for its collisions.
This commit is contained in:
marauder2k7 2024-05-19 01:18:50 +01:00
parent b7c04c5734
commit 2d2d3c7560
4 changed files with 130 additions and 16 deletions

View file

@ -48,16 +48,32 @@ public:
void getPolyList(AbstractPolyList* list) override;
};
class OrthoBoxConvex: public BoxConvex
class OrthoBoxConvex : public BoxConvex
{
typedef BoxConvex Parent;
mutable MatrixF mOrthoMatrixCache;
public:
public:
OrthoBoxConvex() { mOrthoMatrixCache.identity(); }
const MatrixF& getTransform() const override;
};
class PlaneConvex : public Convex
{
Point3F getVertex(S32 v);
void emitEdge(S32 v1, S32 v2, const MatrixF& mat, ConvexFeature* cf);
void emitFace(const MatrixF& mat, ConvexFeature* cf);
public:
Point3F mCenter;
VectorF mSize;
PlaneConvex() { mType = PlaneConvexType; }
void init(SceneObject* obj) { mObject = obj; }
Point3F support(const VectorF& v) const override;
void getFeatures(const MatrixF& mat, const VectorF& n, ConvexFeature* cf) override;
void getPolyList(AbstractPolyList* list) override;
};
#endif