BulletWorld

class BulletWorld

Bases: TypedReferenceCount

Inheritance diagram

Inheritance diagram of BulletWorld

enum BroadphaseAlgorithm

Configuration

enumerator BA_sweep_and_prune = 0
enumerator BA_dynamic_aabb_tree = 1
enum FilterAlgorithm
enumerator FA_mask = 0
enumerator FA_groups_mask = 1
enumerator FA_callback = 2
BulletWorld(void)
void attach(TypedObject *object)

AttachRemove

void attach_character(BulletBaseCharacterControllerNode *node)

Deprecated: Please use BulletWorld::attach()

void 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.

void attach_ghost(BulletGhostNode *node)

Deprecated methods, will be removed soon

Deprecated: Please use BulletWorld::attach()

void attach_rigid_body(BulletRigidBodyNode *node)

Deprecated: Please use BulletWorld::attach()

void attach_soft_body(BulletSoftBodyNode *node)

Deprecated: Please use BulletWorld::attach()

void attach_vehicle(BulletVehicle *vehicle)

Deprecated: Please use BulletWorld::attach()

void clear_contact_added_callback(void)
void clear_debug_node(void)

Removes a debug node that has been assigned to this BulletWorld.

void clear_filter_callback(void)
void clear_tick_callback(void)
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. 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.

BulletContactResult 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.

int do_physics(PN_stdfloat dt, int max_substeps = 1, PN_stdfloat stepsize = (1.0 / 60.0))
bool filter_test(PandaNode *node0, PandaNode *node1) const

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

BulletBaseCharacterControllerNode *get_character(int idx) const
static TypeHandle get_class_type(void)
BulletConstraint *get_constraint(int idx) const
BulletDebugNode *get_debug_node(void) const
bool get_force_update_all_aabbs(void) const
BulletGhostNode *get_ghost(int idx) const
LVector3 const get_gravity(void) const
bool get_group_collision_flag(unsigned int group1, unsigned int group2) const
BulletPersistentManifold *get_manifold(int idx) const
int get_num_characters(void) const

Character controller

Character controller

Character controller

int get_num_constraints(void) const

Constraint

Constraint

Constraint

int get_num_ghosts(void) const

Ghost object

Ghost object

Ghost object

int get_num_manifolds(void) const

Manifolds

Manifolds

Manifolds

int get_num_rigid_bodies(void) const

Rigid body

Rigid body

Rigid body

int get_num_soft_bodies(void) const

Soft body

Soft body

Soft body

int get_num_vehicles(void) const
BulletRigidBodyNode *get_rigid_body(int idx) const
BulletSoftBodyNode *get_soft_body(int idx) const
BulletVehicle *get_vehicle(int idx) const
BulletSoftBodyWorldInfo get_world_info(void)
bool has_debug_node(void) const
BulletAllHitsRayResult ray_test_all(LPoint3 const &from_pos, LPoint3 const &to_pos, CollideMask const &mask = CollideMask::all_on()) const
BulletClosestHitRayResult ray_test_closest(LPoint3 const &from_pos, LPoint3 const &to_pos, CollideMask const &mask = CollideMask::all_on()) const

Raycast and other queries

void remove(TypedObject *object)
void remove_character(BulletBaseCharacterControllerNode *node)

Deprecated: Please use BulletWorld::remove()

void remove_constraint(BulletConstraint *constraint)

Deprecated: Please use BulletWorld::remove()

void remove_ghost(BulletGhostNode *node)

Deprecated: Please use BulletWorld::remove()

void remove_rigid_body(BulletRigidBodyNode *node)

Deprecated: Please use BulletWorld::remove()

void remove_soft_body(BulletSoftBodyNode *node)

Deprecated: Please use BulletWorld::remove()

void remove_vehicle(BulletVehicle *vehicle)

Deprecated: Please use BulletWorld::remove()

void set_contact_added_callback(CallbackObject *obj)

Callbacks

void set_debug_node(BulletDebugNode *node)

Debug

Debug

void set_filter_callback(CallbackObject *obj)
void set_force_update_all_aabbs(bool force)
void set_gravity(LVector3 const &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)

Collision filtering

void set_tick_callback(CallbackObject *obj, bool is_pretick = false)
BulletClosestHitSweepResult sweep_test_closest(BulletShape *shape, TransformState const &from_ts, TransformState const &to_ts, CollideMask const &mask = CollideMask::all_on(), PN_stdfloat penetration = 0.0) const

Performs a sweep test against all other shapes that match the given group mask. The provided shape must be a convex shape; it is an error to invoke this method using a non-convex shape.