feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
27
engine/thirdparty/msdfgen/core/DistanceMapping.cpp
vendored
Normal file
27
engine/thirdparty/msdfgen/core/DistanceMapping.cpp
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
#include "DistanceMapping.h"
|
||||
|
||||
namespace msdfgen {
|
||||
|
||||
DistanceMapping DistanceMapping::inverse(Range range) {
|
||||
double rangeWidth = range.upper-range.lower;
|
||||
return DistanceMapping(rangeWidth, range.lower/(rangeWidth ? rangeWidth : 1));
|
||||
}
|
||||
|
||||
DistanceMapping::DistanceMapping() : scale(1), translate(0) { }
|
||||
|
||||
DistanceMapping::DistanceMapping(Range range) : scale(1/(range.upper-range.lower)), translate(-range.lower) { }
|
||||
|
||||
double DistanceMapping::operator()(double d) const {
|
||||
return scale*(d+translate);
|
||||
}
|
||||
|
||||
double DistanceMapping::operator()(Delta d) const {
|
||||
return scale*d.value;
|
||||
}
|
||||
|
||||
DistanceMapping DistanceMapping::inverse() const {
|
||||
return DistanceMapping(1/scale, -scale*translate);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue