This commit is contained in:
luboslenco
2025-08-09 23:23:55 +02:00
parent e7e2fae574
commit 821b5f3625
8 changed files with 2 additions and 23 deletions
-4
View File
@@ -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;
+1 -2
View File
@@ -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
-2
View File
@@ -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) {
+1 -2
View File
@@ -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);
-4
View File
@@ -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
-2
View File
@@ -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;
}
-3
View File
@@ -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
-4
View File
@@ -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
}