Added scene transform update on load
This commit is contained in:
@@ -72,7 +72,7 @@ Entity :: struct {
|
||||
rendering_offset: Vector3;
|
||||
|
||||
snap_offset: Vector3;
|
||||
snap_intervals: Vector3;
|
||||
snap_intervals: Vector3 = .{1,1,1};
|
||||
|
||||
renderable: Renderable; @DontSerialize
|
||||
animator: Animator; @DontSerialize
|
||||
|
||||
@@ -64,6 +64,7 @@ load_scene :: (name: string) -> *Scene {
|
||||
|
||||
next_entity_id = cast(Entity_Id)(highest + 1);
|
||||
|
||||
update_transforms(scene);
|
||||
calculate_aabbs(scene);
|
||||
make_sure_nothing_collides(scene);
|
||||
|
||||
@@ -224,10 +225,10 @@ update_animators :: (dt: float) {
|
||||
}
|
||||
}
|
||||
|
||||
update_transforms :: () {
|
||||
if engine.current_scene == null return;
|
||||
update_transforms :: (scene: *Scene) {
|
||||
if scene == null return;
|
||||
|
||||
for e: engine.current_scene.entities {
|
||||
for e: scene.entities {
|
||||
if e.parent == null {
|
||||
update_entity_transform(e, Matrix4_Identity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user