Go to the documentation of this file.
24 BulletCapsuleShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) :
31 _shape =
new btCapsuleShapeX(radius, height);
34 _shape =
new btCapsuleShape(radius, height);
37 _shape =
new btCapsuleShapeZ(radius, height);
40 bullet_cat.error() <<
"invalid up-axis:" << up << std::endl;
45 _shape->setUserPointer(
this);
55 _radius = copy._radius;
56 _height = copy._height;
61 _shape =
new btCapsuleShapeX(_radius, _height);
64 _shape =
new btCapsuleShape(_radius, _height);
67 _shape =
new btCapsuleShapeZ(_radius, _height);
70 bullet_cat.error() <<
"invalid up-axis:" << _up << std::endl;
75 _shape->setUserPointer(
this);
81 btCollisionShape *BulletCapsuleShape::
95 PN_stdfloat radius = solid->get_radius();
97 PN_stdfloat height = (solid->get_point_b() - solid->get_point_a()).length();
123 dg.
add_int8((int8_t)_shape->getUpAxis());
139 param->fillin(scan, manager);
148 void BulletCapsuleShape::
151 nassertv(_shape ==
nullptr);
158 _up = (BulletUpAxis) scan.
get_int8();
162 _shape =
new btCapsuleShapeX(_radius, _height);
165 _shape =
new btCapsuleShape(_radius, _height);
168 _shape =
new btCapsuleShapeZ(_radius, _height);
171 bullet_cat.error() <<
"invalid up-axis:" << _up << std::endl;
176 _shape->setUserPointer(
this);
177 _shape->setMargin(margin);
Similar to MutexHolder, but for a light mutex.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
This implements a solid consisting of a cylinder with hemispherical endcaps, also known as a capsule ...
A class to retrieve the individual data elements previously stored in a Datagram.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
static BulletCapsuleShape * make_from_solid(const CollisionCapsule *solid)
Constructs a new BulletCapsuleShape using the information from a CollisionCapsule from the builtin co...
Base class for objects that can be written to and read from Bam files.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
TypeHandle is the identifier used to differentiate C++ class types.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
int8_t get_int8()
Extracts a signed 8-bit integer.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
void add_int8(int8_t value)
Adds a signed 8-bit integer to the datagram.
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...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...