Panda3D
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
BulletWorld Class Reference
Inheritance diagram for BulletWorld:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

Public Types

enum  BroadphaseAlgorithm { BA_sweep_and_prune, BA_dynamic_aabb_tree }
 
enum  FilterAlgorithm { FA_mask, FA_groups_mask, FA_callback }
 

Public Member Functions

void attach (TypedObject *object)
 
void attach_character (BulletBaseCharacterControllerNode *node)
 Deprecated! Please use BulletWorld::attach. More...
 
void attach_constraint (BulletConstraint *constraint, bool linked_collision=false)
 Attaches a single constraint to a world. More...
 
void attach_ghost (BulletGhostNode *node)
 Deprecated! Please use BulletWorld::attach. More...
 
void attach_rigid_body (BulletRigidBodyNode *node)
 Deprecated! Please use BulletWorld::attach. More...
 
void attach_soft_body (BulletSoftBodyNode *node)
 Deprecated! Please use BulletWorld::attach. More...
 
void attach_vehicle (BulletVehicle *vehicle)
 Deprecated! Please use BulletWorld::attach. More...
 
void clear_contact_added_callback ()
 
void clear_debug_node ()
 
void clear_filter_callback ()
 
void clear_tick_callback ()
 
BulletContactResult contact_test (PandaNode *node, bool use_filter=false) const
 Performas a test for all bodies which are currently in contact with the given body. More...
 
BulletContactResult contact_test_pair (PandaNode *node0, PandaNode *node1) const
 Performas a test if the two bodies given as parameters are in contact or not. More...
 
int do_physics (PN_stdfloat dt, int max_substeps=1, PN_stdfloat stepsize=1.0f/60.0f)
 
bool filter_test (PandaNode *node0, PandaNode *node1) const
 Performs a test if two bodies should collide or not, based on the collision filter setting. More...
 
virtual TypeHandle force_init_type ()
 
btBroadphaseInterface * get_broadphase () const
 
BulletBaseCharacterControllerNodeget_character (int idx) const
 
BulletConstraintget_constraint (int idx) const
 
BulletDebugNodeget_debug_node () const
 
btDispatcher * get_dispatcher () const
 
BulletGhostNodeget_ghost (int idx) const
 
const LVector3 get_gravity () const
 
bool get_group_collision_flag (unsigned int group1, unsigned int group2) const
 
BulletPersistentManifoldget_manifold (int idx) const
 
int get_num_characters () const
 
int get_num_constraints () const
 
int get_num_ghosts () const
 
int get_num_manifolds () const
 
int get_num_rigid_bodies () const
 
int get_num_soft_bodies () const
 
int get_num_vehicles () const
 
BulletRigidBodyNodeget_rigid_body (int idx) const
 
BulletSoftBodyNodeget_soft_body (int idx) const
 
virtual TypeHandle get_type () const
 
BulletVehicleget_vehicle (int idx) const
 
btDynamicsWorld * get_world () const
 
BulletSoftBodyWorldInfo get_world_info ()
 
 MAKE_SEQ (get_ghosts, get_num_ghosts, get_ghost)
 
 MAKE_SEQ (get_rigid_bodies, get_num_rigid_bodies, get_rigid_body)
 
 MAKE_SEQ (get_soft_bodies, get_num_soft_bodies, get_soft_body)
 
 MAKE_SEQ (get_characters, get_num_characters, get_character)
 
 MAKE_SEQ (get_vehicles, get_num_vehicles, get_vehicle)
 
 MAKE_SEQ (get_constraints, get_num_constraints, get_constraint)
 
 MAKE_SEQ (get_manifolds, get_num_manifolds, get_manifold)
 
BulletAllHitsRayResult ray_test_all (const LPoint3 &from_pos, const LPoint3 &to_pos, const CollideMask &mask=CollideMask::all_on()) const
 
BulletClosestHitRayResult ray_test_closest (const LPoint3 &from_pos, const LPoint3 &to_pos, const CollideMask &mask=CollideMask::all_on()) const
 
void remove (TypedObject *object)
 
void remove_character (BulletBaseCharacterControllerNode *node)
 Deprecated. More...
 
void remove_constraint (BulletConstraint *constraint)
 Deprecated. More...
 
void remove_ghost (BulletGhostNode *node)
 Deprecated. More...
 
void remove_rigid_body (BulletRigidBodyNode *node)
 Deprecated. More...
 
void remove_soft_body (BulletSoftBodyNode *node)
 Deprecated. More...
 
void remove_vehicle (BulletVehicle *vehicle)
 Deprecated. More...
 
void set_contact_added_callback (CallbackObject *obj)
 
void set_debug_node (BulletDebugNode *node)
 
void set_filter_callback (CallbackObject *obj)
 
void set_gravity (const LVector3 &gravity)
 
void set_gravity (PN_stdfloat gx, PN_stdfloat gy, PN_stdfloat gz)
 
void set_group_collision_flag (unsigned int group1, unsigned int group2, bool enable)
 
void set_tick_callback (CallbackObject *obj, bool is_pretick=false)
 
BulletClosestHitSweepResult sweep_test_closest (BulletShape *shape, const TransformState &from_ts, const TransformState &to_ts, const CollideMask &mask=CollideMask::all_on(), PN_stdfloat penetration=0.0f) const
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static btCollisionObject * get_collision_object (PandaNode *node)
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
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. More...
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

Definition at line 52 of file bulletWorld.h.

Member Function Documentation

◆ attach_character()

void BulletWorld::attach_character ( BulletBaseCharacterControllerNode node)

Deprecated! Please use BulletWorld::attach.

Definition at line 511 of file bulletWorld.cxx.

References remove_character().

Referenced by remove_ghost().

◆ attach_constraint()

void BulletWorld::attach_constraint ( BulletConstraint constraint,
bool  linked_collision = false 
)

Attaches a single constraint to a world.

Collision checks between the linked objects will be disabled if the second parameter is set to TRUE.

Definition at line 616 of file bulletWorld.cxx.

References remove_constraint().

Referenced by remove_vehicle().

◆ attach_ghost()

void BulletWorld::attach_ghost ( BulletGhostNode node)

Deprecated! Please use BulletWorld::attach.

Definition at line 441 of file bulletWorld.cxx.

References remove_ghost().

Referenced by remove_soft_body().

◆ attach_rigid_body()

void BulletWorld::attach_rigid_body ( BulletRigidBodyNode node)

Deprecated! Please use BulletWorld::attach.

Definition at line 333 of file bulletWorld.cxx.

References remove_rigid_body().

◆ attach_soft_body()

void BulletWorld::attach_soft_body ( BulletSoftBodyNode node)

Deprecated! Please use BulletWorld::attach.

Definition at line 385 of file bulletWorld.cxx.

References remove_soft_body().

Referenced by remove_rigid_body().

◆ attach_vehicle()

void BulletWorld::attach_vehicle ( BulletVehicle vehicle)

Deprecated! Please use BulletWorld::attach.

Definition at line 565 of file bulletWorld.cxx.

References remove_vehicle().

Referenced by remove_character().

◆ contact_test()

BulletContactResult BulletWorld::contact_test ( PandaNode node,
bool  use_filter = false 
) const

Performas a test for all bodies which are currently in contact with the given body.

The test returns a BulletContactResult object which may contain zero, one or more contacts.

If the optional parameter use_filter is set to TRUE this test will consider filter settings. Otherwise all objects in contact are reported, no matter if they would collide or not.

Definition at line 761 of file bulletWorld.cxx.

References contact_test_pair().

Referenced by filter_test().

◆ contact_test_pair()

BulletContactResult BulletWorld::contact_test_pair ( PandaNode node0,
PandaNode node1 
) const

Performas a test if the two bodies given as parameters are in contact or not.

The test returns a BulletContactResult object which may contain zero or one contacts.

Definition at line 789 of file bulletWorld.cxx.

References CallbackObject::do_callback(), BitMask< WType, nbits >::get_bit(), PandaNode::get_into_collide_mask(), and TypedObject::is_of_type().

Referenced by contact_test().

◆ filter_test()

bool BulletWorld::filter_test ( PandaNode node0,
PandaNode node1 
) const

Performs a test if two bodies should collide or not, based on the collision filter setting.

Definition at line 726 of file bulletWorld.cxx.

References contact_test().

Referenced by remove_constraint().

◆ remove_character()

void BulletWorld::remove_character ( BulletBaseCharacterControllerNode node)

Deprecated.

! Please use BulletWorld::remove

Definition at line 540 of file bulletWorld.cxx.

References attach_vehicle().

Referenced by attach_character().

◆ remove_constraint()

void BulletWorld::remove_constraint ( BulletConstraint constraint)

Deprecated.

! Please use BulletWorld::remove

Definition at line 640 of file bulletWorld.cxx.

References BulletClosestHitRayResult::empty(), BulletClosestHitSweepResult::empty(), BulletAllHitsRayResult::empty(), filter_test(), and LVecBase3f::is_nan().

Referenced by attach_constraint().

◆ remove_ghost()

void BulletWorld::remove_ghost ( BulletGhostNode node)

Deprecated.

! Please use BulletWorld::remove

Definition at line 485 of file bulletWorld.cxx.

References attach_character().

Referenced by attach_ghost().

◆ remove_rigid_body()

void BulletWorld::remove_rigid_body ( BulletRigidBodyNode node)

Deprecated.

! Please use BulletWorld::remove

Definition at line 359 of file bulletWorld.cxx.

References attach_soft_body().

Referenced by attach_rigid_body(), and remove_vehicle().

◆ remove_soft_body()

void BulletWorld::remove_soft_body ( BulletSoftBodyNode node)

Deprecated.

! Please use BulletWorld::remove

Definition at line 415 of file bulletWorld.cxx.

References attach_ghost().

Referenced by attach_soft_body().

◆ remove_vehicle()

void BulletWorld::remove_vehicle ( BulletVehicle vehicle)

Deprecated.

! Please use BulletWorld::remove

Definition at line 589 of file bulletWorld.cxx.

References attach_constraint(), BulletVehicle::get_chassis(), and remove_rigid_body().

Referenced by attach_vehicle().


The documentation for this class was generated from the following files: