Refactor MovingPlatformComponent to support subcomponents for movement and rotation

- Introduced PlatformSubComponent as a base class for platform movement logic.
- Added MoverSubComponent for standard path-following behavior.
- Implemented SimpleMoverSubComponent for auto-generating two-waypoint paths.
- Created RotatorSubComponent to handle angular velocity and rotation along paths.
- Updated MovingPlatformComponent to manage multiple subcomponents and their states.
- Modified serialization and update logic to accommodate new subcomponent architecture.
- Adjusted GameMessages to include additional parameters for platform state synchronization.
- Enhanced SimplePhysicsComponent to prevent double movement when on a moving platform.
- Added new CMakeLists.txt for organizing MovingPlatformComponent files.
This commit is contained in:
Aaron Kimbrell
2026-04-08 16:32:10 -05:00
parent 247576e101
commit 5e40aaf420
17 changed files with 1097 additions and 430 deletions

View File

@@ -261,6 +261,19 @@ public:
/**
* Push or Pop a layer of stun immunity to this entity
*/
/**
* Sets the platform the entity is standing on for local space serialization
*/
void SetPlatformEntity(LWOOBJID platformID) { m_PlatformEntityID = platformID; m_DirtyPosition = true; }
/**
* Returns the platform the entity is standing on
*/
LWOOBJID GetPlatformEntity() const { return m_PlatformEntityID; }
void SetLocalSpacePosition(const NiPoint3& pos) { m_LocalSpacePosition = pos; }
void SetLocalSpaceLinearVelocity(const NiPoint3& vel) { m_LocalSpaceLinearVelocity = vel; }
void SetStunImmunity(
const eStateChangeType state,
const LWOOBJID originator = LWOOBJID_EMPTY,
@@ -403,6 +416,21 @@ private:
/**
* stun immunity counters
*/
/**
* The platform entity the player is standing on (for local space serialization)
*/
LWOOBJID m_PlatformEntityID = LWOOBJID_EMPTY;
/**
* The player's position in the platform's local space
*/
NiPoint3 m_LocalSpacePosition{};
/**
* The player's linear velocity in the platform's local space
*/
NiPoint3 m_LocalSpaceLinearVelocity{};
int32_t m_ImmuneToStunAttackCount;
int32_t m_ImmuneToStunEquipCount;
int32_t m_ImmuneToStunInteractCount;