Integrate five Meshy apparatus with fitted soul poses and anchored restraints

This commit is contained in:
JariKo
2026-10-29 16:30:06 +02:00
parent 4a8bcd13f1
commit 4ca0c2a899
80 changed files with 1584 additions and 52 deletions
+18
View File
@@ -12,8 +12,17 @@ var submerged=false
var splash_count=0
var drops=[]
var wheel_cuffs=[]
var restraints
func setup(game,development):
g=game;d=development
if d.device.get_meta("apparatus_model","")=="meshy_equipment_v01":
restraints=preload("res://apparatus_restraints.gd").new();restraints.setup(g,d)
if d.selected==2:
water=preload("res://water_surface.gd").new().build(g,d.device,1.29,Vector3(0,.87,.18),false)
water.scale.z=.76
for i in range(14):
var drop=g.ball(d.device,Vector3.ZERO,Vector3(.035,.075,.035),Color("9cbab9"));drop.hide();drops.append(drop)
return
if d.selected==1:
for x in [-0.42,0.42]:
for z in [-1.42,1.42]:
@@ -55,6 +64,7 @@ func setup(game,development):
if n.material_override is StandardMaterial3D:mat.set_shader_parameter("tint",n.material_override.albedo_color)
n.material_override=mat;heat_materials.append(mat)
heat_light=OmniLight3D.new();d.device.add_child(heat_light);heat_light.position=Vector3(0,1,0.8);heat_light.light_color=Color("ff5819");heat_light.omni_range=3;heat_light.light_energy=0
restraints=preload("res://apparatus_restraints.gd").new();restraints.setup(g,d)
func reset():
tension=0;heat=0;submerged=false
@@ -72,6 +82,14 @@ func apply_heat():
func update(dt,active):
var i=g.index_of(g.working)
if restraints:restraints.update(g.souls[i].visual if i>=0 else null)
if d.device.has_meta("handle_rotor"):
var rotor=d.device.get_meta("handle_rotor")
if d.selected==2:rotor.rotation.z=d.crank.rotation.z
elif d.selected==1:
for part_name in ["HeadRoller","FootRoller"]:
var roller=d.device.find_child(part_name,true,false)
if roller:roller.rotation.x=d.crank.rotation.z
if d.selected==1 and i>=0:
tension=move_toward(tension,clampf(d.elapsed,0,1) if d.stage==0 else 1.0,dt*2)
var s=g.souls[i]
+78
View File
@@ -0,0 +1,78 @@
extends Node3D
# Every live restraint has a body endpoint and an apparatus endpoint.
var g
var d
var bindings=[]
static var link_mesh: TorusMesh
static var link_material: StandardMaterial3D
func setup(game,state):
g=game;d=state;name="LiveRestraints"
d.device.add_child(self)
if link_mesh==null:
link_mesh=TorusMesh.new();link_mesh.inner_radius=.017;link_mesh.outer_radius=.027;link_mesh.rings=8;link_mesh.ring_segments=6
link_material=StandardMaterial3D.new();link_material.albedo_color=Color("605342");link_material.metallic=.85;link_material.roughness=.43
for side in ["L","R"]:
var sx=1.0 if side=="L" else -1.0
for wrist in [true,false]:
var bone=("wrist." if wrist else "foot.")+side
var parent_bone=("lowerarm01." if wrist else "lowerleg01.")+side
var cuff=preload("res://leather_cuff.gd").make(g,self,Vector3.ZERO,.080 if wrist else .095)
cuff.name="WristCuff"+side if wrist else "AnkleCuff"+side
var anchor=Marker3D.new();anchor.name="Anchor"+bone.replace(".","")
var support=d.crank if d.selected==2 else d.device
support.add_child(anchor)
anchor.position=anchor_at(d.selected,sx,wrist)
var eye=MeshInstance3D.new();eye.mesh=link_mesh;eye.material_override=link_material;support.add_child(eye);eye.position=anchor.position;eye.scale=Vector3.ONE*2
eye.rotation.x=PI/2
eye.set_meta("no_walk_collision",true)
eye.set_meta("apparatus_restraint",true);eye.cast_shadow=GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
var chain=MultiMeshInstance3D.new();add_child(chain);chain.name="Chain"+bone.replace(".","")
var mm=MultiMesh.new();mm.transform_format=MultiMesh.TRANSFORM_3D;mm.mesh=link_mesh;mm.instance_count=24;chain.multimesh=mm;chain.material_override=link_material
chain.cast_shadow=GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
bindings.append({"bone":bone,"parent_bone":parent_bone,"cuff":cuff,"anchor":anchor,"chain":chain,"eye":eye,"start":Vector3.ZERO,"end":Vector3.ZERO})
# No restraint geometry participates in NPC walking physics.
for mesh in find_children("*","MeshInstance3D",true,false):
mesh.set_meta("no_walk_collision",true);mesh.set_meta("apparatus_restraint",true);mesh.cast_shadow=GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
hide()
func anchor_at(kind,sx,wrist):
match kind:
0:return Vector3(sx*.59,1.70,0) if wrist else Vector3(sx*.35,.14,-.55)
1:return Vector3(sx*.42,1.16,-1.42 if wrist else 1.42)
2:return Vector3(sx*.74,.74 if wrist else -.74,.10)
3:return Vector3(sx*.40,1.40,-.30) if wrist else Vector3(sx*.25,.35,-.25)
4:return Vector3(sx*.61,1.06,.20) if wrist else Vector3(sx*.23,.30,.48)
return Vector3(sx*1.25,1.65,.15) if wrist else Vector3(sx*.35,.45,-.35)
func update(soul):
visible=soul!=null
for binding in bindings:
binding.eye.visible=visible
if not visible:continue
var at=to_local(soul.bone_world(binding.bone))
var toward=to_local(soul.bone_world(binding.parent_bone))-at
var axis=toward.normalized()
binding.cuff.position=at+axis*.045
binding.cuff.quaternion=Quaternion(Vector3.UP,axis)
var start=binding.cuff.position
var end=to_local(binding.anchor.global_position)
binding.start=start;binding.end=end
var length=start.distance_to(end)
var count=clampi(ceili(length/.043),2,24)
binding.chain.multimesh.visible_instance_count=count
var down=global_basis.inverse()*Vector3.DOWN
var sag=minf(.10,length*.10)
for j in range(count):
var t=(j+.5)/float(count)
var point=start.lerp(end,t)+down*sin(t*PI)*sag
var tangent=(end-start+down*cos(t*PI)*sag*PI).normalized()
if tangent.length_squared()<.001:tangent=Vector3.UP
var q=Quaternion(Vector3.FORWARD,tangent)*Quaternion(Vector3.FORWARD,PI/2 if j%2 else 0.0)
var scale_z=maxf(.65,length/maxi(count,1)/.047)
binding.chain.multimesh.set_instance_transform(j,Transform3D(Basis(q).scaled(Vector3(.70,1,scale_z)),point))
func _process(_dt):
if g==null or d==null or g.paused:return
var soul_id=d.get("soul",-1) if d is Dictionary else g.working
var placement=d.get("placement",0.0) if d is Dictionary else d.placement_clock
var i=g.index_of(soul_id)
update(g.souls[i].visual if i>=0 and placement<=0 else null)
func _exit_tree():
g=null;d=null
Binary file not shown.
@@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://drlakfturx763"
path="res://.godot/imported/cauldron.glb-69377aa72ab7e693d61fe8d785e2c7dd.scn"
[deps]
source_file="res://art/equipment/meshy_v01/cauldron.glb"
dest_files=["res://.godot/imported/cauldron.glb-69377aa72ab7e693d61fe8d785e2c7dd.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=false
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 626 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dfkvm1rx3tylp"
path="res://.godot/imported/cauldron_Image_0.jpg-82af0cd9433e9561d24468926485625b.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "6ee5dc18888323a6375f02276d279650"
}
[deps]
source_file="res://art/equipment/meshy_v01/cauldron_Image_0.jpg"
dest_files=["res://.godot/imported/cauldron_Image_0.jpg-82af0cd9433e9561d24468926485625b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cios14t5t1hw4"
path="res://.godot/imported/cauldron_Image_1.jpg-e99b360e5d3d18a76559bcc70d11c9d6.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "8bb9e79b81725f84506c60cfee598d4a"
}
[deps]
source_file="res://art/equipment/meshy_v01/cauldron_Image_1.jpg"
dest_files=["res://.godot/imported/cauldron_Image_1.jpg-e99b360e5d3d18a76559bcc70d11c9d6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d1bmb44kdd73e"
path="res://.godot/imported/cauldron_Image_2.jpg-5f648f294b1219d92b9678b0b8d5933d.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "b756803f20db251c2ba4d0dc3b6e7cf7"
}
[deps]
source_file="res://art/equipment/meshy_v01/cauldron_Image_2.jpg"
dest_files=["res://.godot/imported/cauldron_Image_2.jpg-5f648f294b1219d92b9678b0b8d5933d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
@@ -0,0 +1,106 @@
{
"pillory": {
"source_sha256": "551d87b892e8e8cc67906791de5d0f8cb95640227f78aaed5e4bf38bc5b27d93",
"game_sha256": "72bb7ea9c5220236e7133773254e8f5a7d0efff97d2258f6966a01cc88e257d3",
"triangles": 15210,
"blender_bounds": [
[
-0.989691972732544,
-0.9544674754142761,
-0.000264640839304775
],
[
0.9891226291656494,
0.9544674754142761,
2.479335308074951
]
],
"parts": [
"Body",
"UpperYoke"
]
},
"rack": {
"source_sha256": "d5554a28bb812fd8aa0f0492204319f278f05d5024352cc63f393c08cef273df",
"game_sha256": "a1171784e85b1d4dff67d61fe633b797f19b52160f578b1683501afdbc0a4408",
"triangles": 7768,
"blender_bounds": [
[
-0.7920066118240356,
-1.5920144319534302,
-4.083245949004777e-05
],
[
0.7941781878471375,
1.8529947996139526,
1.3078043460845947
]
],
"parts": [
"Body",
"FootRoller",
"HeadRoller"
]
},
"wheel_vat": {
"source_sha256": "44370539c7ed35dea9027c1ed5546cb6f3b9e6cde01a99e837509d2db294051c",
"game_sha256": "b5405b2655ba65855a2c9d0b4988cfead813e91708fe775b2b05dcebaba0f576",
"triangles": 8791,
"blender_bounds": [
[
-1.870709776878357,
-1.6211438179016113,
-0.001041287905536592
],
[
1.8681535720825195,
1.6145036220550537,
2.9022161960601807
]
],
"parts": [
"Body",
"Wheel"
]
},
"musical_chair": {
"source_sha256": "14260d90cc5551932835b7b81e99d3396135435bb85d1c2ce1191f531801d727",
"game_sha256": "cc3c3e54837d51b7baa87bf5d9672f69720c3341c0fe50f76bf8b2bc6cce3e20",
"triangles": 13360,
"blender_bounds": [
[
-1.2581496238708496,
-0.8997828960418701,
0.00028335212846286595
],
[
1.259320855140686,
0.6499825119972229,
2.6508123874664307
]
],
"parts": [
"Body"
]
},
"cauldron": {
"source_sha256": "56a22608fb70daa6ef66b73fea1ab0fe28785f86dcee15a564c49d43a2d1596b",
"game_sha256": "05fc87f954a998865835c143b413ec3467701e284c97b0d2399972e2155531a5",
"triangles": 15207,
"blender_bounds": [
[
-1.7284685373306274,
-1.7284685373306274,
-7.974684558575973e-05
],
[
1.7284685373306274,
1.7284685373306274,
1.8782514333724976
]
],
"parts": [
"Body"
]
}
}
Binary file not shown.
@@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://b3doll1hqe7ig"
path="res://.godot/imported/musical_chair.glb-44ddcd0732b9d52b2fa32e427c5d5480.scn"
[deps]
source_file="res://art/equipment/meshy_v01/musical_chair.glb"
dest_files=["res://.godot/imported/musical_chair.glb-44ddcd0732b9d52b2fa32e427c5d5480.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=false
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 735 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b40cr237vbv8n"
path="res://.godot/imported/musical_chair_Image_0.jpg-053de38e3ebeed52d81ac5ed8dac7806.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "086406385e61b0f206b195b8894c4b93"
}
[deps]
source_file="res://art/equipment/meshy_v01/musical_chair_Image_0.jpg"
dest_files=["res://.godot/imported/musical_chair_Image_0.jpg-053de38e3ebeed52d81ac5ed8dac7806.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bf8pgswa0oskd"
path="res://.godot/imported/musical_chair_Image_1.jpg-bc02f0ce5eaec79fe69ebffcaeeef0ca.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "f36c93dfc34dfd7c851abdd909a223bc"
}
[deps]
source_file="res://art/equipment/meshy_v01/musical_chair_Image_1.jpg"
dest_files=["res://.godot/imported/musical_chair_Image_1.jpg-bc02f0ce5eaec79fe69ebffcaeeef0ca.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bmvoet4vx8fjb"
path="res://.godot/imported/musical_chair_Image_2.jpg-f34858caf80958636f5d5dbe10ae09eb.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "8857baf43123e06660221c508ce26750"
}
[deps]
source_file="res://art/equipment/meshy_v01/musical_chair_Image_2.jpg"
dest_files=["res://.godot/imported/musical_chair_Image_2.jpg-f34858caf80958636f5d5dbe10ae09eb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.
@@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://crvrmwu5h8o4l"
path="res://.godot/imported/pillory.glb-3dcbfc4dcba47871a6c80e600341d667.scn"
[deps]
source_file="res://art/equipment/meshy_v01/pillory.glb"
dest_files=["res://.godot/imported/pillory.glb-3dcbfc4dcba47871a6c80e600341d667.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=false
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 664 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://7worlr2b0lpb"
path="res://.godot/imported/pillory_Image_0.jpg-f12800529c7e9abdaadf80f66c4f5095.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "2797b7ab3249206940e9e30deea71f63"
}
[deps]
source_file="res://art/equipment/meshy_v01/pillory_Image_0.jpg"
dest_files=["res://.godot/imported/pillory_Image_0.jpg-f12800529c7e9abdaadf80f66c4f5095.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://miub4jdgd3ct"
path="res://.godot/imported/pillory_Image_1.jpg-df6eed64384ef131ad02abf65497ffba.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "ff11e9ab6c4a5a1cbb15907e0bb4ebab"
}
[deps]
source_file="res://art/equipment/meshy_v01/pillory_Image_1.jpg"
dest_files=["res://.godot/imported/pillory_Image_1.jpg-df6eed64384ef131ad02abf65497ffba.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 242 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://djrjxks4ryfmh"
path="res://.godot/imported/pillory_Image_2.jpg-d892275a93da1cf049a85939b9d04ab3.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "bb1f882658b98ec12602f9f919a3e74e"
}
[deps]
source_file="res://art/equipment/meshy_v01/pillory_Image_2.jpg"
dest_files=["res://.godot/imported/pillory_Image_2.jpg-d892275a93da1cf049a85939b9d04ab3.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.
@@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://cg81un3gx8vu"
path="res://.godot/imported/rack.glb-989e29f95696746d85e72a29495d739c.scn"
[deps]
source_file="res://art/equipment/meshy_v01/rack.glb"
dest_files=["res://.godot/imported/rack.glb-989e29f95696746d85e72a29495d739c.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=false
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 596 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bb1im4sv73m4b"
path="res://.godot/imported/rack_Image_0.jpg-fad20199066b9d751e3f57917fe3afdb.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "b9968a01354976592dc664f40c5c65af"
}
[deps]
source_file="res://art/equipment/meshy_v01/rack_Image_0.jpg"
dest_files=["res://.godot/imported/rack_Image_0.jpg-fad20199066b9d751e3f57917fe3afdb.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bgkmfche66oq8"
path="res://.godot/imported/rack_Image_1.jpg-8514a5d44e4dbb4fde8b0c443373b417.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "818512251bccd984a81a5ae35d9a67f9"
}
[deps]
source_file="res://art/equipment/meshy_v01/rack_Image_1.jpg"
dest_files=["res://.godot/imported/rack_Image_1.jpg-8514a5d44e4dbb4fde8b0c443373b417.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://brvfilnf78g2q"
path="res://.godot/imported/rack_Image_2.jpg-a8cc7dbd72e863807a3d40c2370bf828.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "81d3f27df087e35e15e145abec941b98"
}
[deps]
source_file="res://art/equipment/meshy_v01/rack_Image_2.jpg"
dest_files=["res://.godot/imported/rack_Image_2.jpg-a8cc7dbd72e863807a3d40c2370bf828.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.
@@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://cj05be3eovqpi"
path="res://.godot/imported/wheel_vat.glb-5ad411385cf592451d7717ff095a7c8a.scn"
[deps]
source_file="res://art/equipment/meshy_v01/wheel_vat.glb"
dest_files=["res://.godot/imported/wheel_vat.glb-5ad411385cf592451d7717ff095a7c8a.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=false
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 743 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dxxywvhhscsd5"
path="res://.godot/imported/wheel_vat_Image_0.jpg-977680068d04ba05c89d52364f16bba1.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "0704f24e6ab18d8042532693a0adeb5f"
}
[deps]
source_file="res://art/equipment/meshy_v01/wheel_vat_Image_0.jpg"
dest_files=["res://.godot/imported/wheel_vat_Image_0.jpg-977680068d04ba05c89d52364f16bba1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d0mndbbij1ad5"
path="res://.godot/imported/wheel_vat_Image_1.jpg-20e9df67cdc82171578c564c93d7671a.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "897efcbe541ea93de7d8d6e9f668b427"
}
[deps]
source_file="res://art/equipment/meshy_v01/wheel_vat_Image_1.jpg"
dest_files=["res://.godot/imported/wheel_vat_Image_1.jpg-20e9df67cdc82171578c564c93d7671a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cx5cnmxxhmljc"
path="res://.godot/imported/wheel_vat_Image_2.jpg-6316f58d34b1a98c8f038e640237e212.ctex"
metadata={
"vram_texture": false
}
generator_parameters={
"md5": "e847bf4c95eb5e3728c81cdbeb4be2c8"
}
[deps]
source_file="res://art/equipment/meshy_v01/wheel_vat_Image_2.jpg"
dest_files=["res://.godot/imported/wheel_vat_Image_2.jpg-6316f58d34b1a98c8f038e640237e212.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
+3
View File
@@ -24,6 +24,9 @@ func build(game,d):
preload("res://new_equipment.gd").new().build(g,d)
return
var root=d.device
if d.selected in [0,1,2]:
preload("res://meshy_equipment.gd").new().build(g,d)
return
if d.selected==3:
preload("res://iron_maiden.gd").new().build(g,d)
return
+157
View File
@@ -0,0 +1,157 @@
extends RefCounted
var failures=0
var checks=0
var folder=""
func check(ok,label):
checks+=1
if not ok:failures+=1;push_error("EQUIPMENT QA: "+label)
func shot(g,name):
if DisplayServer.get_name()=="headless":return
await g.get_tree().process_frame
await g.get_tree().process_frame
await RenderingServer.frame_post_draw
g.get_viewport().get_texture().get_image().save_png(folder+"/"+name+".png")
func triangles(d):
var faces=PackedVector3Array()
for mesh in d.device.find_children("*","MeshInstance3D",true,false):
if mesh.get_parent().name=="LiveRestraints" or mesh.get_meta("no_walk_collision",false) or not mesh.is_visible_in_tree() or mesh.mesh is QuadMesh:continue
if mesh.mesh is ArrayMesh:
for v in mesh.mesh.get_faces():faces.append(d.device.to_local(mesh.to_global(v)))
return faces
func clear_ray(faces,a,b):
for j in range(0,faces.size(),3):
if Geometry3D.segment_intersects_triangle(a,b,faces[j],faces[j+1],faces[j+2])!=null:return false
return true
func skin_contacts(actor,d):
var feet=PackedVector3Array()
var thighs=PackedVector3Array()
for mesh in actor.model.find_children("*","MeshInstance3D",true,false):
if mesh.skin==null:continue
var matrices=[];var names=[]
for bind in range(mesh.skin.get_bind_count()):
var index=actor.skeleton.find_bone(mesh.skin.get_bind_name(bind))
if index<0:index=mesh.skin.get_bind_bone(bind)
matrices.append(actor.skeleton.get_bone_global_pose(index)*mesh.skin.get_bind_pose(bind))
names.append(actor.skeleton.get_bone_name(index))
for surface in range(mesh.mesh.get_surface_count()):
var arrays=mesh.mesh.surface_get_arrays(surface)
var vertices=arrays[Mesh.ARRAY_VERTEX];var bones=arrays[Mesh.ARRAY_BONES];var weights=arrays[Mesh.ARRAY_WEIGHTS]
for j in range(vertices.size()):
var max_weight=0.0;var dominant=0
for k in range(4):
if weights[j*4+k]>max_weight:max_weight=weights[j*4+k];dominant=bones[j*4+k]
var bone=names[dominant]
var is_foot=bone.begins_with("foot.") or bone.begins_with("toe")
var is_thigh=bone.begins_with("upperleg")
if not is_foot and not is_thigh:continue
var p=Vector3.ZERO
for k in range(4):
if weights[j*4+k]>0:p+=(matrices[bones[j*4+k]]*vertices[j])*weights[j*4+k]
p=d.device.to_local(actor.skeleton.to_global(p))
if is_foot:feet.append(p)
else:thighs.append(p)
return {"feet":feet,"thighs":thighs}
func run(g):
await g.get_tree().create_timer(.3).timeout
g.start_game();g.set_process(false);g.reset_shift();g.game_started=true;g.paused=false
g.hud.hide();g.menu.show_page("")
for imp in g.life.imps+g.life.neighbours:imp.root.hide()
folder="res://captures/equipment-meshy" if OS.has_feature("editor") else OS.get_executable_path().get_base_dir()+"/captures/equipment-meshy"
DirAccess.make_dir_recursive_absolute(folder)
var w=g.workshop
for kind in range(6):
if "--equipment-only=4" in OS.get_cmdline_user_args() and kind!=4:continue
var d=w.add_station(kind,Vector3(3,0,0))
d.motion.restraints.set_process(false)
var original_faces=triangles(d)
check(d.device.get_meta("apparatus_model","") in ["meshy_equipment_v01","iron_maiden_v01"],"prepared model %d"%kind)
if kind==2:
check(absf(d.crank.position.y-1.62)<.01,"wheel origin at axle")
check(d.motion.water!=null and d.motion.water.get_parent()!=d.crank,"water independent from wheel")
var water_before=d.motion.water.transform
d.crank.rotation.z=PI/2
check(d.motion.water.transform==water_before,"turning wheel leaves water stationary")
d.crank.rotation.z=0
if kind==5:
check(d.special.liquid.position.y<1.65 and d.special.liquid.position.y>.5,"liquid below rim above hollow floor")
for soul_kind in range(10):
var actor=g.make_person(false,soul_kind);g.add_child(actor);g.make_ghost(actor,soul_kind);g.set_soul_reveal(actor,1);actor.mount_station(kind)
actor.position=d.device.position;actor.rotation=Vector3.ZERO
if kind==1:actor.rotation.x=-PI/2;actor.position+=Vector3(0,1.04,1.13)
elif kind==2:actor.position+=Vector3(0,.47,.27)
elif kind==3:actor.position+=Vector3(0,.22,0)
elif kind==5:actor.position+=Vector3(0,.45,0);actor.scale=Vector3.ONE*.85
actor.update_torture(.01,false)
d.motion.restraints.update(actor)
check(d.motion.restraints.bindings.size()==4,"four live restraints %d/%d"%[kind,soul_kind])
for binding in d.motion.restraints.bindings:
var body_point=d.motion.restraints.to_local(actor.bone_world(binding.bone))
check(binding.cuff.position.distance_to(body_point)<.06,"cuff follows bone %d/%d/%s"%[kind,soul_kind,binding.bone])
check(binding.end.distance_to(d.motion.restraints.to_local(binding.anchor.global_position))<.001,"chain ends at apparatus")
check(binding.chain.multimesh.visible_instance_count>=2,"chain links visible")
var head=d.device.to_local(actor.bone_world("head"))
if kind in [0,4,5]:
var contacts=skin_contacts(actor,d)
var sole=INF
for p in contacts.feet:sole=minf(sole,p.y)
var floor_y=.10 if kind==0 else (.33 if kind==4 else .40)
check(sole>=floor_y-.01,"actual foot vertices clear base %d/%d min=%f"%[kind,soul_kind,sole])
if kind==4:
if soul_kind==0:print("SEAT_GEOMETRY hip=",actor.bone_local("upperleg01.L")," knee=",actor.bone_local("lowerleg01.L")," ankle=",actor.bone_local("foot.L"))
var penetration=0
for p in contacts.thighs:
if absf(p.x)<.46 and p.z>-.43 and p.z<.125 and p.y<.69:penetration+=1
check(penetration==0,"actual thigh vertices clear cushion %d count=%d"%[soul_kind,penetration])
if kind==0:
for bone in ["head","wrist.L","wrist.R"]:
var at=d.device.to_local(actor.bone_world(bone))
for offset in [-.035,0,.035]:
check(clear_ray(original_faces,Vector3(at.x+offset,at.y,-.3),Vector3(at.x+offset,at.y,.3)),"open aperture clears %d/%s"%[soul_kind,bone])
elif kind==1:
for bone in ["root","spine01","spine02","head"]:
var at=d.device.to_local(actor.bone_world(bone))
check(at.y>.94 and absf(at.z)<1.65,"lying torso above bed %d/%s %s"%[soul_kind,bone,str(at)])
elif kind==2:
check(Vector2(head.x,head.y-1.62).length()<1.28,"head within wheel radius")
for angle in [0.0,PI/2,PI,PI*1.5]:
d.crank.rotation.z=angle
actor.rotation.z=angle;actor.position=d.device.position+Vector3(sin(angle)*1.15,1.62-cos(angle)*1.15,.27)
actor.update_torture(.01,false);d.motion.restraints.update(actor)
var torso=d.device.to_local(actor.bone_world("spine02"))
check(Vector2(torso.x,torso.y-1.62).length()<1.28 and torso.z>.18,"body follows front of wheel through full turn")
if soul_kind==7 and angle in [PI/2,PI]:await shot(g,"wheel-angle-%d"%roundi(rad_to_deg(angle)))
d.crank.rotation.z=0;actor.rotation.z=0;actor.position=d.device.position+Vector3(0,.47,.27);actor.update_torture(0,false)
elif kind==4:
for bone in ["root","upperleg01.L","upperleg01.R"]:
var at=d.device.to_local(actor.bone_world(bone))
check(at.y>.76 and absf(at.x)<.48,"hips clear seat and fit width")
for speaker in d.special.speaker_roots:
var target=d.device.to_local(actor.bone_world("head"))-speaker.position
check(speaker.basis.z.dot(target.normalized())>.92,"speaker points toward actual head")
elif kind==5:
for bone in ["root","spine01","upperleg01.L","upperleg01.R","foot.L","foot.R"]:
var at=d.device.to_local(actor.bone_world(bone))
check(Vector2(at.x,at.z).length()<1.15 and at.y>.40,"submerged body fits cavity %d/%s %s"%[soul_kind,bone,str(at)])
if soul_kind in [0,7]:
d.motion.restraints.update(actor)
g.camera.position=d.device.position+Vector3(4.0,2.8,4.8);g.camera.look_at(d.device.position+Vector3(0,1.25,0));g.camera.size=4.7
await shot(g,"%d-soul-%d"%( [kind,soul_kind] ))
# All four quarter-turns keep body, anchors and cuffs in the same frame.
d.motion.restraints.update(actor)
var before=[]
for binding in d.motion.restraints.bindings:before.append(binding.cuff.global_position-d.device.position)
var initial=actor.transform
for turn in range(4):
d.device.rotation.y=turn*PI/2
actor.transform=Transform3D(Basis(Vector3.UP,turn*PI/2),d.device.position)*Transform3D(initial.basis,initial.origin-d.device.position)
d.motion.restraints.update(actor)
for j in range(4):check(d.motion.restraints.bindings[j].cuff.global_position.distance_to(d.device.position+before[j].rotated(Vector3.UP,turn*PI/2))<.002,"rotation preserves attachment sides")
d.device.rotation.y=0;actor.transform=initial
actor.queue_free()
await g.get_tree().process_frame
d.motion.restraints.update(null)
check(not d.motion.restraints.visible,"empty apparatus hides live cuffs and chains")
w.dispose_station(d);w.stations.erase(d);w.bars.clear()
await g.get_tree().process_frame
if failures==0:print("ALL EQUIPMENT TESTS PASSED (%d): 6 apparatus, 10 souls, apertures, cavities, seat, inward speakers, moving wheel, four rotations, four anchored restraints"%checks)
g.get_tree().quit(1 if failures else 0)
+1
View File
@@ -37,6 +37,7 @@ func run(g):
var surfaces=d.device.find_children("*","MeshInstance3D",true,false)
var textured=0
for mesh in surfaces:
if mesh.get_meta("apparatus_restraint",false):continue
if mesh==d.flame:continue
if mesh.get_meta("no_walk_collision",false):
check(not mesh.has_node("MeshWalkingCollider"),"internal detail does not duplicate shell physics")
+5
View File
@@ -86,6 +86,7 @@ var quips = ["Ещё один. Наверху сегодня скидки на
func _ready():
var args=OS.get_cmdline_user_args()
if "--test-equipment-models" in args:args.append("--test-mesh")
test_mode="--test-iron-maiden" in args or "--test-intro" in args or "--test-room-decor" in args or "--test-camera-controls" in args or "--test-rubies" in args or "--test-runtime-burn" in args or "--test-single-punishment" in args or "--test-expansion" in args or "--test-imps" in args or "--test-flight-camera" in args or "--test-maintenance" in args or "--test-castle" in args or "--test-building" in args or "--test-workflow" in args or "--test-roster" in args or "--test-priority" in args or "--test-mesh" in args or "--test-economy" in args or "--test-posture" in args or "--test-gait" in args or "--test-visuals" in args or "--test-mode" in args or "--test-exit" in args or "--test-ui" in args or "--test-audio" in args or "--test-sentences" in args or "--test-hud" in args
capture_mode="--capture-workflow" in args or "--capture-roster" in args or "--capture-economy" in args or "--capture-posture" in args or "--capture-gait" in args or "--capture" in args or "--capture-workshop" in args
test_mode=test_mode or "--test-maiden-performance" in args or "--test-performance-soak" in args
@@ -166,6 +167,7 @@ func _ready():
elif "--test-workflow" in args:call_deferred("run_workflow_tests")
elif "--test-roster" in args:call_deferred("run_roster_tests")
elif "--test-priority" in args:call_deferred("run_delivery_priority_tests")
elif "--test-equipment-models" in args:call_deferred("run_equipment_model_tests")
elif "--test-mesh" in args:call_deferred("run_mesh_tests")
elif "--test-sentences" in args:call_deferred("run_sentence_tests")
elif "--test-economy" in args:call_deferred("run_economy_tests")
@@ -969,6 +971,9 @@ func capture_economy():
func run_mesh_tests():
await preload("res://mesh_walking_tests.gd").new().run(self)
func run_equipment_model_tests():
await preload("res://equipment_model_tests.gd").new().run(self)
func run_delivery_priority_tests():
await preload("res://delivery_priority_tests.gd").new().run(self)
+8 -1
View File
@@ -26,13 +26,20 @@ func build(root):
var collider=CollisionShape3D.new()
collider.shape=mesh.get_meta("walk_collision_shape") if mesh.has_meta("walk_collision_shape") else mesh.mesh.create_trimesh_shape()
body.add_child(collider)
collider.shape.backface_collision=true
if collider.shape is ConcavePolygonShape3D:collider.shape.backface_collision=true
func rebuild(stations):
outlines.clear()
for s in stations:
for mesh in s.device.find_children("*","MeshInstance3D",true,false):
if not mesh.has_node("MeshWalkingCollider"):continue
var points=PackedVector2Array()
var collider=mesh.get_node("MeshWalkingCollider").get_child(0) as CollisionShape3D
if collider.shape is ConvexPolygonShape3D:
# The route planner must use the same hull as the swept capsule.
for v in collider.shape.points:
var point=mesh.global_transform*v;points.append(Vector2(point.x,point.z))
if points.size()>2:outlines.append(Geometry2D.convex_hull(points))
continue
var faces=mesh.mesh.get_faces()
for i in range(0,faces.size(),3):
var a=mesh.global_transform*faces[i];var b=mesh.global_transform*faces[i+1];var c=mesh.global_transform*faces[i+2]
+50
View File
@@ -0,0 +1,50 @@
extends RefCounted
# Water, restraints and moving controls stay independent of the Meshy surfaces.
const MODELS={
0:preload("res://art/equipment/meshy_v01/pillory.glb"),
1:preload("res://art/equipment/meshy_v01/rack.glb"),
2:preload("res://art/equipment/meshy_v01/wheel_vat.glb"),
4:preload("res://art/equipment/meshy_v01/musical_chair.glb"),
5:preload("res://art/equipment/meshy_v01/cauldron.glb")}
static var collisions={}
func build(g,d):
var root=d.device
var model=MODELS[d.selected].instantiate();root.add_child(model)
root.set_meta("apparatus_model","meshy_equipment_v01")
for mesh in model.find_children("*","MeshInstance3D",true,false):
var key=str(d.selected)+"/"+str(mesh.name)
if not collisions.has(key):collisions[key]=mesh.mesh.create_convex_shape(true,true)
mesh.set_meta("walk_collision_shape",collisions[key])
if d.selected==0:root.set_meta("pillory_apertures",3)
if d.selected==2:
d.crank=model.find_child("Wheel",true,false)
assert(d.crank!=null,"The wheel requires a separate axle pivot")
root.set_meta("wheel_radius",1.28)
# Central axle is perpendicular to the wheel; the frame stays behind it.
var axle=g.cylinder(root,Vector3(0,1.62,-.31),.12,.52,Color("332e28"));axle.rotation.x=PI/2
g.line(root,Vector3(-1.34,1.62,-.53),Vector3(1.34,1.62,-.53),.085,Color("453124"))
for side in [-1,1]:
g.box(root,Vector3(side*1.35,1.62,-.25),Vector3(.28,.28,.28),Color("332e28"))
for y in [1.53,1.71]:g.ball(root,Vector3(side*1.35,y,-.09),Vector3.ONE*.045,Color("89734b"))
if d.selected in [1,2]:
var handle=Node3D.new();root.add_child(handle);handle.name="WindingHandle"
handle.position=Vector3(1.0,1.08,-1.34) if d.selected==1 else Vector3(1.48,1.62,0)
handle.rotation.y=PI/2
var pivot=Node3D.new();handle.add_child(pivot);pivot.name="HandleRotor"
g.line(pivot,Vector3.ZERO,Vector3(.25,0,0),.035,Color("38332c"))
g.line(pivot,Vector3(.25,0,0),Vector3(.25,0,.20),.04,Color("61432b"))
for mesh in handle.find_children("*","MeshInstance3D",true,false):mesh.set_meta("no_walk_collision",true)
if d.selected==1:d.crank=pivot
root.set_meta("handle_rotor",pivot)
if d.selected==4:
for side in [-1,1]:
var speaker=Node3D.new();root.add_child(speaker);speaker.name="InwardFacingSpeaker"
speaker.position=Vector3(side*.90,1.75,-.18)
var direction=Vector3(0,1.75,-.12)-speaker.position
speaker.rotation.y=atan2(direction.x,direction.z)
d.special.speaker_roots.append(speaker)
# Invisible measured contact proxy for the upholstered seat surface.
var seat=MeshInstance3D.new();root.add_child(seat);seat.name="ChairSeat";seat.position=Vector3(0,.64,-.12)
var contact=BoxMesh.new();contact.size=Vector3(.96,.12,.48);seat.mesh=contact;seat.hide();seat.set_meta("no_walk_collision",true)
d.special["seat"]=seat
var rest=g.box(root,Vector3(0,.29,.53),Vector3(.85,.08,.38),Color("3e3028"));rest.name="ChairFootrest"
+11 -40
View File
@@ -1,54 +1,25 @@
extends RefCounted
const POP=preload("res://audio/infernal_pop.wav")
func build(g,d):
var root=d.device
var wood=Color("48302f");var iron=Color("292d35");var brass=Color("a58b59")
d["special"]={"bubbles":[],"notes":[],"liquid":null,"music":null,"players":[],"speaker_roots":[],"heat":0.0}
preload("res://meshy_equipment.gd").new().build(g,d)
if d.selected==4:
d.special["seat"]=g.box(root,Vector3(0,.62,-.23),Vector3(1.05,.16,.42),wood);d.special.seat.name="ChairSeat"
g.box(root,Vector3(0,.025,.71),Vector3(.85,.05,.45),iron)
g.box(root,Vector3(0,1.45,-.48),Vector3(1.15,1.55,.18),wood)
for x in [-.47,.47]:
for z in [-.40,.20]:g.cylinder(root,Vector3(x,.29,z),.075,.58,iron)
g.box(root,Vector3(x*1.3,1.06,.05),Vector3(.16,.14,.96),wood)
for z in [-.32,.42]:g.line(root,Vector3(x*1.3,.68,z),Vector3(x*1.3,1.05,z),.045,iron)
var cuff=preload("res://leather_cuff.gd").make(g,root,Vector3(x*1.3,1.15,.2),.13);cuff.rotation.x=PI/2
for link_index in range(4):
var link=g.torus(root,Vector3(x*1.3,1.04-link_index*.12,.2),.12,iron)
link.scale=Vector3.ONE*.5;link.rotation.x=PI/2 if link_index%2==0 else 0
for x in [-.23,.23]:
var ankle=preload("res://leather_cuff.gd").make(g,root,Vector3(x,.13,.66),.095);ankle.rotation.x=PI/2
g.line(root,Vector3(x,.13,.66),Vector3(x,.35,.38),.025,iron)
g.box(root,Vector3(0,1.45,-.34),Vector3(1.08,.075,.04),Color("33241e"))
g.box(root,Vector3(0,.91,.12),Vector3(1.08,.075,.045),Color("33241e"))
for side in [-1,1]:
var speaker_root=Node3D.new();root.add_child(speaker_root);speaker_root.name="InwardFacingSpeaker";speaker_root.position=Vector3(side*1.05,1.05,-.45)
var direction=Vector3(0,1.05,.10)-speaker_root.position;speaker_root.rotation.y=atan2(direction.x,direction.z);d.special.speaker_roots.append(speaker_root)
g.box(speaker_root,Vector3.ZERO,Vector3(.50,1.20,.50),iron)
for y in [-.30,.26]:
var speaker=g.cylinder(speaker_root,Vector3(0,y,.27),.19,.045,Color("14141c"));speaker.rotation.x=PI/2
var rim=g.torus(speaker_root,Vector3(0,y,.30),.19,brass);rim.rotation.x=PI/2
g.ball(speaker_root,Vector3(0,y,.31),Vector3(.12,.12,.04),Color("6c4f7d"))
for j in range(9):g.line(speaker_root,Vector3(-.15+j*.038,y-.14,.325),Vector3(-.15+j*.038,y+.14,.325),.004,Color("4b4b52"))
for j in range(3):
var note=g.torus(root,Vector3(side*(.95+j*.10),2.0+j*.18,-.35),.07,Color("b38bd5"));note.hide();d.special.notes.append(note)
var music=AudioStreamPlayer3D.new();speaker_root.add_child(music);music.position.z=.31;music.unit_size=4;music.max_distance=16
for speaker in d.special.speaker_roots:
var music=AudioStreamPlayer3D.new();speaker.add_child(music);music.unit_size=4;music.max_distance=16
music.stream=POP.duplicate();music.stream.loop_mode=AudioStreamWAV.LOOP_FORWARD;music.stream.loop_end=int(music.stream.get_length()*music.stream.mix_rate)
d.special.players.append(music)
for j in range(3):
var note=g.torus(root,speaker.position+Vector3(0,.25+j*.18,0),.07,Color("b38bd5"));note.hide();note.set_meta("no_walk_collision",true);d.special.notes.append(note)
d.special.music=d.special.players[0]
else:
preload("res://cauldron_shell.gd").new().build(g,root)
var liquid=preload("res://water_surface.gd").new().build(g,root,1.24,Vector3(0,1.55,0),true)
d.special.liquid=liquid
g.torus(root,Vector3(0,1.65,0),1.32,brass)
for side in [-1,1]:
var handle=g.torus(root,Vector3(side*1.48,1.15,0),.30,iron);handle.rotation.z=PI/2
for i in range(12):
var a=i*TAU/12
g.ball(root,Vector3(cos(a)*1.38,1.4,sin(a)*1.38),Vector3.ONE*.07,brass)
d.special.liquid=preload("res://water_surface.gd").new().build(g,root,1.24,Vector3(0,1.55,0),true)
for i in range(16):
var bubble=g.ball(root,Vector3.ZERO,Vector3.ONE*.07,Color("c2ddd9"));bubble.hide();d.special.bubbles.append(bubble)
var bubble=g.ball(root,Vector3.ZERO,Vector3.ONE*.07,Color("c2ddd9"));bubble.hide();bubble.set_meta("no_walk_collision",true);d.special.bubbles.append(bubble)
for i in range(10):
var mist=MeshInstance3D.new();root.add_child(mist);var quad=QuadMesh.new();quad.size=Vector2(.38,.8);mist.mesh=quad
var material=ShaderMaterial.new();material.shader=preload("res://steam.gdshader");material.render_priority=111;material.set_shader_parameter("phase",i*.63);mist.material_override=material
mist.position=Vector3(sin(i*2.4)*.85,1.9,cos(i*2.4)*.85)
d.flame=Node3D.new();root.add_child(d.flame)
for i in range(6):
var quad=QuadMesh.new();quad.size=Vector2(.8,.6)
+5 -3
View File
@@ -113,8 +113,8 @@ func update_torture(dt,active):
model.position=Vector3(0,.90,-.12)-bone_local("root");skeleton.force_update_all_bone_transforms()
for side in ["L","R"]:
var sign_x=1 if side=="L" else -1
limb("upperleg01."+side,"lowerleg01."+side,"foot."+side,Vector3(sign_x*.23,.13,.66),Vector3.FORWARD*-1)
align_bone("foot."+side,"toe2-1."+side,bone_local("foot."+side)+Vector3(0,-.045,.18))
limb("upperleg01."+side,"lowerleg01."+side,"foot."+side,Vector3(sign_x*.23,.42,.48),Vector3.FORWARD*-1)
align_bone("foot."+side,"toe2-1."+side,bone_local("foot."+side)+Vector3(0,0,.18))
limb("upperarm01."+side,"lowerarm01."+side,"wrist."+side,Vector3(sign_x*.61,1.15,.2),Vector3(0,0,-1))
turn("head",Vector3.UP,wave*.13);turn("spine02",Vector3.RIGHT,sin(pose_clock*5)*.025*struggle)
elif station_kind==0:
@@ -123,7 +123,8 @@ func update_torture(dt,active):
for side in ["L","R"]:
var sign_x=1 if side=="L" else -1
limb("upperarm01."+side,"lowerarm01."+side,"wrist."+side,Vector3(sign_x*.59,1.70,.08),Vector3(0,0,-1))
limb("upperleg01."+side,"lowerleg01."+side,"foot."+side,Vector3(sign_x*.25,.1,-.4),Vector3(0,0,1))
limb("upperleg01."+side,"lowerleg01."+side,"foot."+side,Vector3(sign_x*.25,.18,-.4),Vector3(0,0,1))
align_bone("foot."+side,"toe2-1."+side,bone_local("foot."+side)+Vector3(0,0,.18))
turn("head",Vector3.RIGHT,impulse*.11)
elif station_kind==1:
for side in ["L","R"]:
@@ -133,6 +134,7 @@ func update_torture(dt,active):
elif station_kind==5:
for side in ["L","R"]:
var sign_x=1 if side=="L" else -1
align_bone("foot."+side,"toe2-1."+side,bone_local("foot."+side)+Vector3(0,0,.18))
limb("upperarm01."+side,"lowerarm01."+side,"wrist."+side,Vector3(sign_x*(.72+sin(pose_clock*5)*.12),1.65+sin(pose_clock*6+sign_x)*.2,.32),Vector3(sign_x,0,1))
turn("head",Vector3.UP,wave*.16)
else:turn("head",Vector3.UP,wave*.10)
+1 -1
View File
@@ -13,7 +13,7 @@ func run(g):
for side in ["L","R"]:
var x=1 if side=="L" else -1
print("CHAIR ",kind," ",side," foot=",actor.bone_local("foot."+side)," wrist=",actor.bone_local("wrist."+side))
check(actor.bone_local("foot."+side).distance_to(Vector3(x*.23,.13,.66))<.13,"chair ankle %d"%kind)
check(actor.bone_local("foot."+side).distance_to(Vector3(x*.23,.42,.48))<.13,"chair ankle on raised footrest %d"%kind)
check(actor.bone_local("wrist."+side).distance_to(Vector3(x*.61,1.15,.2))<.12,"chair wrist %d"%kind)
var before=actor.bone_world("head");actor.update_torture(.2,true)
check(actor.bone_world("head").distance_to(before)>.001,"chair reaction")
+1 -1
View File
@@ -65,7 +65,7 @@ func run(g):
w.reset();check(w.expansion_level==0 and is_equal_approx(g.architecture.growth.right_edge(),12),"new game restores original room bounds")
g.paused=false;d=w.add_station(4,Vector3(3,0,0))
for speaker in d.special.speaker_roots:
var target=(Vector3(0,1.05,.10)-speaker.position).normalized()
var target=(Vector3(0,1.75,-.12)-speaker.position).normalized()
check(speaker.basis.z.dot(target)>.99,"speaker faces seated soul")
for kind in range(10):
var actor=g.make_person(false,kind);g.add_child(actor);actor.mount_station(4);actor.update_torture(0,false)
+4 -6
View File
@@ -305,11 +305,9 @@ func cancel_placement(show_catalogue=true):
if is_instance_valid(catalogue):catalogue.visible=show_catalogue and build_mode
func make_ghost():
if moving>=0:
ghost=stations[moving].device.duplicate()
g.add_child(ghost)
else:
ghost=make_device(pending,Vector3.ZERO).device
# A placement preview needs only fresh visuals, not live restraint scripts,
# station dictionaries or references to the original moving nodes.
ghost=make_device(pending,Vector3.ZERO).device
ghost.name="PlacementGhost";ghost.show()
ghost_material=StandardMaterial3D.new()
ghost_material.transparency=BaseMaterial3D.TRANSPARENCY_ALPHA
@@ -507,7 +505,7 @@ func rebuild_nav():
for x in range(nav.region.size.x):
for z in range(22):
var p=Vector2(-7.5+x*.5,-5+z*.5)
var blocked=mesh_walking.blocked(p) or p.x>walk_right()
var blocked=mesh_walking.blocked(p,.42) or p.x>walk_right()
nav.set_point_solid(Vector2i(x,z),blocked)
if not blocked and p.x>=-7.1 and p.x<=walk_right() and p.y>=-4.8 and p.y<=5.6:
free_floor_points.append(Vector3(p.x,0,p.y))