Physics2D/Collider2D: Add support for neighbors vertices

This commit is contained in:
Lynix
2020-01-01 17:25:22 +01:00
parent f371cbb386
commit df2a029f30
4 changed files with 27 additions and 1 deletions

View File

@@ -298,7 +298,10 @@ namespace Nz
std::size_t SegmentCollider2D::CreateShapes(RigidBody2D* body, std::vector<cpShape*>* shapes) const
{
shapes->push_back(cpSegmentShapeNew(body->GetHandle(), cpv(m_first.x, m_first.y), cpv(m_second.x, m_second.y), m_thickness));
cpShape* segment = cpSegmentShapeNew(body->GetHandle(), cpv(m_first.x, m_first.y), cpv(m_second.x, m_second.y), m_thickness);
cpSegmentShapeSetNeighbors(segment, cpv(m_firstNeighbor.x, m_firstNeighbor.y), cpv(m_secondNeighbor.x, m_secondNeighbor.y));
shapes->push_back(segment);
return 1;
}
}