# CollisionPolygon

from pandac.PandaModules import CollisionPolygon

Class : CollisionPolygon
Description :

## Inheritance:

CollisionPolygon: CollisionPlane
CollisionPlane: CollisionSolid
CollisionSolid: CopyOnWriteObject
CopyOnWriteObject: CachedTypedWritableReferenceCount
CachedTypedWritableReferenceCount: TypedWritableReferenceCount
TypedWritableReferenceCount: TypedWritable ReferenceCount
TypedWritable: TypedObject
TypedObject: MemoryBase
MemoryBase:
ReferenceCount: MemoryBase

## Methods of CollisionPolygon:

getClassType
getNumPoints
getPoint
isConcave
isValid
verifyPoints

## Methods of CollisionPlane:

distToPlane
getClassType
getNormal
getPlane
setPlane

## Methods of CollisionSolid:

clearEffectiveNormal
getBounds
getClassType
getCollisionOrigin
getEffectiveNormal
getRespectEffectiveNormal
hasEffectiveNormal
isTangible
output
setEffectiveNormal
setRespectEffectiveNormal
setTangible
write

## Methods of CopyOnWriteObject:

getClassType

## Methods of CachedTypedWritableReferenceCount:

cacheRef
cacheUnref
getCacheRefCount
getClassType
testRefCountIntegrity

## Methods of TypedWritableReferenceCount:

getClassType

## Methods of TypedWritable:

getClassType

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

## Methods of ReferenceCount:

getClassType
getRefCount
ref
testRefCountIntegrity
testRefCountNonzero
unref

getClassType static TypeHandle CollisionPolygon::get_class_type(void); Undocumented function.

getNumPoints int CollisionPolygon::get_num_points(void) const; Description: Returns the number of vertices of the CollisionPolygon.

getPoint LPoint3f CollisionPolygon::get_point(int n) const; Description: Returns the nth vertex of the CollisionPolygon, expressed in 3-D space.

isConcave bool CollisionPolygon::is_concave(void) const; Description: Returns true if the CollisionPolygon appears to be concave, or false if it is safely convex.

isValid bool CollisionPolygon::is_valid(void) const; Description: Returns true if the CollisionPolygon is valid (that is, it has at least three vertices), or false otherwise.

verifyPoints static bool CollisionPolygon::verify_points(LPoint3f const &a, LPoint3f const &b, LPoint3f const &c); Description: Verifies that the indicated set of points will define a valid CollisionPolygon: that is, at least three non-collinear points, with no points repeated. This does not check that the polygon defined is convex; that check is made later, once we have projected the points to 2-d space where the decision is easier.

distToPlane float CollisionPlane::dist_to_plane(LPoint3f const &point) const; Description:

getClassType static TypeHandle CollisionPlane::get_class_type(void); Undocumented function.

getNormal LVector3f CollisionPlane::get_normal(void) const; Description:

getPlane Planef const &CollisionPlane::get_plane(void) const; Description:

setPlane void CollisionPlane::set_plane(Planef const &plane); Description:

clearEffectiveNormal void CollisionSolid::clear_effective_normal(void); Description: Removes the normal previously set by set_effective_normal().

getBounds ConstPointerTo< BoundingVolume > CollisionSolid::get_bounds(void) const; Description: Returns the solid's bounding volume.

getClassType static TypeHandle CollisionSolid::get_class_type(void); Undocumented function.

getCollisionOrigin virtual LPoint3f CollisionSolid::get_collision_origin(void) const = 0; Undocumented function.

getEffectiveNormal LVector3f const &CollisionSolid::get_effective_normal(void) const; Description: Returns the normal that was set by set_effective_normal(). It is an error to call this unless has_effective_normal() returns true.

getRespectEffectiveNormal bool CollisionSolid::get_respect_effective_normal(void) const; Description: See set_respect_effective_normal().

hasEffectiveNormal bool CollisionSolid::has_effective_normal(void) const; Description: Returns true if a special normal was set by set_effective_normal(), false otherwise.

isTangible bool CollisionSolid::is_tangible(void) const; Description: 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.

output virtual void CollisionSolid::output(ostream &out) const; Description:

setEffectiveNormal void CollisionSolid::set_effective_normal(LVector3f const &effective_normal); Description: 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.

setRespectEffectiveNormal void CollisionSolid::set_respect_effective_normal(bool respect_effective_normal); Description: 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 void CollisionSolid::set_tangible(bool tangible); Filename: collisionSolid.I Created by: drose (27Jun00) PANDA 3D SOFTWARE Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved All use of this software is subject to the terms of the Panda 3d Software license. You should have received a copy of this license along with this source code; you will also find a current copy of the license at http://etc.cmu.edu/panda3d/docs/license/ . To contact the maintainers of this program write to panda3d-general@lists.sourceforge.net . Description: 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.

write virtual void CollisionSolid::write(ostream &out, int indent_level = (0)) const; Description:

getClassType static TypeHandle CopyOnWriteObject::get_class_type(void); Undocumented function.

cacheRef void CachedTypedWritableReferenceCount::cache_ref(void) const; Description: Explicitly increments the reference count. 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.

cacheUnref bool CachedTypedWritableReferenceCount::cache_unref(void) const; Description: 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; plus, we don't have a virtual destructor anyway.) 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.

getCacheRefCount int CachedTypedWritableReferenceCount::get_cache_ref_count(void) const; Description: Returns the current reference count.

getClassType static TypeHandle CachedTypedWritableReferenceCount::get_class_type(void); Undocumented function.

testRefCountIntegrity bool CachedTypedWritableReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus.

getClassType static TypeHandle TypedWritableReferenceCount::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedWritable::get_class_type(void); Undocumented function.

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: 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().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.

getClassType static TypeHandle ReferenceCount::get_class_type(void); Undocumented function.

getRefCount int ReferenceCount::get_ref_count(void) const; Description: Returns the current reference count.

ref void ReferenceCount::ref(void) const; Description: 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.

testRefCountIntegrity bool ReferenceCount::test_ref_count_integrity(void) const; Description: Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise.

testRefCountNonzero bool ReferenceCount::test_ref_count_nonzero(void) const; Description: Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise.

unref bool ReferenceCount::unref(void) const; Description: 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; plus, we don't have a virtual destructor anyway.) 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.