Physics2D/Collider2D: Add support for neighbors vertices
This commit is contained in:
@@ -230,13 +230,16 @@ namespace Nz
|
||||
{
|
||||
public:
|
||||
inline SegmentCollider2D(const Vector2f& first, const Vector2f& second, float thickness = 1.f);
|
||||
inline SegmentCollider2D(const Vector2f& first, const Vector2f& firstNeighbor, const Vector2f& second, const Vector2f& secondNeighbor, float thickness = 1.f);
|
||||
|
||||
Nz::Vector2f ComputeCenterOfMass() const override;
|
||||
float ComputeMomentOfInertia(float mass) const override;
|
||||
|
||||
inline const Vector2f& GetFirstPoint() const;
|
||||
inline const Vector2f& GetFirstPointNeighbor() const;
|
||||
inline float GetLength() const;
|
||||
inline const Vector2f& GetSecondPoint() const;
|
||||
inline const Vector2f& GetSecondPointNeighbor() const;
|
||||
inline float GetThickness() const;
|
||||
ColliderType2D GetType() const override;
|
||||
|
||||
@@ -246,7 +249,9 @@ namespace Nz
|
||||
std::size_t CreateShapes(RigidBody2D* body, std::vector<cpShape*>* shapes) const override;
|
||||
|
||||
Vector2f m_first;
|
||||
Vector2f m_firstNeighbor;
|
||||
Vector2f m_second;
|
||||
Vector2f m_secondNeighbor;
|
||||
float m_thickness;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user