mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-05-14 03:15:05 +00:00
- 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.
25 lines
630 B
C++
25 lines
630 B
C++
#ifndef ROTATORSUBCOMPONENT_H
|
|
#define ROTATORSUBCOMPONENT_H
|
|
|
|
#include "PlatformSubComponent.h"
|
|
|
|
/**
|
|
* Rotator - follows a path like Mover but also applies angular velocity.
|
|
* Corresponds to client LWOPlatformRotator (type 6).
|
|
*/
|
|
class RotatorSubComponent final : public PlatformSubComponent {
|
|
public:
|
|
RotatorSubComponent(Entity* parentEntity, const Path* path);
|
|
|
|
void UpdatePositionAlongPath(float deltaTime) override;
|
|
|
|
private:
|
|
NiPoint3 m_RotationAxis{};
|
|
float m_Rate = 0.0f;
|
|
NiPoint3 m_AngularVelocity{};
|
|
bool m_AllowRotSnap = true;
|
|
float m_MaxLerpAngle = 0.785398f; // ~45 degrees
|
|
};
|
|
|
|
#endif // ROTATORSUBCOMPONENT_H
|