Panda3D
|
This implements a solid roughly in cylindrical shape. More...
Public Member Functions | |
CollisionTube (Point3 const a, Point3 const db, float radius) | |
CollisionTube (float ax, float ay, float az, float bx, float by, float bz, float radius) | |
cacheRef () | |
See CachedTypedWritableReferenceCount.cache_ref(). | |
bool | cacheUnref () |
Explicitly decrements the cache reference count and the normal reference count simultaneously. | |
clearEffectiveNormal () | |
Removes the normal previously set by set_effective_normal(). | |
string | encodeToBamStream () |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. | |
bool | encodeToBamStream (basic_stringchar data, BamWriter writer) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
bool | encodeToBamStream (basic_stringchar data) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
UpdateSeq | getBamModified () |
Returns the current bam_modified counter. | |
BoundingVolume const | getBounds () |
Returns the solid's bounding volume. | |
int | getCacheRefCount () |
Returns the current reference count. | |
Point3 | getCollisionOrigin () |
Vec3 const | getEffectiveNormal () |
Returns the normal that was set by set_effective_normal(). | |
Point3 const | getPointA () |
Point3 const | getPointB () |
float | getRadius () |
int | getRefCount () |
Returns the current reference count. | |
bool | getRespectEffectiveNormal () |
See set_respect_effective_normal(). | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | hasEffectiveNormal () |
Returns true if a special normal was set by set_effective_normal(), false otherwise. | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. | |
bool | isTangible () |
Returns whether the solid is considered 'tangible' or not. | |
markBamModified () | |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
output (ostream out) | |
PyObject | reduce (PyObject self) |
This special Python method is implement to provide support for the pickle module. | |
PyObject | reducePersist (PyObject self, PyObject pickler) |
This special Python method is implement to provide support for the pickle module. | |
ref () | |
Explicitly increments the reference count. | |
setBounds (BoundingVolume const bounding_volume) | |
Returns the solid's bounding volume. | |
setEffectiveNormal (Vec3 const effective_normal) | |
Records a false normal for this CollisionSolid that will be reported by the collision system with all collisions into it, instead of its actual normal. | |
setPointA (float x, float y, float z) | |
setPointA (Point3 const a) | |
setPointB (float x, float y, float z) | |
setPointB (Point3 const b) | |
setRadius (float radius) | |
setRespectEffectiveNormal (bool respect_effective_normal) | |
This is only meaningful for CollisionSolids that will be added to a traverser as colliders. | |
setTangible (bool tangible) | |
Sets the current state of the 'tangible' flag. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
bool | unref () |
Explicitly decrements the reference count. | |
write (ostream out) | |
write (ostream out, int indent_level) | |
Static Public Member Functions | |
static TypedWritableReferenceCount | decodeFromBamStream (string data, BamReader reader) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypedWritableReferenceCount | decodeFromBamStream (string data) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypeHandle | getClassType () |
This implements a solid roughly in cylindrical shape.
It's not called a CollisionCylinder because it's not a true cylinder; specifically, it has rounded ends instead of flat ends. It looks more like a Contac pill.
CollisionTube | ( | Point3 const | a, |
Point3 const | db, | ||
float | radius | ||
) |
CollisionTube | ( | float | ax, |
float | ay, | ||
float | az, | ||
float | bx, | ||
float | by, | ||
float | bz, | ||
float | radius | ||
) |
cacheRef | ( | ) | [inherited] |
See CachedTypedWritableReferenceCount.cache_ref().
Reimplemented from CachedTypedWritableReferenceCount.
bool cacheUnref | ( | ) | [inherited] |
Explicitly decrements the cache reference count and the normal reference count simultaneously.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in TransformState, and RenderState.
clearEffectiveNormal | ( | ) | [inherited] |
Removes the normal previously set by set_effective_normal().
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data, |
BamReader | reader | ||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data | ) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
string encodeToBamStream | ( | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data, |
BamWriter | writer | ||
) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
UpdateSeq getBamModified | ( | ) | [inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
BoundingVolume const getBounds | ( | ) | [inherited] |
Returns the solid's bounding volume.
int getCacheRefCount | ( | ) | [inherited] |
Returns the current reference count.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from CollisionSolid.
Point3 getCollisionOrigin | ( | ) | [inherited] |
Vec3 const getEffectiveNormal | ( | ) | [inherited] |
Returns the normal that was set by set_effective_normal().
It is an error to call this unless has_effective_normal() returns true.
Point3 const getPointA | ( | ) |
Point3 const getPointB | ( | ) |
float getRadius | ( | ) |
int getRefCount | ( | ) | [inherited] |
Returns the current reference count.
bool getRespectEffectiveNormal | ( | ) | [inherited] |
See set_respect_effective_normal().
TypeHandle getType | ( | ) | [inherited] |
Reimplemented in AnimChannelBase.
int getTypeIndex | ( | ) | [inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
bool hasEffectiveNormal | ( | ) | [inherited] |
Returns true if a special normal was set by set_effective_normal(), false otherwise.
bool isExactType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is the indicated type exactly.
bool isOfType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is or derives from the indicated type.
bool isTangible | ( | ) | [inherited] |
Returns whether the solid is considered 'tangible' or not.
An intangible solid has no effect in a CollisionHandlerPusher (except to throw an event); it's useful for defining 'trigger' planes and spheres, that cause an effect when passed through.
markBamModified | ( | ) | [inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
output | ( | ostream | out | ) | [inherited] |
PyObject reduce | ( | PyObject | self | ) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This hooks into the native pickle and cPickle modules, but it cannot properly handle self-referential BAM objects.
PyObject reducePersist | ( | PyObject | self, |
PyObject | pickler | ||
) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This is similar to __reduce__, but it provides additional support for the missing persistent-state object needed to properly support self-referential BAM objects written to the pickle stream. This hooks into the pickle and cPickle modules implemented in direct/src/stdpy.
ref | ( | ) | [inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
setBounds | ( | BoundingVolume const | bounding_volume | ) | [inherited] |
Returns the solid's bounding volume.
setEffectiveNormal | ( | Vec3 const | effective_normal | ) | [inherited] |
Records a false normal for this CollisionSolid that will be reported by the collision system with all collisions into it, instead of its actual normal.
This is useful as a workaround for the problem of an avatar wanting to stand on a sloping ground; by storing a false normal, the ground appears to be perfectly level, and the avatar does not tend to slide down it.
setPointA | ( | float | x, |
float | y, | ||
float | z | ||
) |
setPointA | ( | Point3 const | a | ) |
setPointB | ( | float | x, |
float | y, | ||
float | z | ||
) |
setPointB | ( | Point3 const | b | ) |
setRadius | ( | float | radius | ) |
setRespectEffectiveNormal | ( | bool | respect_effective_normal | ) | [inherited] |
This is only meaningful for CollisionSolids that will be added to a traverser as colliders.
It is normally true, but if set false, it means that this particular solid does not care about the "effective" normal of other solids it meets, but rather always uses the true normal.
setTangible | ( | bool | tangible | ) | [inherited] |
Sets the current state of the 'tangible' flag.
Set this true to make the solid tangible, so that a CollisionHandlerPusher will not allow another object to intersect it, or false to make it intangible, so that a CollisionHandlerPusher will ignore it except to throw an event.
bool testRefCountIntegrity | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Reimplemented from ReferenceCount.
Reimplemented in NodeCachedReferenceCount.
bool testRefCountNonzero | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
bool unref | ( | ) | [inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.
write | ( | ostream | out | ) | [inherited] |