mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 17:13:51 +00:00
feat(editor): undo object placement, snap to ground, keyboard shortcuts
- Ctrl+Z in Object/NPC mode undoes last placement (50-deep stack) - "Snap Ground" button raycasts straight down to place object on terrain - Useful for objects placed too high or moved off terrain surface - Undo stack adjusts indices when objects are removed mid-stack
This commit is contained in:
parent
ace6173401
commit
88abbfb564
5 changed files with 50 additions and 5 deletions
|
|
@ -57,6 +57,10 @@ public:
|
|||
float getPlacementScale() const { return placementScale_; }
|
||||
void setPlacementScale(float s) { placementScale_ = s; }
|
||||
|
||||
// Undo last placement
|
||||
bool canUndoPlace() const { return !undoStack_.empty(); }
|
||||
void undoLastPlace();
|
||||
|
||||
private:
|
||||
uint32_t nextUniqueId();
|
||||
|
||||
|
|
@ -65,6 +69,7 @@ private:
|
|||
PlaceableType activeType_ = PlaceableType::M2;
|
||||
|
||||
std::vector<PlacedObject> objects_;
|
||||
std::vector<int> undoStack_; // indices of recently placed objects
|
||||
int selectedIdx_ = -1;
|
||||
uint32_t uniqueIdCounter_ = 1;
|
||||
float placementRotY_ = 0.0f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue