Added scene transform update on load
This commit is contained in:
@@ -72,7 +72,7 @@ Entity :: struct {
|
|||||||
rendering_offset: Vector3;
|
rendering_offset: Vector3;
|
||||||
|
|
||||||
snap_offset: Vector3;
|
snap_offset: Vector3;
|
||||||
snap_intervals: Vector3;
|
snap_intervals: Vector3 = .{1,1,1};
|
||||||
|
|
||||||
renderable: Renderable; @DontSerialize
|
renderable: Renderable; @DontSerialize
|
||||||
animator: Animator; @DontSerialize
|
animator: Animator; @DontSerialize
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ load_scene :: (name: string) -> *Scene {
|
|||||||
|
|
||||||
next_entity_id = cast(Entity_Id)(highest + 1);
|
next_entity_id = cast(Entity_Id)(highest + 1);
|
||||||
|
|
||||||
|
update_transforms(scene);
|
||||||
calculate_aabbs(scene);
|
calculate_aabbs(scene);
|
||||||
make_sure_nothing_collides(scene);
|
make_sure_nothing_collides(scene);
|
||||||
|
|
||||||
@@ -224,10 +225,10 @@ update_animators :: (dt: float) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_transforms :: () {
|
update_transforms :: (scene: *Scene) {
|
||||||
if engine.current_scene == null return;
|
if scene == null return;
|
||||||
|
|
||||||
for e: engine.current_scene.entities {
|
for e: scene.entities {
|
||||||
if e.parent == null {
|
if e.parent == null {
|
||||||
update_entity_transform(e, Matrix4_Identity);
|
update_entity_transform(e, Matrix4_Identity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ coven_run :: (game_update_proc: (float), game_editor_update_proc: (float), game_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if engine.current_scene != null {
|
if engine.current_scene != null {
|
||||||
update_transforms();
|
update_transforms(engine.current_scene);
|
||||||
sync_engine_buffers();
|
sync_engine_buffers();
|
||||||
|
|
||||||
if !engine.paused {
|
if !engine.paused {
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ Mesh_Vertex_Data_Type :: enum {
|
|||||||
BITANGENT;
|
BITANGENT;
|
||||||
BONE_INDICES;
|
BONE_INDICES;
|
||||||
BONE_WEIGHTS;
|
BONE_WEIGHTS;
|
||||||
|
|
||||||
|
INSTANCED_MAT1;
|
||||||
|
INSTANCED_MAT2;
|
||||||
|
INSTANCED_MAT3;
|
||||||
|
INSTANCED_MAT4;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mesh_Handle :: #type, distinct u32;
|
Mesh_Handle :: #type, distinct u32;
|
||||||
|
|||||||
Reference in New Issue
Block a user