Fixed wrong usage of has_no_area function, closes #10434
This commit is contained in:
parent
8fc6bb8f77
commit
588ffbc08a
|
@ -1048,7 +1048,7 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
|
||||||
VSG::storage->particles_set_emission_transform(p_instance->base, p_instance->transform);
|
VSG::storage->particles_set_emission_transform(p_instance->base, p_instance->transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_instance->aabb.has_no_area()) {
|
if (p_instance->aabb.has_no_surface()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,6 +298,9 @@ RID VisualServer::get_white_texture() {
|
||||||
return white_texture;
|
return white_texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SMALL_VEC2 Vector2(0.00001, 0.00001)
|
||||||
|
#define SMALL_VEC3 Vector3(0.00001, 0.00001, 0.00001)
|
||||||
|
|
||||||
Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_t *p_offsets, uint32_t p_stride, PoolVector<uint8_t> &r_vertex_array, int p_vertex_array_len, PoolVector<uint8_t> &r_index_array, int p_index_array_len, Rect3 &r_aabb, Vector<Rect3> r_bone_aabb) {
|
Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_t *p_offsets, uint32_t p_stride, PoolVector<uint8_t> &r_vertex_array, int p_vertex_array_len, PoolVector<uint8_t> &r_index_array, int p_index_array_len, Rect3 &r_aabb, Vector<Rect3> r_bone_aabb) {
|
||||||
|
|
||||||
PoolVector<uint8_t>::Write vw = r_vertex_array.write();
|
PoolVector<uint8_t>::Write vw = r_vertex_array.write();
|
||||||
|
@ -339,7 +342,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
||||||
aabb = Rect2(src[i], Vector2(0.00001, 0.00001)); //must have a bit of size
|
aabb = Rect2(src[i], SMALL_VEC2); //must have a bit of size
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
aabb.expand_to(src[i]);
|
aabb.expand_to(src[i]);
|
||||||
|
@ -355,7 +358,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
||||||
aabb = Rect2(src[i], Vector2(0.00001, 0.00001)); //must have a bit of size
|
aabb = Rect2(src[i], SMALL_VEC2); //must have a bit of size
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
aabb.expand_to(src[i]);
|
aabb.expand_to(src[i]);
|
||||||
|
@ -385,7 +388,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
||||||
aabb = Rect3(src[i], Vector3(0.00001, 0.00001, 0.00001));
|
aabb = Rect3(src[i], SMALL_VEC3);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
aabb.expand_to(src[i]);
|
aabb.expand_to(src[i]);
|
||||||
|
@ -401,7 +404,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
|
||||||
|
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
|
|
||||||
aabb = Rect3(src[i], Vector3(0.00001, 0.00001, 0.00001));
|
aabb = Rect3(src[i], SMALL_VEC3);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
aabb.expand_to(src[i]);
|
aabb.expand_to(src[i]);
|
||||||
|
@ -733,9 +736,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
|
||||||
|
|
||||||
if (bptr->size.x < 0) {
|
if (bptr->size.x < 0) {
|
||||||
//first
|
//first
|
||||||
bptr[idx] = Rect3();
|
bptr[idx] = Rect3(v, SMALL_VEC3);
|
||||||
bptr[idx].position = v;
|
|
||||||
bptr[idx].size = Vector3(0.00001, 0.00001, 0.00001); //must have at least a bit of size
|
|
||||||
any_valid = true;
|
any_valid = true;
|
||||||
} else {
|
} else {
|
||||||
bptr[idx].expand_to(v);
|
bptr[idx].expand_to(v);
|
||||||
|
|
Loading…
Reference in New Issue