Ship mounts: a thruster's mesh is an unrendered emission surface
Ruling thrusters-radiators-are-meshes: thruster and radiator mounts are meshes; the thruster's is not drawn and is the surface its exhaust emits from, the radiator's is drawn. The assembler already required a mesh for both; it now turns rendering off on the thruster emitter, and the preview smoke checks it. The authoring doc states the mount rules and the mesh rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
976b711905
commit
95c0fa621b
3 changed files with 18 additions and 8 deletions
|
|
@ -65,7 +65,8 @@ public static class ShipModPreview
|
|||
ship.HullColliders[0].GetComponent<MeshCollider>() != null, "one hull collider with a MeshCollider");
|
||||
Require(Inside(ship.MapIcon) && Inside(ship.Shield) && Inside(ship.TractorBeam), "map icon, shield and tractor inside the ship");
|
||||
Require(ship.ThrusterHardpoints.Select(node => node.name).SequenceEqual(plan.Thrusters) &&
|
||||
ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter)), "thruster hardpoints with emitters");
|
||||
ship.ThrusterHardpoints.All(node => Inside(node) && Inside(node.Emitter) && node.Emitter.forceRenderingOff),
|
||||
"thruster hardpoints with unrendered emitter meshes");
|
||||
Require(ship.RadiatorHardpoints.Select(node => node.name).SequenceEqual(plan.Radiators) &&
|
||||
ship.RadiatorHardpoints.All(node => Inside(node) && Inside(node.Mesh)), "radiator hardpoints with meshes");
|
||||
Require(ship.WeaponHardpoints.Select(node => node.name).SequenceEqual(plan.Weapons.Select(weapon => weapon.Mount)) &&
|
||||
|
|
|
|||
|
|
@ -122,8 +122,10 @@ public static class ShipModShips
|
|||
|
||||
var thrusters = plan.Thrusters.Select(id =>
|
||||
{
|
||||
// The thruster's mesh is its exhaust's emission surface, never drawn (ruling thrusters-radiators-are-meshes).
|
||||
var hardpoint = AddOrGet<ThrusterHardpoint>(Node(id).gameObject);
|
||||
hardpoint.Emitter = Renderer(id);
|
||||
hardpoint.Emitter.forceRenderingOff = true;
|
||||
return hardpoint;
|
||||
}).ToArray();
|
||||
var radiators = plan.Radiators.Select(id =>
|
||||
|
|
|
|||
|
|
@ -161,13 +161,20 @@ import](https://github.com/Unity-Technologies/com.unity.cloud.gltfast/blob/main/
|
|||
to read the package GLB asynchronously and map its stable node IDs to Unity
|
||||
transforms. It keeps a partially loaded object inactive and destroys it on
|
||||
failure. `ShipModShips` preloads one assembled, inactive prototype per hull
|
||||
that names a `Visual`, at boot and before the game scene loads. `ShipModPlan`
|
||||
decides which anchor fills which `ShipInstance` slot: the hull's hardpoint type
|
||||
says what a mount is, and its anchor (id equal to the mount id) supplies the
|
||||
node; a thruster mount needs a `thruster-emitter` anchor, a radiator mount a
|
||||
`radiator-mesh` anchor, a weapon mount muzzle anchors parented to it. An
|
||||
`articulation` anchor is an ordinary mount node until pivots move onto
|
||||
`HullData`. The shared effects (shield, tractor beam, ping, explosion, map
|
||||
that names a `Visual`, at boot and before the game scene loads.
|
||||
`ShipAuthoringStore.Validate` owns which hardpoints carry anchors and which role
|
||||
each anchor plays. Mount anchors exist only for hardpoints that show on the
|
||||
model: weapons, radiators and thrusters. Each such hardpoint needs an anchor
|
||||
whose id is its mount id: `thruster-emitter` for a thruster, `radiator-mesh` for
|
||||
a radiator, `weapon-mount` for an energy, ballistic or launcher hardpoint. An
|
||||
internal hardpoint (reactor, sensors, shield and the rest) has no anchor, and
|
||||
an anchor taking its id is refused. A thruster's or radiator's anchor node is a
|
||||
mesh: the thruster's is not rendered and is the surface its exhaust emits from,
|
||||
the radiator's is rendered. A weapon mount is a point, and each one needs at
|
||||
least one `weapon-muzzle` anchor whose `ParentId` is the weapon's mount id.
|
||||
`articulation` is reserved for pivots and is never a mount; no pivot is
|
||||
planned until pivots move onto `HullData`. `ShipModPlan` then maps the
|
||||
validated pair to `ShipInstance` slots and refuses nothing itself. The shared effects (shield, tractor beam, ping, explosion, map
|
||||
and invisible materials) come from the Addressable `ShipModTemplate` prefab.
|
||||
`ZoneRenderer.LoadEntity` clones the prototype when the hull names a `Visual`.
|
||||
Gameplay reads a mod ship's records from the derived catalog; the package
|
||||
|
|
|
|||
Loading…
Reference in a new issue