mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-05 05:20:31 +00:00
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:
parent
b7c04c5734
commit
2d2d3c7560
4 changed files with 130 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue