|
|
@ -8,6 +8,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace DetourNavigator
|
|
|
|
namespace DetourNavigator
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool updateCompoundObject(const btCompoundShape& shape, const AreaType areaType,
|
|
|
|
|
|
|
|
std::vector<RecastMeshObject>& children)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(static_cast<std::size_t>(shape.getNumChildShapes()) == children.size());
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
for (int i = 0, num = shape.getNumChildShapes(); i < num; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(shape.getChildShape(i) == std::addressof(children[static_cast<std::size_t>(i)].getShape()));
|
|
|
|
|
|
|
|
result = children[static_cast<std::size_t>(i)].update(shape.getChildTransform(i), areaType) || result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RecastMeshObject::RecastMeshObject(const btCollisionShape& shape, const btTransform& transform,
|
|
|
|
RecastMeshObject::RecastMeshObject(const btCollisionShape& shape, const btTransform& transform,
|
|
|
|
const AreaType areaType)
|
|
|
|
const AreaType areaType)
|
|
|
|
: mShape(shape)
|
|
|
|
: mShape(shape)
|
|
|
@ -42,19 +58,6 @@ namespace DetourNavigator
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool RecastMeshObject::updateCompoundObject(const btCompoundShape& shape,
|
|
|
|
|
|
|
|
const AreaType areaType, std::vector<RecastMeshObject>& children)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(static_cast<std::size_t>(shape.getNumChildShapes()) == children.size());
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
for (int i = 0, num = shape.getNumChildShapes(); i < num; ++i)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
assert(shape.getChildShape(i) == std::addressof(children[static_cast<std::size_t>(i)].mShape.get()));
|
|
|
|
|
|
|
|
result = children[static_cast<std::size_t>(i)].update(shape.getChildTransform(i), areaType) || result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<RecastMeshObject> makeChildrenObjects(const btCollisionShape& shape, const AreaType areaType)
|
|
|
|
std::vector<RecastMeshObject> makeChildrenObjects(const btCollisionShape& shape, const AreaType areaType)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (shape.isCompound())
|
|
|
|
if (shape.isCompound())
|
|
|
|