@threlte/theatre
Version:
Threlte Components for Theatre, an animation library with a professional motion design toolset
18 lines (17 loc) • 555 B
JavaScript
import { DEG2RAD, RAD2DEG } from 'three/src/math/MathUtils.js';
import { createTransformer } from '../createTransformer';
import { types } from '../../../theatre';
export const euler = createTransformer({
transform(value) {
return types.compound({
x: value.x * RAD2DEG,
y: value.y * RAD2DEG,
z: value.z * RAD2DEG
});
},
apply(target, path, value) {
target[path].x = value.x * DEG2RAD;
target[path].y = value.y * DEG2RAD;
target[path].z = value.z * DEG2RAD;
}
});