Round 6 fixes: held tools, headlamp glare, ladder openings, level horizon, roof hulls, rain hits, idle motion, belt packs, meadow variety
- Held tools sit lower and further right; the hammer faces forward and strikes about the camera's right - Headlamp leaves held items, treats and vending machines alone (rendering layer NoLamp); other lights keep lighting them - Hay grounded on the floor in world space (it floated) - Deck fence opens at each ladder, rail colliders split around it; ladders moved to 2 m off the edge middle, clear of the intakes; climbing goes over a rail only if one is in the way - Crew stand to the soil's up (Planet.Level): flat round the base, the ball's up past it, so the horizon stays level on a small planet - Convex roof hulls for the crew cabin, garage, pitched roof and windmill tower; cabin box lowered to the eaves - Rain and acid rain hits differ by surface: soil, grass, wood, metal - Idle motion: dishes pan, sways sway, sensors turn, eyes blink, windmill turns in the breeze, reels and parked rotors tick over - Belt: take tools off at the supply wall; hold E at a vending machine for a pack of 3 on the belt, LMB has one - New meadow pieces: boulders, slab stones, crystals, mushrooms, stump, bulb plants - -demofix checks for all of the above; loc rows in all 11 tables Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -8,6 +8,9 @@ namespace GrassCutter
|
||||
{
|
||||
public static DeckManager Instance { get; private set; }
|
||||
public GameObject tileModel, ladderModel;
|
||||
/// <summary>How far along each open edge from its middle the ladder hangs: clear of the intakes at the middle of
|
||||
/// the edge tiles, in the opening the fence model leaves for it.</summary>
|
||||
public const float LadderAt = 2.0f;
|
||||
/// <summary>Deck-edge points that must stay open (the dock): the railing on that side of the tile is left out.</summary>
|
||||
public Vector3[] gaps;
|
||||
readonly Dictionary<int, DeckTileView> _views = new Dictionary<int, DeckTileView>();
|
||||
@ -129,10 +132,26 @@ namespace GrassCutter
|
||||
return bc;
|
||||
}
|
||||
float h = 1.0f, e = S * 0.5f - 0.12f;
|
||||
v.colN = Rail("RailN", new Vector3(0, h * 0.5f, e), new Vector3(S, h, 0.1f));
|
||||
v.colS = Rail("RailS", new Vector3(0, h * 0.5f, -e), new Vector3(S, h, 0.1f));
|
||||
v.colE = Rail("RailE", new Vector3(e, h * 0.5f, 0), new Vector3(0.1f, h, S));
|
||||
v.colW = Rail("RailW", new Vector3(-e, h * 0.5f, 0), new Vector3(0.1f, h, S));
|
||||
// each railing stops either side of its ladder: the opening the fence model leaves there. The part of the rail
|
||||
// beside the opening (the short piece out to the corner) is its own child of the main one, so SetEdges toggles both
|
||||
float gapMid = LadderAt, gapHalf = 0.48f;
|
||||
float lenA = S * 0.5f + gapMid - gapHalf, lenB = S * 0.5f - gapMid - gapHalf;
|
||||
BoxCollider Split(string n, Vector3 normal, Vector3 along)
|
||||
{
|
||||
// `along` points from the corner at -S/2 to the one at +S/2; the ladder sits at +gapMid along it
|
||||
var a = Rail(n, normal * e + Vector3.up * h * 0.5f + along * (-S * 0.5f + lenA * 0.5f), Abs(along * lenA) + Abs(normal) * 0.1f + Vector3.up * h);
|
||||
var b = new GameObject(n + "_b") { layer = Physics.IgnoreRaycastLayer };
|
||||
b.transform.SetParent(a.transform, false);
|
||||
b.transform.position = a.transform.parent.TransformPoint(normal * e + Vector3.up * h * 0.5f + along * (S * 0.5f - lenB * 0.5f));
|
||||
b.AddComponent<BoxCollider>().size = Abs(along * lenB) + Abs(normal) * 0.1f + Vector3.up * h;
|
||||
return a;
|
||||
}
|
||||
static Vector3 Abs(Vector3 v) => new Vector3(Mathf.Abs(v.x), Mathf.Abs(v.y), Mathf.Abs(v.z));
|
||||
// ladder spots: N at x = -LadderAt, S at x = +LadderAt, E at z = +LadderAt, W at z = -LadderAt
|
||||
v.colN = Split("RailN", Vector3.forward, Vector3.left);
|
||||
v.colS = Split("RailS", Vector3.back, Vector3.right);
|
||||
v.colE = Split("RailE", Vector3.right, Vector3.forward);
|
||||
v.colW = Split("RailW", Vector3.left, Vector3.back);
|
||||
// ladders down to the meadow on every open edge (shown by SetEdges)
|
||||
if (ladderModel)
|
||||
{
|
||||
@ -146,10 +165,10 @@ namespace GrassCutter
|
||||
l.transform.localRotation = Quaternion.Euler(0, yaw, 0) * ladderModel.transform.localRotation;
|
||||
}
|
||||
// front of the ladder model hangs toward -Y Blender = +Z Unity (yaw 0 → toward +Z)
|
||||
L(new Vector3(-1.5f, 0f, S * 0.5f), 0f);
|
||||
L(new Vector3(1.5f, 0f, -S * 0.5f), 180f);
|
||||
L(new Vector3(S * 0.5f, 0f, 1.5f), 90f);
|
||||
L(new Vector3(-S * 0.5f, 0f, -1.5f), 270f);
|
||||
L(new Vector3(-LadderAt, 0f, S * 0.5f), 0f);
|
||||
L(new Vector3(LadderAt, 0f, -S * 0.5f), 180f);
|
||||
L(new Vector3(S * 0.5f, 0f, LadderAt), 90f);
|
||||
L(new Vector3(-S * 0.5f, 0f, -LadderAt), 270f);
|
||||
}
|
||||
foreach (var t in go.GetComponentsInChildren<Transform>(true)) t.gameObject.isStatic = false;
|
||||
_views[packed] = v;
|
||||
|
||||
Reference in New Issue
Block a user