File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -559,7 +559,6 @@ private void LoadPath(){
559559 ExplorerCore . LogWarning ( "Loaded a path on a different scene than the one it was saved on. Spawning it starting from the current camera state." ) ;
560560 }
561561
562- // loadPathOnCamToggle check
563562 if ( loadPathOnCamToggle . isOn ) {
564563
565564 // We enable the freecam so we can use it to spawn the camera path relative to it
@@ -579,8 +578,10 @@ private void LoadPath(){
579578
580579 foreach ( CatmullRom . CatmullRomPoint point in deserializedObj . points . Skip ( 1 ) ) {
581580 CatmullRom . CatmullRomPoint newPoint = point ;
582- newPoint . position = startingPoint . position - originalStartingPoint . position + newPoint . position ;
583- newPoint . rotation = startingPoint . rotation * Quaternion . Inverse ( originalStartingPoint . rotation ) * newPoint . rotation ;
581+
582+ Quaternion offsetRot = startingPoint . rotation * Quaternion . Inverse ( originalStartingPoint . rotation ) ;
583+ newPoint . position = offsetRot * ( newPoint . position - originalStartingPoint . position ) + startingPoint . position ;
584+ newPoint . rotation = offsetRot * newPoint . rotation ;
584585
585586 controlPoints . Add ( newPoint ) ;
586587 }
You can’t perform that action at this time.
0 commit comments