changelog
arcology updated ship models in particle fx is broken on kestrel
This commit is contained in:
+51
-22
@@ -66,20 +66,40 @@ const EARTH_SOI: float = 20000000.0
|
||||
const EVA_SNAP_PEAK: float = 6.0
|
||||
const STEP_HEIGHT: float = 0.22
|
||||
const WALK_FLOORS: Array[String] = [
|
||||
"Deck_", "Stair_A_Treads", "Stair_B_Treads",
|
||||
"Stair_A_Landings", "Stair_B_Landings",
|
||||
"Stair_TopLandings", "Stair_HeadLanding", "Stair_LevelLandings",
|
||||
"Lecture_Steps", "Lecture_Tiers",
|
||||
"Yard_Floor", "Yard_Pads", "Yard_Apron", "Yard_Ramps", "Yard_Bridges", "Yard_Spoke",
|
||||
"Deck_",
|
||||
"Stair_A_Treads", "Stair_B_Treads",
|
||||
"Stair_A_Landings", "Stair_B_Landings", "Stair_LevelLandings",
|
||||
"Stair_TopLandings", "Stair_HeadLanding",
|
||||
"Lecture_Steps", "Lecture_Tiers", "Lecture_Seats", "School_Stage",
|
||||
"Yard_Floor", "Yard_Apron", "Yard_Spoke", "Yard_Ramps",
|
||||
"Yard_Bridges", "Yard_Stairs", "Yard_CollarWalk", "Yard_Piers",
|
||||
"Dock_Gallery", "Dock_Threshold",
|
||||
"Elev_Landings", "Fusion_Basemat", "School_Stage",
|
||||
"Elev_Landings", "Fusion_Basemat", "Fusion_AmbulatoryWide",
|
||||
"Live_Terraces",
|
||||
]
|
||||
const WALK_WALLS: Array[String] = [
|
||||
"Hull_Below", "Hull_Band", "Hull_Lintel", "Hull_Gates",
|
||||
"Yard_Wall", "NAF_Blocks", "Fusion_Wall",
|
||||
"Hull_Below", "Hull_Band", "Hull_Lintel",
|
||||
"Yard_Wall", "Yard_StairRail", "Yard_Rails", "Yard_RampCurbs",
|
||||
"Stair_A_Rails", "Stair_B_Rails",
|
||||
"NAF_Blocks",
|
||||
"Fusion_Wall", "Fusion_Pane", "Fusion_Frame", "Fusion_DoorFrames",
|
||||
"Fusion_Control", "Fusion_Cryoplant", "Fusion_Turbine", "Fusion_Exchanger",
|
||||
"Fusion_Columns", "Fusion_ShieldHigh", "Fusion_ShieldLow",
|
||||
"Fusion_CryostatHigh", "Fusion_CryostatLow",
|
||||
"School_Rooms", "School_Library", "School_Bulkhead",
|
||||
"Live_Wall", "Core_", "Dock_Hall", "Dock_Vestibule",
|
||||
"Well_Curb", "Lecture_Backs",
|
||||
"School_Colonnade", "Lecture_Pillars", "Lecture_Backs", "Lecture_Curb",
|
||||
"Live_Wall",
|
||||
"Market_Colonnade", "Market_Stalls",
|
||||
"Core_",
|
||||
"Dock_Hall", "Dock_Vestibule", "Dock_Frame", "Dock_Roof", "Dock_Rail",
|
||||
"Well_Curb", "Well_Beam",
|
||||
"Cap_Shell",
|
||||
]
|
||||
const WALK_SKIP: Array[String] = [
|
||||
"Light", "LightRig_", "Elev_Cab_", "Exchange_Neon_",
|
||||
"Stair_Lamps", "School_RoomDoors", "School_LibraryDoor",
|
||||
"Well_Seal", "Well_Planet_", "Well_Beacon_",
|
||||
"Marker_",
|
||||
]
|
||||
|
||||
var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
@@ -1180,25 +1200,33 @@ func _add_walk_collision(n: Node) -> int:
|
||||
for c in n.get_children():
|
||||
made += _add_walk_collision(c)
|
||||
if n is MeshInstance3D and _walkable_mesh(n.name) and (n as MeshInstance3D).mesh:
|
||||
for c in n.get_children():
|
||||
if c is StaticBody3D:
|
||||
return made
|
||||
var mesh := n as MeshInstance3D
|
||||
mesh.create_trimesh_collision()
|
||||
var body: StaticBody3D = null
|
||||
for c in mesh.get_children():
|
||||
if c is StaticBody3D:
|
||||
var body := c as StaticBody3D
|
||||
body.collision_layer = 1
|
||||
body.collision_mask = 0
|
||||
made += 1
|
||||
body = c as StaticBody3D
|
||||
break
|
||||
if body == null:
|
||||
mesh.create_trimesh_collision()
|
||||
for c in mesh.get_children():
|
||||
if c is StaticBody3D:
|
||||
body = c as StaticBody3D
|
||||
break
|
||||
if body == null:
|
||||
return made
|
||||
body.collision_layer = 1
|
||||
body.collision_mask = 0
|
||||
for s in body.get_children():
|
||||
if s is CollisionShape3D and (s as CollisionShape3D).shape is ConcavePolygonShape3D:
|
||||
((s as CollisionShape3D).shape as ConcavePolygonShape3D).backface_collision = true
|
||||
made += 1
|
||||
return made
|
||||
|
||||
|
||||
func _walkable_mesh(mesh_name: String) -> bool:
|
||||
if mesh_name.begins_with("Light") or mesh_name.begins_with("Stair_A_Rails") or mesh_name.begins_with("Stair_B_Rails"):
|
||||
return false
|
||||
if mesh_name.begins_with("Stair_Lamps") or mesh_name.begins_with("Elev_Cab_"):
|
||||
return false
|
||||
for s in WALK_SKIP:
|
||||
if mesh_name.begins_with(s):
|
||||
return false
|
||||
for prefix in WALK_FLOORS:
|
||||
if mesh_name.begins_with(prefix):
|
||||
return true
|
||||
@@ -1254,3 +1282,4 @@ func _try_step(up: Vector3) -> void:
|
||||
if lift < 0.04 or lift > STEP_HEIGHT:
|
||||
return
|
||||
global_position += up * (lift + 0.02)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user