diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/visual/rasterizer.h | 10 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 10 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.cpp | 18 | ||||
-rw-r--r-- | servers/visual/visual_server_scene.h | 2 | ||||
-rw-r--r-- | servers/visual_server.h | 16 |
5 files changed, 28 insertions, 28 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 887fc5ac5f..94a514e7c1 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -93,7 +93,7 @@ public: Vector<RID> reflection_probe_instances; Vector<RID> gi_probe_instances; - Vector<float> morph_values; + Vector<float> blend_values; //BakedLightData *baked_light; VS::ShadowCastingSetting cast_shadows; @@ -244,12 +244,12 @@ public: virtual void mesh_add_surface(RID p_mesh,uint32_t p_format,VS::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=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>())=0; - virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount)=0; - virtual int mesh_get_morph_target_count(RID p_mesh) const=0; + virtual void mesh_set_blend_shape_count(RID p_mesh,int p_amount)=0; + virtual int mesh_get_blend_shape_count(RID p_mesh) const=0; - virtual void mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode)=0; - virtual VS::MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const=0; + virtual void mesh_set_blend_shape_mode(RID p_mesh,VS::BlendShapeMode p_mode)=0; + virtual VS::BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const=0; virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material)=0; virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const=0; diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index d9b650d569..5c8105681a 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -673,12 +673,12 @@ public: BIND10(mesh_add_surface,RID,uint32_t,PrimitiveType,const PoolVector<uint8_t>&,int ,const PoolVector<uint8_t>& ,int ,const Rect3&,const Vector<PoolVector<uint8_t> >&,const Vector<Rect3>& ) - BIND2(mesh_set_morph_target_count,RID,int) - BIND1RC(int,mesh_get_morph_target_count,RID) + BIND2(mesh_set_blend_shape_count,RID,int) + BIND1RC(int,mesh_get_blend_shape_count,RID) - BIND2(mesh_set_morph_target_mode,RID,MorphTargetMode) - BIND1RC(MorphTargetMode, mesh_get_morph_target_mode,RID ) + BIND2(mesh_set_blend_shape_mode,RID,BlendShapeMode) + BIND1RC(BlendShapeMode, mesh_get_blend_shape_mode,RID ) BIND3(mesh_surface_set_material,RID, int , RID ) BIND2RC(RID,mesh_surface_get_material,RID, int ) @@ -976,7 +976,7 @@ public: BIND2(instance_set_layer_mask,RID, uint32_t ) BIND2(instance_set_transform,RID, const Transform& ) BIND2(instance_attach_object_instance_ID,RID,ObjectID ) - BIND3(instance_set_morph_target_weight,RID,int , float ) + BIND3(instance_set_blend_shape_weight,RID,int , float ) BIND3(instance_set_surface_material,RID,int , RID ) BIND2(instance_set_visible,RID ,bool) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index 4635b0fcfe..030796a22d 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -470,7 +470,7 @@ void VisualServerScene::instance_set_base(RID p_instance, RID p_base){ instance->base_data=NULL; } - instance->morph_values.clear(); + instance->blend_values.clear(); for(int i=0;i<instance->materials.size();i++) { if (instance->materials[i].is_valid()) { @@ -829,7 +829,7 @@ void VisualServerScene::instance_attach_object_instance_ID(RID p_instance,Object instance->object_ID=p_ID; } -void VisualServerScene::instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight){ +void VisualServerScene::instance_set_blend_shape_weight(RID p_instance,int p_shape, float p_weight){ Instance *instance = instance_owner.get( p_instance ); ERR_FAIL_COND( !instance ); @@ -838,8 +838,8 @@ void VisualServerScene::instance_set_morph_target_weight(RID p_instance,int p_sh _update_dirty_instance(instance); } - ERR_FAIL_INDEX(p_shape,instance->morph_values.size()); - instance->morph_values[p_shape]=p_weight; + ERR_FAIL_INDEX(p_shape,instance->blend_values.size()); + instance->blend_values[p_shape]=p_weight; } void VisualServerScene::instance_set_surface_material(RID p_instance,int p_surface, RID p_material){ @@ -3409,11 +3409,11 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { } p_instance->materials.resize(new_mat_count); - int new_morph_count = VSG::storage->mesh_get_morph_target_count(p_instance->base); - if (new_morph_count!=p_instance->morph_values.size()) { - p_instance->morph_values.resize(new_morph_count); - for(int i=0;i<new_morph_count;i++) { - p_instance->morph_values[i]=0; + int new_blend_shape_count = VSG::storage->mesh_get_blend_shape_count(p_instance->base); + if (new_blend_shape_count!=p_instance->blend_values.size()) { + p_instance->blend_values.resize(new_blend_shape_count); + for(int i=0;i<new_blend_shape_count;i++) { + p_instance->blend_values[i]=0; } } } diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h index fc3ea29b00..1f7de3d005 100644 --- a/servers/visual/visual_server_scene.h +++ b/servers/visual/visual_server_scene.h @@ -491,7 +491,7 @@ public: virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask); virtual void instance_set_transform(RID p_instance, const Transform& p_transform); virtual void instance_attach_object_instance_ID(RID p_instance,ObjectID p_ID); - virtual void instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight); + virtual void instance_set_blend_shape_weight(RID p_instance,int p_shape, float p_weight); virtual void instance_set_surface_material(RID p_instance,int p_surface, RID p_material); virtual void instance_set_visible(RID p_instance,bool p_visible); diff --git a/servers/visual_server.h b/servers/visual_server.h index 3e7240af6f..cb4d87ce8a 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -246,16 +246,16 @@ public: virtual void mesh_add_surface_from_arrays(RID p_mesh,PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes=Array(),uint32_t p_compress_format=ARRAY_COMPRESS_DEFAULT); virtual void mesh_add_surface(RID p_mesh,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=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>())=0; - virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount)=0; - virtual int mesh_get_morph_target_count(RID p_mesh) const=0; + virtual void mesh_set_blend_shape_count(RID p_mesh,int p_amount)=0; + virtual int mesh_get_blend_shape_count(RID p_mesh) const=0; - enum MorphTargetMode { - MORPH_MODE_NORMALIZED, - MORPH_MODE_RELATIVE, + enum BlendShapeMode { + BLEND_SHAPE_MODE_NORMALIZED, + BLEND_SHAPE_MODE_RELATIVE, }; - virtual void mesh_set_morph_target_mode(RID p_mesh,MorphTargetMode p_mode)=0; - virtual MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const=0; + virtual void mesh_set_blend_shape_mode(RID p_mesh,BlendShapeMode p_mode)=0; + virtual BlendShapeMode mesh_get_blend_shape_mode(RID p_mesh) const=0; virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material)=0; virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const=0; @@ -714,7 +714,7 @@ public: virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask)=0; virtual void instance_set_transform(RID p_instance, const Transform& p_transform)=0; virtual void instance_attach_object_instance_ID(RID p_instance,ObjectID p_ID)=0; - virtual void instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight)=0; + virtual void instance_set_blend_shape_weight(RID p_instance,int p_shape, float p_weight)=0; virtual void instance_set_surface_material(RID p_instance,int p_surface, RID p_material)=0; virtual void instance_set_visible(RID p_instance,bool p_visible)=0; |