You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Merge pull request #18170 from Chaosus/improvewrapf
Small performance fix to wrapf
This commit is contained in:
@@ -215,11 +215,11 @@ public:
|
||||
}
|
||||
static _ALWAYS_INLINE_ double wrapf(double value, double min, double max) {
|
||||
double rng = max - min;
|
||||
return min + (value - min) - (rng * Math::floor((value - min) / rng));
|
||||
return value - (rng * Math::floor((value - min) / rng));
|
||||
}
|
||||
static _ALWAYS_INLINE_ float wrapf(float value, float min, float max) {
|
||||
float rng = max - min;
|
||||
return min + (value - min) - (rng * Math::floor((value - min) / rng));
|
||||
return value - (rng * Math::floor((value - min) / rng));
|
||||
}
|
||||
|
||||
// double only, as these functions are mainly used by the editor and not performance-critical,
|
||||
|
||||
Reference in New Issue
Block a user