|
@@ -3229,6 +3229,24 @@ VS::BlendShapeMode RasterizerStorageGLES3::mesh_get_blend_shape_mode(RID p_mesh)
|
|
|
return mesh->blend_shape_mode;
|
|
|
}
|
|
|
|
|
|
+uint32_t RasterizerStorageGLES3::mesh_surface_get_stride_in_array(RID p_mesh, int p_surface, int p_array_index) const {
|
|
|
+ Mesh *mesh = mesh_owner.getornull(p_mesh);
|
|
|
+ ERR_FAIL_COND_V(!mesh, 0);
|
|
|
+ ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), 0);
|
|
|
+ ERR_FAIL_INDEX_V(p_array_index, VS::ARRAY_MAX, 0);
|
|
|
+
|
|
|
+ return mesh->surfaces[p_surface]->attribs[p_array_index].stride;
|
|
|
+}
|
|
|
+
|
|
|
+uint32_t RasterizerStorageGLES3::mesh_surface_get_offset_in_array(RID p_mesh, int p_surface, int p_array_index) const {
|
|
|
+ Mesh *mesh = mesh_owner.getornull(p_mesh);
|
|
|
+ ERR_FAIL_COND_V(!mesh, 0);
|
|
|
+ ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), 0);
|
|
|
+ ERR_FAIL_INDEX_V(p_array_index, VS::ARRAY_MAX, 0);
|
|
|
+
|
|
|
+ return mesh->surfaces[p_surface]->attribs[p_array_index].offset;
|
|
|
+}
|
|
|
+
|
|
|
void RasterizerStorageGLES3::mesh_surface_update_region(RID p_mesh, int p_surface, int p_offset, const PoolVector<uint8_t> &p_data) {
|
|
|
|
|
|
Mesh *mesh = mesh_owner.getornull(p_mesh);
|
|
@@ -3240,7 +3258,7 @@ void RasterizerStorageGLES3::mesh_surface_update_region(RID p_mesh, int p_surfac
|
|
|
|
|
|
PoolVector<uint8_t>::Read r = p_data.read();
|
|
|
|
|
|
- glBindBuffer(GL_ARRAY_BUFFER, mesh->surfaces[p_surface]->array_id);
|
|
|
+ glBindBuffer(GL_ARRAY_BUFFER, mesh->surfaces[p_surface]->vertex_id);
|
|
|
glBufferSubData(GL_ARRAY_BUFFER, p_offset, total_size, r.ptr());
|
|
|
glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind
|
|
|
}
|
|
@@ -3404,6 +3422,7 @@ Vector<PoolVector<uint8_t> > RasterizerStorageGLES3::mesh_surface_get_blend_shap
|
|
|
|
|
|
return bsarr;
|
|
|
}
|
|
|
+
|
|
|
Vector<AABB> RasterizerStorageGLES3::mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const {
|
|
|
|
|
|
const Mesh *mesh = mesh_owner.getornull(p_mesh);
|
|
@@ -3455,6 +3474,7 @@ void RasterizerStorageGLES3::mesh_remove_surface(RID p_mesh, int p_surface) {
|
|
|
|
|
|
mesh->instance_change_notify();
|
|
|
}
|
|
|
+
|
|
|
int RasterizerStorageGLES3::mesh_get_surface_count(RID p_mesh) const {
|
|
|
|
|
|
const Mesh *mesh = mesh_owner.getornull(p_mesh);
|
|
@@ -3468,6 +3488,7 @@ void RasterizerStorageGLES3::mesh_set_custom_aabb(RID p_mesh, const AABB &p_aabb
|
|
|
ERR_FAIL_COND(!mesh);
|
|
|
|
|
|
mesh->custom_aabb = p_aabb;
|
|
|
+ mesh->instance_change_notify();
|
|
|
}
|
|
|
|
|
|
AABB RasterizerStorageGLES3::mesh_get_custom_aabb(RID p_mesh) const {
|