Panda3D
Loading...
Searching...
No Matches
config_bullet.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file config_bullet.cxx
10 * @author enn0x
11 * @date 2010-01-23
12 */
13
14#include "config_bullet.h"
15
17#include "bulletBodyNode.h"
18#include "bulletBoxShape.h"
19#include "bulletCapsuleShape.h"
21#include "bulletConeShape.h"
24#include "bulletConstraint.h"
27#include "bulletCylinderShape.h"
29#include "bulletDebugNode.h"
32#include "bulletGhostNode.h"
36#include "bulletPlaneShape.h"
37#include "bulletRigidBodyNode.h"
38#include "bulletShape.h"
40#include "bulletSphereShape.h"
42#include "bulletSoftBodyNode.h"
43#include "bulletSoftBodyShape.h"
45#include "bulletTriangleMesh.h"
47#include "bulletVehicle.h"
48#include "bulletWorld.h"
49
51
52extern ContactAddedCallback gContactAddedCallback;
53extern ContactProcessedCallback gContactProcessedCallback;
54extern ContactDestroyedCallback gContactDestroyedCallback;
55
56#include "dconfig.h"
57#include "pandaSystem.h"
58
59#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDABULLET)
60 #error Buildsystem error: BUILDING_PANDABULLET not defined
61#endif
62
63Configure(config_bullet);
64NotifyCategoryDef(bullet, "");
65
66ConfigureFn(config_bullet) {
68}
69
70ConfigVariableInt bullet_max_objects
71("bullet-max-objects", 1024,
72PRC_DESC("Specifies the maximum number of individual objects within a "
73 "bullet physics world. Default value is 1024."));
74
75ConfigVariableInt bullet_gc_lifetime
76("bullet-gc-lifetime", 256,
77PRC_DESC("Specifies the lifetime of data clean up be the soft body world "
78 "info garbage collector. Default value is 256."));
79
81("bullet-broadphase-algorithm", BulletWorld::BA_dynamic_aabb_tree,
82PRC_DESC("Specifies the broadphase algorithm to be used by the physics "
83 "engine. Default value is 'aabb' (dynamic aabb tree)."));
84
86("bullet-filter-algorithm", BulletWorld::FA_mask,
87PRC_DESC("Specifies the algorithm to be used by the physics engine for "
88 "collision filtering. Default value is 'mask'."));
89
90ConfigVariableDouble bullet_sap_extents
91("bullet-sap-extents", 1000.0,
92PRC_DESC("Specifies the world extent in all directions. The config variable "
93 "is only used if bullet-broadphase-algorithm is set to 'sap' "
94 "(sweep and prune). Default value is 1000.0."));
95
96ConfigVariableBool bullet_enable_contact_events
97("bullet-enable-contact-events", false,
98PRC_DESC("Specifies if events should be send when new contacts are "
99 "created or existing contacts get remove. Warning: enabling "
100 "contact events might create more load on the event queue "
101 "then you might want! Default value is FALSE."));
102
103ConfigVariableBool bullet_split_impulse
104("bullet-split-impulse", false,
105PRC_DESC("Penetrating recovery won't add momentum. "
106 "btContactSolverInfo::m_splitImpulse. Default value is false."));
107
108ConfigVariableInt bullet_solver_iterations
109("bullet-solver-iterations", 10,
110PRC_DESC("Specifies the number of iterations for the Bullet contact "
111 "solver. This is the native Bullet property "
112 "btContactSolverInfo::m_numIterations. Default value is 10."));
113
114ConfigVariableBool bullet_additional_damping
115("bullet-additional-damping", false,
116PRC_DESC("Enables additional damping on eachrigid body, in order to reduce "
117 "jitter. Default value is FALSE. Additional damping is an "
118 "experimental feature of the Bullet physics engine. Use with "
119 "care."));
120
121ConfigVariableDouble bullet_additional_damping_linear_factor
122("bullet-additional-damping-linear-factor", 0.005,
123PRC_DESC("Only used when bullet-additional-damping is set to TRUE. "
124 "Default value is 0.005"));
125
126ConfigVariableDouble bullet_additional_damping_angular_factor
127("bullet-additional-damping-angular-factor", 0.01,
128PRC_DESC("Only used when bullet-additional-damping is set to TRUE. "
129 "Default value is 0.01"));
130
131ConfigVariableDouble bullet_additional_damping_linear_threshold
132("bullet-additional-damping-linear-threshold", 0.01,
133PRC_DESC("Only used when bullet-additional-damping is set to TRUE. "
134 "Default value is 0.01"));
135
136ConfigVariableDouble bullet_additional_damping_angular_threshold
137("bullet-additional-damping-angular-threshold", 0.01,
138PRC_DESC("Only used when bullet-additional-damping is set to TRUE. "
139 "Default value is 0.01."));
140
141/**
142 * Initializes the library. This must be called at least once before any of
143 * the functions or classes in this library can be used. Normally it will be
144 * called by the static initializers and need not be called explicitly, but
145 * special cases exist.
146 */
147void
149
150 static bool initialized = false;
151 if (initialized) {
152 return;
153 }
154 initialized = true;
155
156 // Initialize types
157 BulletBaseCharacterControllerNode::init_type();
158 BulletBodyNode::init_type();
159 BulletBoxShape::init_type();
160 BulletCapsuleShape::init_type();
161 BulletCharacterControllerNode::init_type();
162 BulletConeShape::init_type();
163 BulletConeTwistConstraint::init_type();
164 BulletContactCallbackData::init_type();
165 BulletConstraint::init_type();
166 BulletConvexHullShape::init_type();
167 BulletConvexPointCloudShape::init_type();
168 BulletCylinderShape::init_type();
169 BulletMinkowskiSumShape::init_type();
170 BulletDebugNode::init_type();
171 BulletFilterCallbackData::init_type();
172 BulletGenericConstraint::init_type();
173 BulletGhostNode::init_type();
174 BulletHeightfieldShape::init_type();
175 BulletHingeConstraint::init_type();
176 BulletMultiSphereShape::init_type();
177 BulletPlaneShape::init_type();
178 BulletRigidBodyNode::init_type();
179 BulletShape::init_type();
180 BulletSliderConstraint::init_type();
181 BulletSphereShape::init_type();
182 BulletSphericalConstraint::init_type();
183 BulletSoftBodyNode::init_type();
184 BulletSoftBodyShape::init_type();
185 BulletTickCallbackData::init_type();
186 BulletTriangleMesh::init_type();
187 BulletTriangleMeshShape::init_type();
188 BulletVehicle::init_type();
189 BulletWorld::init_type();
190
191 // Register factory functions for constructing objects from .bam files
206 BulletMinkowskiSumShape::register_with_read_factory();
208
209 // Custom contact callbacks
210 gContactAddedCallback = contact_added_callback;
211 gContactProcessedCallback = contact_processed_callback;
212 gContactDestroyedCallback = contact_destroyed_callback;
213
214 // Initialize notification category
215 bullet_cat.init();
216 if (bullet_cat.is_debug()) {
217 bullet_cat.debug() << "initialize module" << std::endl;
218 }
219
220 // Register the Bullet system
222 ps->add_system("Bullet");
223}
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletDebugNode.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletGhostNode.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletRigidBodyNode.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletTriangleMeshShape.
static void register_with_read_factory()
Tells the BamReader how to create objects of type BulletTriangleMesh.
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating- point type.
This class specializes ConfigVariable as an enumerated type.
This is a convenience class to specialize ConfigVariable as an integer type.
This class is used as a namespace to group several global properties of Panda.
Definition pandaSystem.h:26
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
void init_libbullet()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.