18 template<
class MaskType>
22 _current(CurrentMask::all_off())
31 template<
class MaskType>
35 _current(parent._current)
44 template<
class MaskType>
48 _current(copy._current)
57 template<
class MaskType>
60 CollisionLevelStateBase::operator = (copy);
61 _current = copy._current;
69 template<
class MaskType>
72 CollisionLevelStateBase::clear();
82 template<
class MaskType>
85 int index = (int)_colliders.size();
86 nassertv(!CurrentMask::has_max_num_bits() ||
87 index <= CurrentMask::get_max_num_bits());
90 _current.set_bit(index);
101 template<
class MaskType>
105 int indent_level = 0;
106 if (collide_cat.is_spam()) {
107 indent_level = _node_path.get_num_nodes() * 2;
109 indent(collide_cat.spam(
false), indent_level)
110 <<
"Considering " << _node_path.get_node_path() <<
"\n";
117 if (node_bv->is_of_type(GeometricBoundingVolume::get_class_type())) {
122 for (
int c = 0; c < num_colliders; c++) {
130 if (!(from_mask & this_mask).is_zero()) {
133 if (pnode == cnode) {
135 if (collide_cat.is_spam()) {
136 indent(collide_cat.spam(
false), indent_level)
137 <<
"Not comparing " << c <<
" to " << _node_path
150 if (col_gbv !=
nullptr) {
151 is_in = (node_gbv->
contains(col_gbv) != 0);
152 _node_volume_pcollector.add_level(1);
155 if (collide_cat.is_spam()) {
156 indent(collide_cat.spam(
false), indent_level)
157 <<
"Comparing " << c <<
": " << *col_gbv
158 <<
" to " << *node_gbv <<
", is_in = " << is_in <<
"\n";
175 if (collide_cat.is_spam()) {
176 int num_active_colliders = 0;
178 for (
int c = 0; c < num_colliders; c++) {
180 num_active_colliders++;
185 indent(collide_cat.spam(
false), indent_level)
186 << _node_path.get_node_path() <<
" has " << num_active_colliders
187 <<
" interested colliders";
188 if (num_colliders != 0) {
189 collide_cat.spam(
false)
191 for (
int c = 0; c < num_colliders; c++) {
194 collide_cat.spam(
false)
195 <<
" " << c <<
". " << cnode->get_name();
198 collide_cat.spam(
false)
201 collide_cat.spam(
false)
205 return has_any_collider();
218 template<
class MaskType>
222 _parent_bounds = _local_bounds;
224 if (node()->is_final()) {
229 BoundingVolumes new_bounds;
232 new_bounds.reserve(num_colliders);
233 for (
int c = 0; c < num_colliders; c++) {
234 new_bounds.push_back(
nullptr);
237 _local_bounds = new_bounds;
245 node_transform->invert_compose(TransformState::make_identity());
246 if (!inv_transform->has_mat()) {
251 const LMatrix4 &mat = inv_transform->get_mat();
254 BoundingVolumes new_bounds;
257 new_bounds.reserve(num_colliders);
258 for (
int c = 0; c < num_colliders; c++) {
260 get_local_bound(c) ==
nullptr) {
261 new_bounds.push_back(
nullptr);
266 new_bound->xform(mat);
267 new_bounds.push_back(new_bound);
271 _local_bounds = new_bounds;
284 template<
class MaskType>
287 return CurrentMask::has_max_num_bits();
296 template<
class MaskType>
299 return CurrentMask::get_max_num_bits();
308 template<
class MaskType>
311 nassertr(n >= 0 && n < (
int)_colliders.size(),
false);
312 return (_current.get_bit(n));
320 template<
class MaskType>
323 return !_current.is_zero();
331 template<
class MaskType>
334 nassertv(n >= 0 && n < (
int)_colliders.size());
337 _current.clear_bit(n);