diff options
Diffstat (limited to 'scene/resources/mesh.cpp')
-rw-r--r-- | scene/resources/mesh.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 3e86daf3a7..06b147ba41 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -594,9 +594,9 @@ bool ArrayMesh::_set(const StringName &p_name, const Variant &p_value) { } ERR_FAIL_COND_V(!d.has("aabb"), false); - Rect3 aabb = d["aabb"]; + AABB aabb = d["aabb"]; - Vector<Rect3> bone_aabb; + Vector<AABB> bone_aabb; if (d.has("skeleton_aabb")) { Array baabb = d["skeleton_aabb"]; bone_aabb.resize(baabb.size()); @@ -676,7 +676,7 @@ bool ArrayMesh::_get(const StringName &p_name, Variant &r_ret) const { d["format"] = VS::get_singleton()->mesh_surface_get_format(mesh, idx); d["aabb"] = VS::get_singleton()->mesh_surface_get_aabb(mesh, idx); - Vector<Rect3> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh, idx); + Vector<AABB> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh, idx); Array arr; for (int i = 0; i < skel_aabb.size(); i++) { arr[i] = skel_aabb[i]; @@ -725,13 +725,13 @@ void ArrayMesh::_get_property_list(List<PropertyInfo> *p_list) const { } } - p_list->push_back(PropertyInfo(Variant::RECT3, "custom_aabb/custom_aabb")); + p_list->push_back(PropertyInfo(Variant::AABB, "custom_aabb/custom_aabb")); } void ArrayMesh::_recompute_aabb() { // regenerate AABB - aabb = Rect3(); + aabb = AABB(); for (int i = 0; i < surfaces.size(); i++) { @@ -742,7 +742,7 @@ void ArrayMesh::_recompute_aabb() { } } -void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const Rect3 &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<Rect3> &p_bone_aabbs) { +void ArrayMesh::add_surface(uint32_t p_format, PrimitiveType p_primitive, const PoolVector<uint8_t> &p_array, int p_vertex_count, const PoolVector<uint8_t> &p_index_array, int p_index_count, const AABB &p_aabb, const Vector<PoolVector<uint8_t> > &p_blend_shapes, const Vector<AABB> &p_bone_aabbs) { Surface s; s.aabb = p_aabb; @@ -772,7 +772,7 @@ void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array & const Vector3 *vtx = r.ptr(); // check AABB - Rect3 aabb; + AABB aabb; for (int i = 0; i < len; i++) { if (i == 0) @@ -926,7 +926,7 @@ void ArrayMesh::surface_update_region(int p_surface, int p_offset, const PoolVec VS::get_singleton()->mesh_surface_update_region(mesh, p_surface, p_offset, p_data); } -void ArrayMesh::surface_set_custom_aabb(int p_idx, const Rect3 &p_aabb) { +void ArrayMesh::surface_set_custom_aabb(int p_idx, const AABB &p_aabb) { ERR_FAIL_INDEX(p_idx, surfaces.size()); surfaces[p_idx].aabb = p_aabb; @@ -942,7 +942,7 @@ Ref<Material> ArrayMesh::surface_get_material(int p_idx) const { void ArrayMesh::add_surface_from_mesh_data(const Geometry::MeshData &p_mesh_data) { VisualServer::get_singleton()->mesh_add_surface_from_mesh_data(mesh, p_mesh_data); - Rect3 aabb; + AABB aabb; for (int i = 0; i < p_mesh_data.vertices.size(); i++) { if (i == 0) @@ -970,18 +970,18 @@ RID ArrayMesh::get_rid() const { return mesh; } -Rect3 ArrayMesh::get_aabb() const { +AABB ArrayMesh::get_aabb() const { return aabb; } -void ArrayMesh::set_custom_aabb(const Rect3 &p_custom) { +void ArrayMesh::set_custom_aabb(const AABB &p_custom) { custom_aabb = p_custom; VS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb); } -Rect3 ArrayMesh::get_custom_aabb() const { +AABB ArrayMesh::get_custom_aabb() const { return custom_aabb; } |