summaryrefslogtreecommitdiffstats
path: root/ship/ship/ViewPorts.gd
blob: aac098c60c49fe53d99f2d35b0fc0d0442ef18c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extends Spatial

var camera_locations = []

func _ready():
    for viewport in self.get_children():
        var cam = viewport.get_node("Camera")
        camera_locations.push_back(cam.global_transform)

func _physics_process(_delta):
    for i in self.get_child_count():
        var viewport = self.get_child(i)
        var cam = viewport.get_node("Camera")
        cam.global_transform = self.global_transform * camera_locations[i]