mirror of https://github.com/godotengine/godot
Merge fbc7f1d478 into 15ff450680
This commit is contained in:
commit
b12c264157
|
|
@ -924,8 +924,19 @@ void GodotPhysicsServer2D::body_get_collision_exceptions(RID p_body, List<RID> *
|
|||
GodotBody2D *body = body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
for (int i = 0; i < body->get_exceptions().size(); i++) {
|
||||
p_exceptions->push_back(body->get_exceptions()[i]);
|
||||
const VSet<RID> &exceptions = body->get_exceptions();
|
||||
LocalVector<RID> invalid_exceptions;
|
||||
for (int i = 0; i < exceptions.size(); i++) {
|
||||
RID exception = exceptions[i];
|
||||
if (body_owner.owns(exception)) {
|
||||
p_exceptions->push_back(exception);
|
||||
} else {
|
||||
invalid_exceptions.push_back(exception);
|
||||
}
|
||||
}
|
||||
|
||||
for (RID invalid_body : invalid_exceptions) {
|
||||
body->remove_exception(invalid_body);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -850,8 +850,19 @@ void GodotPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> *
|
|||
GodotBody3D *body = body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
for (int i = 0; i < body->get_exceptions().size(); i++) {
|
||||
p_exceptions->push_back(body->get_exceptions()[i]);
|
||||
const VSet<RID> &exceptions = body->get_exceptions();
|
||||
LocalVector<RID> invalid_exceptions;
|
||||
for (int i = 0; i < exceptions.size(); i++) {
|
||||
RID exception = exceptions[i];
|
||||
if (body_owner.owns(exception)) {
|
||||
p_exceptions->push_back(exception);
|
||||
} else {
|
||||
invalid_exceptions.push_back(exception);
|
||||
}
|
||||
}
|
||||
|
||||
for (RID invalid_body : invalid_exceptions) {
|
||||
body->remove_exception(invalid_body);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -862,11 +862,22 @@ void JoltPhysicsServer3D::body_remove_collision_exception(RID p_body, RID p_exce
|
|||
}
|
||||
|
||||
void JoltPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) {
|
||||
const JoltBody3D *body = body_owner.get_or_null(p_body);
|
||||
JoltBody3D *body = body_owner.get_or_null(p_body);
|
||||
ERR_FAIL_NULL(body);
|
||||
|
||||
for (const RID &exception : body->get_collision_exceptions()) {
|
||||
const LocalVector<RID> &exceptions = body->get_collision_exceptions();
|
||||
LocalVector<RID> invalid_exceptions;
|
||||
for (uint32_t i = 0; i < exceptions.size(); i++) {
|
||||
RID exception = exceptions[i];
|
||||
if (body_owner.owns(exception)) {
|
||||
p_exceptions->push_back(exception);
|
||||
} else {
|
||||
invalid_exceptions.push_back(exception);
|
||||
}
|
||||
}
|
||||
|
||||
for (RID invalid_body : invalid_exceptions) {
|
||||
body->remove_collision_exception(invalid_body);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue