CollisionEntry

class CollisionEntry

Bases: TypedWritableReferenceCount

Defines a single collision event. One of these is created for each collision detected by a CollisionTraverser, to be dealt with by the CollisionHandler.

A CollisionEntry provides slots for a number of data values (such as intersection point and normal) that might or might not be known for each collision. It is up to the handler to determine what information is known and to do the right thing with it.

Inheritance diagram

Inheritance diagram of CollisionEntry

CollisionEntry.collided()

returns true if this represents an actual collision as opposed to a potential collision, needed for iterative collision resolution where path of collider changes mid-frame

CollisionEntry.get_all()

Simultaneously transforms the surface point, surface normal, and interior point of the collision into the indicated coordinate space.

Returns true if all three properties are available, or false if any one of them is not.

CollisionEntry.get_all_contact_info()

Simultaneously transforms the contact position and contact normal of the collision into the indicated coordinate space.

Returns true if all three properties are available, or false if any one of them is not.

static CollisionEntry.get_class_type()
CollisionEntry.get_contact_normal()

Returns the surface normal of the “into” object at the contact position.

The normal will be converted into whichever coordinate space the caller specifies.

CollisionEntry.get_contact_pos()

Returns the position of the “from” object at the instant that a collision is first detected.

The position will be converted into whichever coordinate space the caller specifies.

CollisionEntry.get_from()

Returns the CollisionSolid pointer for the particular solid that triggered this collision.

CollisionEntry.get_from_node()

Returns the node that contains the CollisionSolid that triggered this collision. This will be a node that has been added to a CollisionTraverser via add_collider().

CollisionEntry.get_from_node_path()

Returns the NodePath that represents the CollisionNode that contains the CollisionSolid that triggered this collision. This will be a NodePath that has been added to a CollisionTraverser via add_collider().

CollisionEntry.get_interior_point()

Returns the point, within the interior of the “into” object, which represents the depth to which the “from” object has penetrated. This can also be described as the intersection point on the surface of the “from” object (which is inside the “into” object). It can be thought of as the deepest point of intersection.

The point will be converted into whichever coordinate space the caller specifies.

CollisionEntry.get_into()

Returns the CollisionSolid pointer for the particular solid was collided into. This pointer might be NULL if the collision was into a piece of visible geometry, instead of a normal CollisionSolid collision; see has_into().

CollisionEntry.get_into_node()

Returns the node that contains the CollisionSolid that was collided into. This returns a PandaNode pointer instead of something more specific, because it might be either a CollisionNode or a GeomNode.

Also see get_into_node_path().

CollisionEntry.get_into_node_path()

Returns the NodePath that represents the specific CollisionNode or GeomNode instance that was collided into. This is the same node returned by get_into_node(), represented as a NodePath; however, it may be more useful because the NodePath can resolve the particular instance of the node, if there is more than one.

CollisionEntry.get_respect_prev_transform()

Returns true if the collision was detected by a CollisionTraverser whose respect_prev_transform flag was set true, meaning we should consider motion significant in evaluating collisions.

CollisionEntry.get_surface_normal()

Returns the surface normal of the “into” object at the point at which a collision is detected.

The normal will be converted into whichever coordinate space the caller specifies.

CollisionEntry.get_surface_point()

Returns the point, on the surface of the “into” object, at which a collision is detected. This can be thought of as the first point of intersection. However the contact point is the actual first point of intersection.

The point will be converted into whichever coordinate space the caller specifies.

CollisionEntry.get_t()

returns time value for this collision relative to other CollisionEntries

CollisionEntry.has_contact_normal()

Returns true if the contact normal has been specified, false otherwise. See get_contact_normal(). Some types of collisions may not compute the contact normal.

CollisionEntry.has_contact_pos()

Returns true if the contact position has been specified, false otherwise. See get_contact_pos(). Some types of collisions may not compute the contact pos.

CollisionEntry.has_interior_point()

Returns true if the interior point has been specified, false otherwise. See get_interior_point(). Some types of collisions may not compute the interior point.

CollisionEntry.has_into()

Returns true if the “into” solid is, in fact, a CollisionSolid, and its pointer is known (in which case get_into() may be called to retrieve it). If this returns false, the collision was detected into a GeomNode, and there is no CollisionSolid pointer to be retrieved.

CollisionEntry.has_surface_normal()

Returns true if the surface normal has been specified, false otherwise. See get_surface_normal(). Some types of collisions may not compute the surface normal.

CollisionEntry.has_surface_point()

Returns true if the surface point has been specified, false otherwise. See get_surface_point(). Some types of collisions may not compute the surface point.

CollisionEntry.output()
CollisionEntry.reset_collided()

prepare for another collision test

CollisionEntry.set_contact_normal()

Stores the surface normal of the “into” object at the contact pos.

This normal is specified in the coordinate space of the “into” object.

CollisionEntry.set_contact_pos()

Stores the position of the “from” object at the instant at which the collision is first detected.

This position is specified in the coordinate space of the “into” object.

CollisionEntry.set_interior_point()

Stores the point, within the interior of the “into” object, which represents the depth to which the “from” object has penetrated. This can also be described as the intersection point on the surface of the “from” object (which is inside the “into” object).

This point is specified in the coordinate space of the “into” object.

CollisionEntry.set_surface_normal()

Stores the surface normal of the “into” object at the point of the intersection.

This normal is specified in the coordinate space of the “into” object.

CollisionEntry.set_surface_point()

Stores the point, on the surface of the “into” object, at which a collision is detected.

This point is specified in the coordinate space of the “into” object.

CollisionEntry.set_t()

Sets a time value for this collision relative to other CollisionEntries

CollisionEntry.write()