Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

CollisionHandlerPusher Class Reference

A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into solid walls. More...

#include "collisionHandlerPusher.h"

Inheritance diagram for CollisionHandlerPusher:
CollisionHandlerPhysical CollisionHandlerEvent CollisionHandler TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase CollisionHandlerFluidPusher PhysicsCollisionHandler

List of all members.

Public Member Functions

virtual TypeHandle force_init_type ()
bool get_horizontal () const
virtual TypeHandle get_type () const
void set_horizontal (bool flag)

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Member Functions

virtual void apply_linear_force (ColliderDef &def, const LVector3 &force)
 This is an optional hook for derived classes to do some work with the ColliderDef and the force vector.
virtual void apply_net_shove (ColliderDef &def, const LVector3 &net_shove, const LVector3 &force_normal)
 This is an optional hook for derived classes to do some work with the ColliderDef and the force vector.
virtual bool handle_entries ()
 Called by the parent class after all collisions have been detected, this manages the various collisions and moves around the nodes as necessary.

Protected Attributes

bool _horizontal

Detailed Description

A specialized kind of CollisionHandler that simply pushes back on things that attempt to move into solid walls.

This is the simplest kind of "real-world" collisions you can have.

Definition at line 29 of file collisionHandlerPusher.h.


Member Function Documentation

void CollisionHandlerPusher::apply_linear_force ( ColliderDef def,
const LVector3 force 
) [protected, virtual]

This is an optional hook for derived classes to do some work with the ColliderDef and the force vector.

Implements CollisionHandlerPhysical.

Reimplemented in PhysicsCollisionHandler.

Definition at line 281 of file collisionHandlerPusher.cxx.

Referenced by handle_entries(), and CollisionHandlerFluidPusher::handle_entries().

void CollisionHandlerPusher::apply_net_shove ( ColliderDef def,
const LVector3 net_shove,
const LVector3 force_normal 
) [protected, virtual]

This is an optional hook for derived classes to do some work with the ColliderDef and the force vector.

Reimplemented in PhysicsCollisionHandler.

Definition at line 270 of file collisionHandlerPusher.cxx.

Referenced by handle_entries(), and CollisionHandlerFluidPusher::handle_entries().

bool CollisionHandlerPusher::handle_entries ( ) [protected, virtual]

Called by the parent class after all collisions have been detected, this manages the various collisions and moves around the nodes as necessary.

The return value is normally true, but it may be false to indicate the CollisionTraverser should disable this handler from being called in the future.

Implements CollisionHandlerPhysical.

Reimplemented in CollisionHandlerFluidPusher.

Definition at line 70 of file collisionHandlerPusher.cxx.

References apply_linear_force(), apply_net_shove(), CollisionEntry::get_all(), CollisionPolygon::get_collision_origin(), CollisionEntry::get_from_node_path(), CollisionEntry::get_into(), CollisionEntry::get_into_node_path(), NodePath::get_transform(), TypedObject::is_exact_type(), LVecBase3f::normalize(), NodePath::set_transform(), and CollisionHandlerPhysical::ColliderDef::updated_transform().

static void CollisionHandlerPusher::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from CollisionHandlerPhysical.

Reimplemented in CollisionHandlerFluidPusher, and PhysicsCollisionHandler.

Definition at line 51 of file collisionHandlerPusher.h.

References CollisionHandlerPhysical::init_type().

Referenced by PhysicsCollisionHandler::init_type(), and CollisionHandlerFluidPusher::init_type().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations