1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Modified rendering to use cluster instead of foward

This commit is contained in:
Juan Linietsky
2020-01-21 14:24:22 -03:00
parent f8b5c5f063
commit ee1e89f8c0
14 changed files with 685 additions and 181 deletions

View File

@@ -244,6 +244,18 @@ void Basis::scale_local(const Vector3 &p_scale) {
*this = scaled_local(p_scale);
}
float Basis::get_uniform_scale() const {
return (elements[0].length() + elements[1].length() + elements[2].length()) / 3.0;
}
void Basis::make_scale_uniform() {
float l = (elements[0].length() + elements[1].length() + elements[2].length()) / 3.0;
for (int i = 0; i < 3; i++) {
elements[i].normalize();
elements[i] *= l;
}
}
Basis Basis::scaled_local(const Vector3 &p_scale) const {
Basis b;
b.set_diagonal(p_scale);