summaryrefslogtreecommitdiff
path: root/scene/3d/reflection_probe.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 13:23:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:54:55 +0200
commit0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch)
treea27e497da7104dd0a64f98a04fa3067668735e91 /scene/3d/reflection_probe.cpp
parent710b34b70227becdc652b4ae027fe0ac47409642 (diff)
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
Diffstat (limited to 'scene/3d/reflection_probe.cpp')
-rw-r--r--scene/3d/reflection_probe.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp
index 24bf8b43d1..2cc7913d1c 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -31,18 +31,15 @@
#include "reflection_probe.h"
void ReflectionProbe::set_intensity(float p_intensity) {
-
intensity = p_intensity;
RS::get_singleton()->reflection_probe_set_intensity(probe, p_intensity);
}
float ReflectionProbe::get_intensity() const {
-
return intensity;
}
void ReflectionProbe::set_interior_ambient(Color p_ambient) {
-
interior_ambient = p_ambient;
RS::get_singleton()->reflection_probe_set_interior_ambient(probe, p_ambient);
}
@@ -57,33 +54,27 @@ float ReflectionProbe::get_interior_ambient_energy() const {
}
Color ReflectionProbe::get_interior_ambient() const {
-
return interior_ambient;
}
void ReflectionProbe::set_interior_ambient_probe_contribution(float p_contribution) {
-
interior_ambient_probe_contribution = p_contribution;
RS::get_singleton()->reflection_probe_set_interior_ambient_probe_contribution(probe, p_contribution);
}
float ReflectionProbe::get_interior_ambient_probe_contribution() const {
-
return interior_ambient_probe_contribution;
}
void ReflectionProbe::set_max_distance(float p_distance) {
-
max_distance = p_distance;
RS::get_singleton()->reflection_probe_set_max_distance(probe, p_distance);
}
float ReflectionProbe::get_max_distance() const {
-
return max_distance;
}
void ReflectionProbe::set_extents(const Vector3 &p_extents) {
-
extents = p_extents;
for (int i = 0; i < 3; i++) {
@@ -103,16 +94,13 @@ void ReflectionProbe::set_extents(const Vector3 &p_extents) {
update_gizmo();
}
Vector3 ReflectionProbe::get_extents() const {
-
return extents;
}
void ReflectionProbe::set_origin_offset(const Vector3 &p_extents) {
-
origin_offset = p_extents;
for (int i = 0; i < 3; i++) {
-
if (extents[i] - 0.01 < ABS(origin_offset[i])) {
origin_offset[i] = SGN(origin_offset[i]) * (extents[i] - 0.01);
}
@@ -124,49 +112,40 @@ void ReflectionProbe::set_origin_offset(const Vector3 &p_extents) {
update_gizmo();
}
Vector3 ReflectionProbe::get_origin_offset() const {
-
return origin_offset;
}
void ReflectionProbe::set_enable_box_projection(bool p_enable) {
-
box_projection = p_enable;
RS::get_singleton()->reflection_probe_set_enable_box_projection(probe, p_enable);
}
bool ReflectionProbe::is_box_projection_enabled() const {
-
return box_projection;
}
void ReflectionProbe::set_as_interior(bool p_enable) {
-
interior = p_enable;
RS::get_singleton()->reflection_probe_set_as_interior(probe, interior);
_change_notify();
}
bool ReflectionProbe::is_set_as_interior() const {
-
return interior;
}
void ReflectionProbe::set_enable_shadows(bool p_enable) {
-
enable_shadows = p_enable;
RS::get_singleton()->reflection_probe_set_enable_shadows(probe, p_enable);
}
bool ReflectionProbe::are_shadows_enabled() const {
-
return enable_shadows;
}
void ReflectionProbe::set_cull_mask(uint32_t p_layers) {
-
cull_mask = p_layers;
RS::get_singleton()->reflection_probe_set_cull_mask(probe, p_layers);
}
uint32_t ReflectionProbe::get_cull_mask() const {
-
return cull_mask;
}
@@ -180,19 +159,16 @@ ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const {
}
AABB ReflectionProbe::get_aabb() const {
-
AABB aabb;
aabb.position = -origin_offset;
aabb.size = origin_offset + extents;
return aabb;
}
Vector<Face3> ReflectionProbe::get_faces(uint32_t p_usage_flags) const {
-
return Vector<Face3>();
}
void ReflectionProbe::_validate_property(PropertyInfo &property) const {
-
if (property.name == "interior/ambient_color" || property.name == "interior/ambient_energy" || property.name == "interior/ambient_contrib") {
if (!interior) {
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
@@ -201,7 +177,6 @@ void ReflectionProbe::_validate_property(PropertyInfo &property) const {
}
void ReflectionProbe::_bind_methods() {
-
ClassDB::bind_method(D_METHOD("set_intensity", "intensity"), &ReflectionProbe::set_intensity);
ClassDB::bind_method(D_METHOD("get_intensity"), &ReflectionProbe::get_intensity);
@@ -258,7 +233,6 @@ void ReflectionProbe::_bind_methods() {
}
ReflectionProbe::ReflectionProbe() {
-
intensity = 1.0;
interior_ambient = Color(0, 0, 0);
interior_ambient_probe_contribution = 0;
@@ -278,6 +252,5 @@ ReflectionProbe::ReflectionProbe() {
}
ReflectionProbe::~ReflectionProbe() {
-
RS::get_singleton()->free(probe);
}