From 821b5f3625096c90d860831f6beb3a1f6c78e1c6 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Sat, 9 Aug 2025 23:23:55 +0200 Subject: [PATCH] Cleanup --- base/sources/ts/context.ts | 4 ---- base/sources/ts/gizmo.ts | 3 +-- base/sources/ts/import_mesh.ts | 2 -- base/sources/ts/tab_meshes.ts | 3 +-- base/sources/ts/ui_base.ts | 4 ---- base/sources/ts/uniforms_ext.ts | 2 -- base/sources/ts/util_particle.ts | 3 --- paint/sources/make_particle.ts | 4 ---- 8 files changed, 2 insertions(+), 23 deletions(-) diff --git a/base/sources/ts/context.ts b/base/sources/ts/context.ts index 55273636..a68286b5 100644 --- a/base/sources/ts/context.ts +++ b/base/sources/ts/context.ts @@ -253,7 +253,6 @@ type context_t = { selected_object?: object_t; - ///if arm_physics particle_hit_x?: f32; particle_hit_y?: f32; particle_hit_z?: f32; @@ -262,7 +261,6 @@ type context_t = { last_particle_hit_z?: f32; particle_timer?: tween_anim_t; paint_body?: physics_body_t; - ///end } let context_raw: context_t; @@ -371,14 +369,12 @@ function context_create(): context_t { c.decal_y = 0.0; // c.cache_draws = false; c.write_icon_on_export = false; - ///if arm_physics c.particle_hit_x = 0.0; c.particle_hit_y = 0.0; c.particle_hit_z = 0.0; c.last_particle_hit_x = 0.0; c.last_particle_hit_y = 0.0; c.last_particle_hit_z = 0.0; - ///end c.layer_filter = 0; c.gizmo_started = false; c.gizmo_offset = 0.0; diff --git a/base/sources/ts/gizmo.ts b/base/sources/ts/gizmo.ts index f2845001..c51975c9 100644 --- a/base/sources/ts/gizmo.ts +++ b/base/sources/ts/gizmo.ts @@ -80,12 +80,11 @@ function gizmo_update() { context_raw.gizmo_drag_last = context_raw.gizmo_drag; transform_build_matrix(paint_object.transform); - ///if arm_physics + let pb: physics_body_t = map_get(physics_body_object_map, paint_object.uid); if (pb != null) { physics_body_sync_transform(pb); } - ///end } } // Decal layer control diff --git a/base/sources/ts/import_mesh.ts b/base/sources/ts/import_mesh.ts index c915b46c..a175c703 100644 --- a/base/sources/ts/import_mesh.ts +++ b/base/sources/ts/import_mesh.ts @@ -103,9 +103,7 @@ function import_mesh_finish_import() { render_path_raytrace_ready = false; - ///if arm_physics context_raw.paint_body = null; - ///end } function _import_mesh_make_mesh(mesh: raw_mesh_t) { diff --git a/base/sources/ts/tab_meshes.ts b/base/sources/ts/tab_meshes.ts index 49a9f4df..c83ee4a5 100644 --- a/base/sources/ts/tab_meshes.ts +++ b/base/sources/ts/tab_meshes.ts @@ -286,12 +286,11 @@ function tab_meshes_draw(htab: ui_handle_t) { context_raw.selected_object.transform.rot = quat_from_euler(rot.x, rot.y, rot.z); transform_build_matrix(context_raw.selected_object.transform); transform_compute_dim(context_raw.selected_object.transform); - ///if arm_physics + let pb: physics_body_t = map_get(physics_body_object_map, context_raw.selected_object.uid); if (pb != null) { physics_body_sync_transform(pb); } - ///end } let pb: physics_body_t = map_get(physics_body_object_map, context_raw.selected_object.uid); diff --git a/base/sources/ts/ui_base.ts b/base/sources/ts/ui_base.ts index a4d9d881..001b6129 100644 --- a/base/sources/ts/ui_base.ts +++ b/base/sources/ts/ui_base.ts @@ -705,7 +705,6 @@ function ui_base_update() { base_is_resizing = false; } - ///if arm_physics if (context_raw.tool == tool_type_t.PARTICLE && context_in_paint_area() && !context_raw.paint2d) { util_particle_init_physics(); let world: physics_world_t = physics_world_active; @@ -760,7 +759,6 @@ function ui_base_update() { } } } - ///end } function ui_base_view_top() { @@ -983,11 +981,9 @@ function ui_base_update_ui() { } } - ///if arm_physics if (context_raw.tool == tool_type_t.PARTICLE) { down = false; } - ///end ///if arm_ios // No hover on iPad, decals are painted by pen release diff --git a/base/sources/ts/uniforms_ext.ts b/base/sources/ts/uniforms_ext.ts index 21846719..210dc695 100644 --- a/base/sources/ts/uniforms_ext.ts +++ b/base/sources/ts/uniforms_ext.ts @@ -234,7 +234,6 @@ function uniforms_ext_vec3_link(object: object_t, mat: material_data_t, link: st ); return v; } - ///if arm_physics else if (link == "_particle_hit") { v = _uniforms_vec; v = vec4_create(context_raw.particle_hit_x, context_raw.particle_hit_y, context_raw.particle_hit_z); @@ -245,7 +244,6 @@ function uniforms_ext_vec3_link(object: object_t, mat: material_data_t, link: st v = vec4_create(context_raw.last_particle_hit_x, context_raw.last_particle_hit_y, context_raw.last_particle_hit_z); return v; } - ///end return v; } diff --git a/base/sources/ts/util_particle.ts b/base/sources/ts/util_particle.ts index 551633f3..5f074670 100644 --- a/base/sources/ts/util_particle.ts +++ b/base/sources/ts/util_particle.ts @@ -47,7 +47,6 @@ function util_particle_init() { mo.base.raw = util_clone_obj(mo.base.raw); } -///if arm_physics function util_particle_init_physics() { if (physics_world_active != null) { @@ -74,5 +73,3 @@ function util_particle_init_mesh() { context_raw.paint_body.shape = physics_shape_t.MESH; physics_body_init(context_raw.paint_body, po.base); } - -///end diff --git a/paint/sources/make_particle.ts b/paint/sources/make_particle.ts index 4922bf14..426a466e 100644 --- a/paint/sources/make_particle.ts +++ b/paint/sources/make_particle.ts @@ -1,6 +1,5 @@ function make_particle_mask(kong: node_shader_t) { - ///if arm_physics node_shader_add_out(kong, "wpos: float4"); node_shader_add_constant(kong, "W: float4x4", "_world_matrix"); node_shader_write_attrib_vert(kong, "output.wpos = constants.W * float4(input.pos.xyz, 1.0);"); @@ -16,7 +15,4 @@ function make_particle_mask(kong: node_shader_t) { node_shader_write_frag(kong, "var str: float = clamp(pow(1.0 / dist * constants.brush_hardness * 0.2, 4.0), 0.0, 1.0) * opacity;"); node_shader_write_frag(kong, "if (constants.particle_hit.x == 0.0 && constants.particle_hit.y == 0.0 && constants.particle_hit.z == 0.0) { str = 0.0; }"); node_shader_write_frag(kong, "if (str == 0.0) { discard; }"); - ///else - node_shader_write_frag(kong, "var str: float = 0.0;"); - ///end }