Skip to content

Fix/surface placement transforms & AI simulation - #159

Open
TheDevilsKnock wants to merge 3 commits into
legacyfrom
fix/surface-placement-transforms
Open

TheDevilsKnock wants to merge 3 commits into
legacyfrom
fix/surface-placement-transforms

Conversation

@TheDevilsKnock

Copy link
Copy Markdown
Collaborator

No description provided.

Preserve object transforms when aligning, snapping, or resetting surface alignment.

- centralize surface raycasting and transform calculations
- preserve heading and uniform scale during surface alignment
- snap objects vertically without changing their world X/Z position
- preserve position and scale when resetting alignment
- record undo actions only when objects are actually modified
Centralize surface detection, alignment, and height correction in the
EditorSurfacePlacement utility.

Preserve object heading and uniform scale when aligning transforms to
surface normals, avoiding rotation drift during continuous placement.

Snap dragged objects to the detected surface independently of magnet
alignment, while retaining the existing ground-mode behavior.

Preserve multi-object layout offsets during dragging and project each
selected object onto its own underlying surface in magnet mode.

Apply the same surface-placement behavior to in-hand objects, including
per-object surface alignment, scale-aware height offsets, and stable
placement heading.

Cache repeated surface projections and ignored-object collections to
reduce raycast allocation and processing during frame updates.

Update clipboard placement and surface commands to use the shared
implementation and skip invalid surface transforms safely.

Finalize independently placed child transforms through undo and
multiplayer synchronization when dragging ends.
Separate creature simulation from active AI behavior so editor spawned animals and infected can safely transition  between frozen, passive, and active states.

- spawn editor objects with simulation disabled by default
- remove eager AI initialization and the delayed simulation-disable race
- initialize AI agents only when active behavior is requested
- synchronize creature transforms before re-enabling simulation to prevent objects returning to their original spawn position
- restore an entity's previous simulation state after inventory editing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant