18 TypeHandle BulletMinkowskiSumShape::_type_handle;
23 BulletMinkowskiSumShape::
28 nassertv(shape_a->is_convex());
29 nassertv(shape_b->is_convex());
31 const btConvexShape *ptr_a = (
const btConvexShape *)shape_a->ptr();
32 const btConvexShape *ptr_b = (
const btConvexShape *)shape_b->ptr();
34 _shape =
new btMinkowskiSumShape(ptr_a, ptr_b);
35 _shape->setUserPointer(
this);
41 BulletMinkowskiSumShape::
45 _shape_a = copy._shape_a;
46 _shape_b = copy._shape_b;
48 const btConvexShape *ptr_a = (
const btConvexShape *)_shape_a->ptr();
49 const btConvexShape *ptr_b = (
const btConvexShape *)_shape_b->ptr();
51 _shape =
new btMinkowskiSumShape(ptr_a, ptr_b);
52 _shape->setUserPointer(
this);
58 btCollisionShape *BulletMinkowskiSumShape::
67 void BulletMinkowskiSumShape::
72 _shape->setTransformA(TransformState_to_btTrans(ts));
78 void BulletMinkowskiSumShape::
83 _shape->setTransformB(TransformState_to_btTrans(ts));
90 get_transform_a()
const {
93 return btTrans_to_TransformState(_shape->getTransformA());
100 get_transform_b()
const {
103 return btTrans_to_TransformState(_shape->GetTransformB());
109 void BulletMinkowskiSumShape::
110 register_with_read_factory() {
144 const btConvexShape *ptr_a = (
const btConvexShape *)_shape_a->ptr();
145 const btConvexShape *ptr_b = (
const btConvexShape *)_shape_b->ptr();
147 _shape =
new btMinkowskiSumShape(ptr_a, ptr_b);
148 _shape->setUserPointer(
this);
149 _shape->setMargin(_margin);
151 set_transform_a(transform_a);
152 set_transform_b(transform_b);
182 param->fillin(scan, manager);
191 void BulletMinkowskiSumShape::
194 nassertv(_shape ==
nullptr);
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
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.
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.
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
Similar to MutexHolder, but for a light mutex.
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.
virtual bool require_fully_complete() const
Some objects require all of their nested pointers to have been completed before the objects themselve...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
CPT(TransformState) BulletMinkowskiSumShape
Tells the BamReader how to create objects of type BulletShape.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.