You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Merge pull request #72075 from Maran23/extents-to-size
Replace Extents with Size in VoxelGI, ReflectionProbe, FogVolume, Decal and GPUParticles*3D
This commit is contained in:
@@ -1066,14 +1066,14 @@ void LightStorage::reflection_probe_set_max_distance(RID p_probe, float p_distan
|
||||
reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE);
|
||||
}
|
||||
|
||||
void LightStorage::reflection_probe_set_extents(RID p_probe, const Vector3 &p_extents) {
|
||||
void LightStorage::reflection_probe_set_size(RID p_probe, const Vector3 &p_size) {
|
||||
ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_probe);
|
||||
ERR_FAIL_COND(!reflection_probe);
|
||||
|
||||
if (reflection_probe->extents == p_extents) {
|
||||
if (reflection_probe->size == p_size) {
|
||||
return;
|
||||
}
|
||||
reflection_probe->extents = p_extents;
|
||||
reflection_probe->size = p_size;
|
||||
reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE);
|
||||
}
|
||||
|
||||
@@ -1145,8 +1145,8 @@ AABB LightStorage::reflection_probe_get_aabb(RID p_probe) const {
|
||||
ERR_FAIL_COND_V(!reflection_probe, AABB());
|
||||
|
||||
AABB aabb;
|
||||
aabb.position = -reflection_probe->extents;
|
||||
aabb.size = reflection_probe->extents * 2.0;
|
||||
aabb.position = -reflection_probe->size / 2;
|
||||
aabb.size = reflection_probe->size;
|
||||
|
||||
return aabb;
|
||||
}
|
||||
@@ -1165,11 +1165,11 @@ uint32_t LightStorage::reflection_probe_get_cull_mask(RID p_probe) const {
|
||||
return reflection_probe->cull_mask;
|
||||
}
|
||||
|
||||
Vector3 LightStorage::reflection_probe_get_extents(RID p_probe) const {
|
||||
Vector3 LightStorage::reflection_probe_get_size(RID p_probe) const {
|
||||
const ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_probe);
|
||||
ERR_FAIL_COND_V(!reflection_probe, Vector3());
|
||||
|
||||
return reflection_probe->extents;
|
||||
return reflection_probe->size;
|
||||
}
|
||||
|
||||
Vector3 LightStorage::reflection_probe_get_origin_offset(RID p_probe) const {
|
||||
@@ -1674,7 +1674,7 @@ void LightStorage::update_reflection_probe_buffer(RenderDataRD *p_render_data, c
|
||||
|
||||
ReflectionData &reflection_ubo = reflections[i];
|
||||
|
||||
Vector3 extents = probe->extents;
|
||||
Vector3 extents = probe->size / 2;
|
||||
|
||||
rpi->cull_mask = probe->cull_mask;
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ private:
|
||||
Color ambient_color;
|
||||
float ambient_color_energy = 1.0;
|
||||
float max_distance = 0;
|
||||
Vector3 extents = Vector3(10, 10, 10);
|
||||
Vector3 size = Vector3(20, 20, 20);
|
||||
Vector3 origin_offset;
|
||||
bool interior = false;
|
||||
bool box_projection = false;
|
||||
@@ -791,7 +791,7 @@ public:
|
||||
virtual void reflection_probe_set_ambient_color(RID p_probe, const Color &p_color) override;
|
||||
virtual void reflection_probe_set_ambient_energy(RID p_probe, float p_energy) override;
|
||||
virtual void reflection_probe_set_max_distance(RID p_probe, float p_distance) override;
|
||||
virtual void reflection_probe_set_extents(RID p_probe, const Vector3 &p_extents) override;
|
||||
virtual void reflection_probe_set_size(RID p_probe, const Vector3 &p_size) override;
|
||||
virtual void reflection_probe_set_origin_offset(RID p_probe, const Vector3 &p_offset) override;
|
||||
virtual void reflection_probe_set_as_interior(RID p_probe, bool p_enable) override;
|
||||
virtual void reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable) override;
|
||||
@@ -805,7 +805,7 @@ public:
|
||||
virtual AABB reflection_probe_get_aabb(RID p_probe) const override;
|
||||
virtual RS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const override;
|
||||
virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const override;
|
||||
virtual Vector3 reflection_probe_get_extents(RID p_probe) const override;
|
||||
virtual Vector3 reflection_probe_get_size(RID p_probe) const override;
|
||||
virtual Vector3 reflection_probe_get_origin_offset(RID p_probe) const override;
|
||||
virtual float reflection_probe_get_origin_max_distance(RID p_probe) const override;
|
||||
virtual float reflection_probe_get_mesh_lod_threshold(RID p_probe) const override;
|
||||
|
||||
@@ -1853,10 +1853,10 @@ void TextureStorage::decal_free(RID p_rid) {
|
||||
decal_owner.free(p_rid);
|
||||
}
|
||||
|
||||
void TextureStorage::decal_set_extents(RID p_decal, const Vector3 &p_extents) {
|
||||
void TextureStorage::decal_set_size(RID p_decal, const Vector3 &p_size) {
|
||||
Decal *decal = decal_owner.get_or_null(p_decal);
|
||||
ERR_FAIL_COND(!decal);
|
||||
decal->extents = p_extents;
|
||||
decal->size = p_size;
|
||||
decal->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB);
|
||||
}
|
||||
|
||||
@@ -1949,7 +1949,7 @@ AABB TextureStorage::decal_get_aabb(RID p_decal) const {
|
||||
Decal *decal = decal_owner.get_or_null(p_decal);
|
||||
ERR_FAIL_COND_V(!decal, AABB());
|
||||
|
||||
return AABB(-decal->extents, decal->extents * 2.0);
|
||||
return AABB(-decal->size / 2, decal->size);
|
||||
}
|
||||
|
||||
Dependency *TextureStorage::decal_get_dependency(RID p_decal) {
|
||||
@@ -2312,7 +2312,7 @@ void TextureStorage::update_decal_buffer(const PagedArray<RID> &p_decals, const
|
||||
|
||||
DecalData &dd = decals[i];
|
||||
|
||||
Vector3 decal_extents = decal->extents;
|
||||
Vector3 decal_extents = decal->size / 2;
|
||||
|
||||
Transform3D scale_xform;
|
||||
scale_xform.basis.scale(decal_extents);
|
||||
|
||||
@@ -235,7 +235,7 @@ private:
|
||||
} decal_atlas;
|
||||
|
||||
struct Decal {
|
||||
Vector3 extents = Vector3(1, 1, 1);
|
||||
Vector3 size = Vector3(2, 2, 2);
|
||||
RID textures[RS::DECAL_TEXTURE_MAX];
|
||||
float emission_energy = 1.0;
|
||||
float albedo_mix = 1.0;
|
||||
@@ -561,7 +561,7 @@ public:
|
||||
virtual void decal_initialize(RID p_decal) override;
|
||||
virtual void decal_free(RID p_rid) override;
|
||||
|
||||
virtual void decal_set_extents(RID p_decal, const Vector3 &p_extents) override;
|
||||
virtual void decal_set_size(RID p_decal, const Vector3 &p_size) override;
|
||||
virtual void decal_set_texture(RID p_decal, RS::DecalTexture p_type, RID p_texture) override;
|
||||
virtual void decal_set_emission_energy(RID p_decal, float p_energy) override;
|
||||
virtual void decal_set_albedo_mix(RID p_decal, float p_mix) override;
|
||||
@@ -577,9 +577,9 @@ public:
|
||||
virtual void texture_add_to_decal_atlas(RID p_texture, bool p_panorama_to_dp = false) override;
|
||||
virtual void texture_remove_from_decal_atlas(RID p_texture, bool p_panorama_to_dp = false) override;
|
||||
|
||||
_FORCE_INLINE_ Vector3 decal_get_extents(RID p_decal) {
|
||||
_FORCE_INLINE_ Vector3 decal_get_size(RID p_decal) {
|
||||
const Decal *decal = decal_owner.get_or_null(p_decal);
|
||||
return decal->extents;
|
||||
return decal->size;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ RID decal_get_texture(RID p_decal, RS::DecalTexture p_texture) {
|
||||
|
||||
Reference in New Issue
Block a user