15 #include "bulletConvexPointCloudShape.h"
17 #include "geomVertexReader.h"
19 TypeHandle BulletConvexPointCloudShape::_type_handle;
26 BulletConvexPointCloudShape::
27 BulletConvexPointCloudShape(
const PTA_LVecBase3 &points,
LVecBase3 scale) {
29 btVector3 btScale = LVecBase3_to_btVector3(scale);
32 btVector3 *btPoints =
new btVector3[points.size()];
35 PTA_LVecBase3::const_iterator it;
36 for (it=points.begin(); it!=points.end(); it++) {
37 btPoints[i] = LVecBase3_to_btVector3(*it);
42 _shape =
new btConvexPointCloudShape(btPoints, points.size(), btScale);
43 _shape->setUserPointer(
this);
51 btCollisionShape *BulletConvexPointCloudShape::
62 BulletConvexPointCloudShape::
63 BulletConvexPointCloudShape(
const Geom *geom,
LVecBase3 scale) {
65 btVector3 btScale = LVecBase3_to_btVector3(scale);
73 while (!reader.is_at_end()) {
74 points.push_back(reader.get_data3());
78 btVector3 *btPoints =
new btVector3[points.size()];
82 for (it=points.begin(); it!=points.end(); it++) {
83 btPoints[i] = LVecBase3_to_btVector3(*it);
88 _shape =
new btConvexPointCloudShape(btPoints, points.size(), btScale);
89 _shape->setUserPointer(
this);
This is the base class for all three-component vectors and points.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
TypeHandle is the identifier used to differentiate C++ class types.