summaryrefslogtreecommitdiffstats
path: root/ship/ship/ViewPorts.gd
blob: 2e8e800eccf7b465f7a8a449326332ab0f91341e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 = camera_locations[i]
        cam.global_transform = self.global_transform * cam.global_transform