| | |
| | | { |
| | | no: 1, |
| | | position: [100, 0, 0], |
| | | theta: 90, |
| | | theta: 270, |
| | | height: 100, |
| | | loaderTheta: 180, |
| | | forkLength: 0, |
| | |
| | | |
| | | // group theta |
| | | if (groupTheta !== theta) { |
| | | const minTheta = Common.minDiffTheta(groupTheta, theta); |
| | | new TWEEN.Tween({ value: groupTheta }) |
| | | .to({ value: theta }, INTERVAL_TIME) |
| | | .to({ value: minTheta }, INTERVAL_TIME) |
| | | .easing(TWEEN.Easing.Linear.None) |
| | | .onUpdate((e) => { |
| | | setGroupTheta(e.value) |
| | |
| | | } |
| | | |
| | | export const rotationParseNum = (num) => { |
| | | return num * Math.PI / 180; |
| | | const normalizedDegrees = num % 360; |
| | | return normalizedDegrees * Math.PI / 180; |
| | | } |
| | | |
| | | export const minDiffTheta = (originTheta, targetTheta) => { |
| | | return (targetTheta - originTheta > 180) ? targetTheta - 360 : targetTheta; |
| | | } |
| | | |
| | | export const setShadow = (obj) => { |