26BulletConeShape(PN_stdfloat radius, PN_stdfloat height, BulletUpAxis up) :
33 _shape =
new btConeShapeX((btScalar)radius, (btScalar)height);
36 _shape =
new btConeShape((btScalar)radius, (btScalar)height);
39 _shape =
new btConeShapeZ((btScalar)radius, (btScalar)height);
42 bullet_cat.error() <<
"invalid up-axis:" << up << std::endl;
47 _shape->setUserPointer(
this);
58 _radius = copy._radius;
59 _height = copy._height;
63 _shape =
new btConeShapeX((btScalar)_radius, (btScalar)_height);
66 _shape =
new btConeShape((btScalar)_radius, (btScalar)_height);
69 _shape =
new btConeShapeZ((btScalar)_radius, (btScalar)_height);
72 bullet_cat.error() <<
"invalid up-axis:" << _up << std::endl;
77 _shape->setUserPointer(
this);
83btCollisionShape *BulletConeShape::
125 param->fillin(scan, manager);
134void BulletConeShape::
137 nassertv(_shape ==
nullptr);
144 _up = (BulletUpAxis) scan.
get_int8();
148 _shape =
new btConeShapeX((btScalar)_radius, (btScalar)_height);
151 _shape =
new btConeShape((btScalar)_radius, (btScalar)_height);
154 _shape =
new btConeShapeZ((btScalar)_radius, (btScalar)_height);
157 bullet_cat.error() <<
"invalid up-axis:" << _up << std::endl;
162 _shape->setUserPointer(
this);
163 _shape->setMargin(margin);
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 ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
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...
int8_t get_int8()
Extracts a signed 8-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
void add_int8(int8_t value)
Adds a signed 8-bit integer to the datagram.
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.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.