mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-15 06:00:12 +00:00
38 lines
602 B
C++
38 lines
602 B
C++
#include "Shape.h"
|
|
#include <assert.h>
|
|
#include <stdio.h>
|
|
|
|
bool cShape::ParseShape(const std::string& str, eShape& out_shape)
|
|
{
|
|
bool succ = true;
|
|
if (str == "null")
|
|
{
|
|
out_shape = eShapeNull;
|
|
}
|
|
else if (str == "box")
|
|
{
|
|
out_shape = eShapeBox;
|
|
}
|
|
else if (str == "capsule")
|
|
{
|
|
out_shape = eShapeCapsule;
|
|
}
|
|
else if (str == "sphere")
|
|
{
|
|
out_shape = eShapeSphere;
|
|
}
|
|
else if (str == "cylinder")
|
|
{
|
|
out_shape = eShapeCylinder;
|
|
}
|
|
else if (str == "plane")
|
|
{
|
|
out_shape = eShapePlane;
|
|
}
|
|
else
|
|
{
|
|
printf("Unsupported body shape %s\n", str.c_str());
|
|
assert(false);
|
|
}
|
|
return succ;
|
|
} |