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.
29 lines
812 B
C++
29 lines
812 B
C++
#ifndef SIMPLEMOVERSUBCOMPONENT_H
|
|
#define SIMPLEMOVERSUBCOMPONENT_H
|
|
|
|
#include "PlatformSubComponent.h"
|
|
|
|
#include <memory>
|
|
|
|
class Path;
|
|
|
|
/**
|
|
* Simple mover - auto-generates a 2-waypoint path from component properties.
|
|
* Corresponds to client LWOPlatformSimpleMover (type 5).
|
|
*/
|
|
class SimpleMoverSubComponent final : public PlatformSubComponent {
|
|
public:
|
|
SimpleMoverSubComponent(Entity* parentEntity, const NiPoint3& startPos,
|
|
const NiQuaternion& startRot, const NiPoint3& platformMove, float platformMoveTime);
|
|
|
|
const Path* GetGeneratedPath() const { return m_GeneratedPath.get(); }
|
|
|
|
private:
|
|
void GeneratePath(const NiPoint3& startPos, const NiQuaternion& startRot,
|
|
const NiPoint3& platformMove, float platformMoveTime);
|
|
|
|
std::unique_ptr<Path> m_GeneratedPath;
|
|
};
|
|
|
|
#endif // SIMPLEMOVERSUBCOMPONENT_H
|