mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
don't flatten together collision nodes with different bitmasks
This commit is contained in:
parent
ca36b0fe57
commit
bdc9dfd5f0
@ -145,9 +145,12 @@ combine_with(PandaNode *other) {
|
|||||||
if (is_exact_type(get_class_type()) &&
|
if (is_exact_type(get_class_type()) &&
|
||||||
other->is_exact_type(get_class_type())) {
|
other->is_exact_type(get_class_type())) {
|
||||||
// Two CollisionNodes can combine, but only if they have the same
|
// Two CollisionNodes can combine, but only if they have the same
|
||||||
// name, because the name is often meaningful.
|
// name, because the name is often meaningful, and only if they
|
||||||
|
// have the same collide masks.
|
||||||
CollisionNode *cother = DCAST(CollisionNode, other);
|
CollisionNode *cother = DCAST(CollisionNode, other);
|
||||||
if (get_name() == cother->get_name()) {
|
if (get_name() == cother->get_name() &&
|
||||||
|
get_from_collide_mask() == cother->get_from_collide_mask() &&
|
||||||
|
get_into_collide_mask() == cother->get_into_collide_mask()) {
|
||||||
const COWPT(CollisionSolid) *solids_begin = &cother->_solids[0];
|
const COWPT(CollisionSolid) *solids_begin = &cother->_solids[0];
|
||||||
const COWPT(CollisionSolid) *solids_end = solids_begin + cother->_solids.size();
|
const COWPT(CollisionSolid) *solids_end = solids_begin + cother->_solids.size();
|
||||||
_solids.insert(_solids.end(), solids_begin, solids_end);
|
_solids.insert(_solids.end(), solids_begin, solids_end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user