Package recentres on the grid's centre of mass and generates map icon, shield, tractor; no collider
AetherDb ship-authoring centre prints Shape.CenterOfMass; Package asks it and moves Ship Root so that point sits at the world origin, after regenerating the unowned map icon, shield and tractor from the render meshes (Keep leaves one alone). Package never makes a hull collider (ruling package-frame-defer-collider). smoke_package's bound-collection rollback cases now rebind to a different path so a rollback that restores keys but not values fails. C# not yet built when committed; the Blender smokes and Python unit tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
92b82e9aa5
commit
8d9acf269d
7 changed files with 360 additions and 31 deletions
|
|
@ -1,13 +1,14 @@
|
|||
using GameCult.Caching;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
// Uses the existing database executable; mod authoring does not earn another binary target.
|
||||
public static class ShipAuthoringCommands
|
||||
{
|
||||
private const string Usage = "ship-authoring create <ship.cc> <stable-id> <name> [--like <shipped hull name>] | inspect <ship.cc> | validate <ship.cc> | compose <shipped.cc> <derived.cc> <mods-dir>";
|
||||
private const string Usage = "ship-authoring create <ship.cc> <stable-id> <name> [--like <shipped hull name>] | inspect <ship.cc> | centre <ship.cc> | validate <ship.cc> | compose <shipped.cc> <derived.cc> <mods-dir>";
|
||||
|
||||
public static int Run(string[] args)
|
||||
{
|
||||
|
|
@ -31,6 +32,13 @@ public static class ShipAuthoringCommands
|
|||
Console.WriteLine($"{ship.Id}: {hull.Name}, {hull.Hardpoints?.Count ?? 0} hardpoints, {ship.SchematicLines?.Count ?? 0} lines, {ship.SchematicLines?.Sum(line => line.Points?.Length / 3 ?? 0) ?? 0} points");
|
||||
return 0;
|
||||
}
|
||||
if (args[0] == "centre" && args.Length == 2)
|
||||
{
|
||||
// The one centre of mass Blender places a ship by: Shape.CenterOfMass in cell coordinates, as "x y".
|
||||
var centre = ShipAuthoringStore.Load(args[1]).Hull.Shape.CenterOfMass;
|
||||
Console.WriteLine(string.Create(CultureInfo.InvariantCulture, $"{centre.x:R} {centre.y:R}"));
|
||||
return 0;
|
||||
}
|
||||
if (args[0] == "validate" && args.Length == 2)
|
||||
{
|
||||
// The package's GLB is judged too once it exists (node ids, mesh roles); a draft without one is judged on
|
||||
|
|
|
|||
Loading…
Reference in a new issue