File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Kicker Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -97,19 +97,20 @@ private void OnSceneGUI()
97
97
}
98
98
99
99
Handles . color = Color . cyan ;
100
+ Handles . matrix = Matrix4x4 . identity ;
100
101
var transform = MainComponent . transform ;
101
102
var localPos = MainComponent . GetEditorPosition ( ) ;
102
103
localPos . z = MainComponent . PositionZ ;
103
104
104
- var worldPos = transform . parent == null ? localPos : transform . parent . TransformPoint ( localPos ) ;
105
+ var worldPos = transform . parent == null ? localPos : localPos . TranslateToWorld ( ) ;
105
106
106
107
foreach ( var coil in MainComponent . Coils ) {
107
108
var from = MainComponent . GetBallCreationPosition ( ) . ToUnityVector3 ( ) ;
108
109
var l = coil . Speed == 0 ? 1f : 20f * coil . Speed ;
109
110
var dir = new Vector3 (
110
111
l * math . sin ( math . radians ( coil . Angle ) ) ,
111
- - l * math . cos ( math . radians ( coil . Angle ) ) ,
112
- l * math . sin ( math . radians ( coil . Inclination ) )
112
+ l * math . sin ( math . radians ( coil . Inclination ) ) ,
113
+ l * math . cos ( math . radians ( coil . Angle ) )
113
114
) ;
114
115
var to = from + dir ;
115
116
var worldDir = transform . TransformDirection ( math . normalize ( to - from ) ) ;
You can’t perform that action at this time.
0 commit comments