Puppet.Centre: the world centre of the drawn bounds, forwarded by BodyRenderer.PuppetCentre
The point the orbit camera turns about. Null before the first draw. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2bfb26b75b
commit
1d60ed6087
2 changed files with 6 additions and 0 deletions
|
|
@ -22,6 +22,9 @@ public partial class BodyRenderer : Node3D
|
|||
/// <summary>What the puppet's mesh is made of now, or null while it draws none.</summary>
|
||||
public PuppetShape? PuppetShape => _puppet.Shape;
|
||||
|
||||
/// <summary>The world centre of the puppet's drawn bounds, or null before the first draw: where the camera orbits.</summary>
|
||||
public Vector3? PuppetCentre => _puppet.Centre;
|
||||
|
||||
/// <summary>How many times the puppet's Godot mesh has been built.</summary>
|
||||
public int PuppetMeshBuilds => _puppet.MeshBuilds;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ public partial class Puppet : Node3D
|
|||
/// <summary>What the puppet is made of now, or null before the first build or while it draws nothing (too many bodies).</summary>
|
||||
public PuppetShape? Shape => _model.Shape;
|
||||
|
||||
/// <summary>The world centre of the puppet's drawn bounds (the mesh's <c>CustomAabb</c>, in the skin's space), or null before the first draw.</summary>
|
||||
public Vector3? Centre => _mesh is { CustomAabb: { } box } && box.HasSurface() ? _skin.GlobalTransform * (box.Position + box.Size / 2) : null;
|
||||
|
||||
public override void _Ready() => AddChild(_skin);
|
||||
|
||||
/// <summary>Where the puppet draws body <paramref name="stableId"/> now (world), or null if it draws no such body.</summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue