Closed guzzard closed 6 years ago
While testing I used cast(_shapeConvex, BtCapsuleShapePointer)
, and it worked fine in JS. But in C++ I had to force a static_cast
in order to cast BtConvexShapePointer
into BtCapsuleShapePointer
. Is this normal or am I missing something?
else if (shape == ControllerShape.Capsule) {
var r = transform.dim.x / 2;
_shapeConvex = BtCapsuleShapeZ.create(
withMargin(r), // Radius
withMargin(transform.dim.z - r * 2)); // Height between 2 sphere centers
#if cpp
var capsule:BtCapsuleShapePointer = null;
untyped __cpp__('capsule = static_cast<btCapsuleShape*>(_shapeConvex)');
trace("capsule: " + capsule.getUpAxis() + " " + capsule.getRadius() + " " + capsule.getHalfHeight());
#end
}
All tested in JS and C++