Merge branch 'main' of http://188.166.59.26/brossferatu/coven
This commit is contained in:
@@ -160,7 +160,7 @@ create_scene :: (name: string = "", max_entities: s64 = 256) -> *Scene {
|
||||
|
||||
array_reserve(*scene.entities, max_entities);
|
||||
|
||||
scene.directional_light.color_and_intensity = .{1,1,1,1};
|
||||
scene.directional_light.color_and_intensity = .{1,1,1,2};
|
||||
scene.directional_light.direction = to_v4(normalize(Vector3.{0.2, -0.7, 0.4}));
|
||||
|
||||
dir_light_data : Directional_Light_Buffer_Data;
|
||||
|
||||
@@ -602,7 +602,7 @@ intersect_rotation_gizmo :: (ray: Ray) -> Transform_Axis, Vector3 {
|
||||
update_gizmo_buffers :: () {
|
||||
entity := engine.editor.selected_entities[0];
|
||||
engine.editor.transform_gizmo.transform.position = entity.transform.position;
|
||||
engine.editor.transform_gizmo.transform.orientation = entity.transform.orientation;
|
||||
engine.editor.transform_gizmo.transform.orientation = ifx engine.editor.transform_gizmo.space == .LOCAL then entity.transform.orientation else .{0,0,0,1};
|
||||
update_matrix(*engine.editor.transform_gizmo.transform);
|
||||
|
||||
up_rotation := rotation_matrix(Matrix3, euler_to_quaternion(degrees_to_radians(90), degrees_to_radians(90), degrees_to_radians(0)));
|
||||
|
||||
@@ -11,7 +11,7 @@ pick_scene_view_at :: (camera: Camera, coordinates: Vector2) {
|
||||
|
||||
for engine.current_scene.entities {
|
||||
if !(it.flags & .RENDERABLE) continue;
|
||||
//if it.flags & Entity_Flags.DELETED || !it.selectable || it.parent != null continue;
|
||||
if it.flags & Entity_Flags.DELETED || it.parent != null continue;
|
||||
|
||||
success, dist := ray_entity_intersect(ray, it);
|
||||
if success && dist < closest {
|
||||
@@ -211,18 +211,11 @@ text_fun : string;
|
||||
slider_value : float = 0.0;
|
||||
|
||||
base_editor_update :: () {
|
||||
if engine.editor.show_menu && (key_down(.MOUSE_LEFT) || key_down(.ESCAPE)) {
|
||||
engine.editor.show_menu = false;
|
||||
eat_key(.MOUSE_LEFT);
|
||||
}
|
||||
editor_ui();
|
||||
|
||||
// @Incomplete: Show that we saved the scene in the editor. Maybe a quick text message or just inside one of the tab titles
|
||||
if key_pressed(.CTRL) && key_down(.S) {
|
||||
save_scene(engine.current_scene);
|
||||
}
|
||||
camera := *engine.editor.camera;
|
||||
|
||||
// Check if we hit the gizmo
|
||||
// @Incomplete: MOVE THIS
|
||||
if engine.editor.focused_widget == null && engine.mode == .EDITING {
|
||||
engine.editor.should_check_entities = true;
|
||||
|
||||
if engine.editor.selected_entities.count == 1 {
|
||||
@@ -239,11 +232,6 @@ base_editor_update :: () {
|
||||
}
|
||||
}
|
||||
|
||||
editor_ui();
|
||||
|
||||
camera := *engine.editor.camera;
|
||||
|
||||
if engine.editor.focused_widget == null {
|
||||
if key_pressed(.CTRL) && key_down(.S) {
|
||||
save_scene(engine.current_scene, "../assets/scenes/");
|
||||
//show_message("Saved scene");
|
||||
@@ -254,6 +242,7 @@ base_editor_update :: () {
|
||||
mark_entity_deleted(it);
|
||||
}
|
||||
|
||||
engine.editor.transform_gizmo.selected_axis = .NONE;
|
||||
engine.editor.selected_entities.count = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ coven_run :: (game_update_proc: (float), game_update_post_physics_proc: (float))
|
||||
|
||||
if engine.current_scene != null && !engine.paused {
|
||||
update_animators(clamped_dt);
|
||||
update_mesh_colliders(engine.current_scene);
|
||||
update_physics(engine.current_scene, clamped_dt);
|
||||
game_update_post_physics_proc(clamped_dt);
|
||||
}
|
||||
@@ -144,6 +145,7 @@ switch_engine_mode :: (to_mode: Engine_Mode) {
|
||||
|
||||
#if EDITOR {
|
||||
engine.editor.selected_entities.count = 0;
|
||||
engine.editor.transform_gizmo.selected_axis = .NONE;
|
||||
}
|
||||
|
||||
if engine.current_scene != null {
|
||||
|
||||
@@ -210,6 +210,10 @@ physics_step :: (scene: *Scene, timestep: float) {
|
||||
if e.collider.ignore continue;
|
||||
|
||||
if e.flags & .PHYSICS {
|
||||
if e.body.check_for_grounded {
|
||||
e.body.grounded = false;
|
||||
}
|
||||
|
||||
for other_e: scene.entities {
|
||||
if e == other_e continue;
|
||||
if other_e.collider.ignore continue;
|
||||
|
||||
Reference in New Issue
Block a user