- Forked from Godot Engine 4.7-dev (MIT License) - Rebranded to AeThex Engine with cyan/purple theme - Added AI-powered development assistant module - Integrated Claude API for code completion & error fixing - Custom hexagon logo and branding - Multi-platform CI/CD (Windows, Linux, macOS) - Built Linux editor binary (151MB) - Complete source code with all customizations Tech Stack: - C++ game engine core - AI Module: Claude 3.5 Sonnet integration - Build: SCons, 14K+ source files - License: MIT (Godot) + Custom (AeThex features) Ready for Windows build via GitHub Actions!
27 lines
701 B
C++
27 lines
701 B
C++
|
|
#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);
|
|
}
|
|
|
|
}
|