Forge test

This commit is contained in:
luboslenco
2024-11-30 23:37:06 +01:00
parent 3e3893ca06
commit 3229216d82
3 changed files with 36 additions and 3 deletions
+4 -2
View File
@@ -17,14 +17,16 @@ function sim_update() {
let world: physics_world_t = physics_world_active;
physics_world_update(world);
{
iron_delay_idle_sleep();
let record: bool = true;
if (record) {
let rt: render_target_t = map_get(render_path_render_targets, "taa");
let pixels: buffer_t = image_get_pixels(rt._image);
///if (arm_metal || arm_vulkan)
export_arm_bgra_swap(pixels);
///end
iron_mpeg_write(pixels, rt._image.width, rt._image.height);
iron_delay_idle_sleep();
}
}
}
+31
View File
@@ -4,6 +4,7 @@ let tab_scene_line_counter: i32 = 0;
function tab_scene_import_mesh_done() {
let mo: mesh_object_t = project_paint_objects[project_paint_objects.length - 1];
object_set_parent(mo.base, null);
context_raw.selected_object = mo.base;
}
function tab_scene_draw_list(ui: ui_t, list_handle: ui_handle_t, current_object: object_t) {
@@ -97,6 +98,20 @@ function tab_scene_draw(htab: ui_handle_t) {
let c: object_t = _scene_root.children[i];
tab_scene_draw_list(ui, ui_handle(__ID__), c);
}
// Select object with arrow keys
if (ui.is_key_pressed && ui.key_code == key_code_t.DOWN) {
let i: i32 = array_index_of(project_paint_objects, context_raw.selected_object.ext);
if (i < project_paint_objects.length - 1) {
context_raw.selected_object = project_paint_objects[i + 1].base;
}
}
if (ui.is_key_pressed && ui.key_code == key_code_t.UP) {
let i: i32 = array_index_of(project_paint_objects, context_raw.selected_object.ext);
if (i > 1) {
context_raw.selected_object = project_paint_objects[i - 1].base;
}
}
}
let properties_handle: ui_handle_t = ui_handle(__ID__);
@@ -248,6 +263,22 @@ function tab_scene_draw(htab: ui_handle_t) {
if (ui_button("Box Static")) {
sim_add(context_raw.selected_object, physics_shape_t.BOX, 0.0);
}
if (ui_button("Hull Dynamic")) {
sim_add(context_raw.selected_object, physics_shape_t.HULL, 1.0);
}
if (ui_button("Mesh Static")) {
sim_add(context_raw.selected_object, physics_shape_t.MESH, 0.0);
}
if (ui_button("Duplicate")) {
let so: mesh_object_t = context_raw.selected_object.ext;
let dup: mesh_object_t = scene_add_mesh_object(so.data, so.materials, so.base.parent);
transform_set_matrix(dup.base.transform, so.base.transform.local);
array_push(project_paint_objects, dup);
dup.base.name = so.base.name;
}
}
}
+1 -1
View File
@@ -139,7 +139,7 @@ function config_init() {
config_raw.rp_vignette = 0.2;
config_raw.rp_grain = 0.09;
config_raw.rp_motionblur = false;
///if (arm_android || arm_ios)
///if (arm_android || arm_ios || is_forge)
config_raw.rp_ssao = false;
///else
config_raw.rp_ssao = true;