15 #include "bulletMultiSphereShape.h"
17 #include "geomVertexReader.h"
19 TypeHandle BulletMultiSphereShape::_type_handle;
26 BulletMultiSphereShape::
27 BulletMultiSphereShape(
const PTA_LVecBase3 &points,
const PTA_stdfloat &radii) {
29 int num_spheres = min(points.size(), radii.size());
32 btVector3 *bt_points =
new btVector3[num_spheres];
33 for (
int i=0; i<num_spheres; i++) {
34 bt_points[i] = LVecBase3_to_btVector3(points[i]);
38 btScalar *bt_radii =
new btScalar[num_spheres];
39 for (
int j=0; j<num_spheres; j++) {
40 bt_radii[j] = (PN_stdfloat)radii[j];
44 _shape =
new btMultiSphereShape(bt_points, bt_radii, num_spheres);
45 _shape->setUserPointer(
this);
53 btCollisionShape *BulletMultiSphereShape::
TypeHandle is the identifier used to differentiate C++ class types.