diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2025-11-09 19:07:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-09 19:07:44 -0700 |
| commit | de9c5d510175bba11ab8704e67be3a3a94f9149e (patch) | |
| tree | 34c42dbfe9f2a6eb5fbce5f6a31b532ff2a3f243 /src/engine/Actor.h | |
| parent | 760fa3bf5226c2a6052a5d4d53fd0e27f2911e60 (diff) | |
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>
Diffstat (limited to 'src/engine/Actor.h')
| -rw-r--r-- | src/engine/Actor.h | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/engine/Actor.h b/src/engine/Actor.h index fb0a9f89e..0cbd294cd 100644 --- a/src/engine/Actor.h +++ b/src/engine/Actor.h @@ -1,7 +1,8 @@ #pragma once #include <libultraship.h> -#include "CoreMath.h" +#include "engine/SpawnParams.h" +#include "engine/editor/EditorMath.h" extern "C" { #include "macros.h" @@ -9,10 +10,8 @@ extern "C" { #include "camera.h" #include "common_structs.h" - class AActor { public: - /* 0x00 */ s16 Type = 0; /* 0x02 */ s16 Flags; /* 0x04 */ s16 Unk_04; @@ -24,25 +23,51 @@ public: /* 0x18 */ Vec3f Pos; /* 0x24 */ Vec3f Velocity = {0, 0, 0}; /* 0x30 */ Collision Unk30; + /* 0x */ const char* Model = ""; uint8_t uuid[16]; const char* Name = ""; + const char* ResourceName = ""; + FVector SpawnPos = {0.0f, 0.0f, 0.0f}; + IRotator SpawnRot = {0, 0, 0}; + FVector SpawnScale = {1.0f, 1.0f, 1.0f}; + FVector Scale = {1, 1, 1}; + float Speed = 0.0f; + std::vector<Triangle> Triangles; - Gfx* Model = NULL; + bool bPendingDestroy = false; virtual ~AActor() = default; // Virtual destructor for proper cleanup in derived classes explicit AActor(); + explicit AActor(SpawnParams params); + /** + * Make sure you call this in derived classes! + * Usage: + * MyActor::SetSpawnParams(SetSpawnParams& params) { + * AActor::SetSpawnParams(params); // Calls default implementation + * } + */ + virtual void SetSpawnParams(SpawnParams& params); + virtual void BeginPlay(); virtual void Tick(); virtual void Draw(Camera*); virtual void Collision(Player* player, AActor* actor); virtual void VehicleCollision(s32 playerId, Player* player); void SetLocation(FVector pos); - FVector GetLocation() const; virtual void Destroy(); virtual bool IsMod(); + + /** Editor functions **/ + FVector GetLocation() const; + IRotator GetRotation() const; + FVector GetScale() const; + void Translate(FVector pos); + void Rotate(IRotator rot); + void SetScale(FVector scale); + virtual void DrawEditorProperties() { DrawDefaultEditorProperties(); }; }; -}
\ No newline at end of file +} |
