arx-level-generator
Version:
A tool for creating Arx Fatalis maps
15 lines • 611 B
JavaScript
import { Object3D } from 'three';
import { applyTransformations } from '../../helpers.js';
// the generic syntax will make sure that if we get a Group as input, which is a descendant of Object3D
// then we'll get the same type returned. Overloads or union types will return strictly from the given types
export const toArxCoordinateSystem = (threeJsObj) => {
if (threeJsObj instanceof Object3D) {
threeJsObj.scale.y *= -1;
applyTransformations(threeJsObj);
}
else {
threeJsObj.scale(1, -1, 1);
}
return threeJsObj;
};
//# sourceMappingURL=toArxCoordinateSystem.js.map