27BulletConvexHullShape::
28BulletConvexHullShape() {
30 _shape =
new btConvexHullShape(
nullptr, 0);
31 _shape->setUserPointer(
this);
37BulletConvexHullShape::
41 _shape =
new btConvexHullShape(
nullptr, 0);
42 _shape->setUserPointer(
this);
44#if BT_BULLET_VERSION >= 282
45 for (
int i = 0; i < copy._shape->getNumPoints(); ++i) {
46 _shape->addPoint(copy._shape->getUnscaledPoints()[i],
false);
48 _shape->recalcLocalAabb();
50 for (
int i = 0; i < copy._shape->getNumPoints(); ++i) {
51 _shape->addPoint(copy._shape->getUnscaledPoints()[i]);
59btCollisionShape *BulletConvexHullShape::
68void BulletConvexHullShape::
69add_point(
const LPoint3 &p) {
72 _shape->addPoint(LVecBase3_to_btVector3(p));
78void BulletConvexHullShape::
79add_array(
const PTA_LVecBase3 &points) {
85 _shape =
new btConvexHullShape(
nullptr, 0);
86 _shape->setUserPointer(
this);
88 PTA_LVecBase3::const_iterator it;
90#if BT_BULLET_VERSION >= 282
91 for (it = points.begin(); it != points.end(); ++it) {
92 _shape->addPoint(LVecBase3_to_btVector3(*it),
false);
94 _shape->recalcLocalAabb();
96 for (it = points.begin(); it != points.end(); ++it) {
97 _shape->addPoint(LVecBase3_to_btVector3(*it));
105void BulletConvexHullShape::
121 points.push_back(m.xform_point(reader.
get_data3()));
128 _shape =
new btConvexHullShape(
nullptr, 0);
129 _shape->setUserPointer(
this);
133#if BT_BULLET_VERSION >= 282
134 for (it = points.begin(); it != points.end(); ++it) {
135 _shape->addPoint(LVecBase3_to_btVector3(*it),
false);
137 _shape->recalcLocalAabb();
139 for (it = points.begin(); it != points.end(); ++it) {
140 _shape->addPoint(LVecBase3_to_btVector3(*it));
162 unsigned int num_points = _shape->getNumPoints();
165 const btVector3 *points = _shape->getUnscaledPoints();
167 for (
unsigned int i = 0; i < num_points; ++i) {
168 LVecBase3 point = btVector3_to_LVecBase3(points[i]);
169 point.write_datagram(dg);
185 param->fillin(scan, manager);
194void BulletConvexHullShape::
202#if BT_BULLET_VERSION >= 282
203 for (
unsigned int i = 0; i < num_points; ++i) {
205 point.read_datagram(scan);
206 _shape->addPoint(LVecBase3_to_btVector3(point),
false);
208 _shape->recalcLocalAabb();
210 for (
unsigned int i = 0; i < num_points; ++i) {
212 point.read_datagram(scan);
213 _shape->addPoint(LVecBase3_to_btVector3(point));
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
A class to retrieve the individual data elements previously stored in a Datagram.
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
uint32_t get_uint32()
Extracts an unsigned 32-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_uint32(uint32_t value)
Adds an unsigned 32-bit integer to the datagram.
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
bool is_at_end() const
Returns true if the reader is currently at the end of the list of vertices, false otherwise.
const LVecBase3 & get_data3()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
A container for geometry primitives.
Similar to MutexHolder, but for a light mutex.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This is our own Panda specialization on the default STL vector.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.