From de9c5d510175bba11ab8704e67be3a3a94f9149e Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sun, 9 Nov 2025 19:07:44 -0700 Subject: Implement SpawnParams struct (#536) * Impl SpawnParams * Added json submodule * Update json * Update * Works * Remove comment * Works refactor * Snowman and thwomp working * Impl hot air balloon * More progress * All OObjects are done * cleanup * Refactor 2Dpath to normal path * Update nlohmann json & fix compile * Rest of actors * MORE CHANGES * Finish actors * Done PR, some fix to collision viewer * Impl falling rocks * Add const * wip editor refactor * Property work * continue * Overridable editor properties * Actor saving/loading works now * Fix light alignment * Clarification * Impl penguin * params impl signs * properties impl falling rock * More property impls * impl air balloon * Add spawnParams to OObject Translate * Snowman translate better * impl hedgehog properly * properties impl trophy * thwomp progress * Finish impl properties * Fix compile * Fix cursor collisions * Move registered actors * Rename pathPoint XYZ to xyz * Fix editor pause bug * Clean up * Review comments * Remove SpawnParams struct from actor classes * Rename * Player Label First Iteration * Work now * Working 3d text * Fix boo bug * Finish AText actor * Fix spawnparams compile * Register AText * Finish Text Actor * Fix thwomp interpolation * Fix compile * Fix crab and hedgehog * Fix loading flagpole * Fix Hot Air Balloon * Turn zbuffer on for AText * Update --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com> --- src/engine/editor/GameObject.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/engine/editor/GameObject.cpp') diff --git a/src/engine/editor/GameObject.cpp b/src/engine/editor/GameObject.cpp index 6f52c8ac8..30a1722f4 100644 --- a/src/engine/editor/GameObject.cpp +++ b/src/engine/editor/GameObject.cpp @@ -3,8 +3,7 @@ namespace Editor { - GameObject::GameObject(const char* name, FVector* pos, IRotator* rot, FVector* scale, Gfx* model, std::vector triangles, CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue) { - Name = name; + GameObject::GameObject(FVector pos, IRotator rot, FVector scale, const char* model, std::vector triangles, CollisionType collision, float boundingBoxSize) { Pos = pos; Rot = rot; Scale = scale; @@ -12,13 +11,6 @@ namespace Editor { Triangles = triangles; Collision = collision; BoundingBoxSize = boundingBoxSize; - DespawnFlag = despawnFlag; - DespawnValue = despawnValue; - } - - GameObject::GameObject(FVector* pos, Vec3s* rot) { - //Pos = pos; - //Rot = rot; } GameObject::GameObject() {}; @@ -27,4 +19,23 @@ namespace Editor { void GameObject::Tick(){}; + FVector GameObject::GetLocation() const { + return Pos; + }; + IRotator GameObject::GetRotation() const { + return Rot; + } + FVector GameObject::GetScale() const { + return Scale; + } + void GameObject::Translate(FVector pos) { + Pos = pos; + }; + void GameObject::Rotate(IRotator rot) { + Rot = rot; + }; + void GameObject::SetScale(FVector scale) { + Scale = scale; + }; + } // namespace Editor -- cgit v1.2.3