mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-05-14 03:15:05 +00:00
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:
@@ -152,7 +152,17 @@ void ControllablePhysicsComponent::Serialize(RakNet::BitStream& outBitStream, bo
|
||||
outBitStream.Write(m_AngularVelocity.z);
|
||||
}
|
||||
|
||||
outBitStream.Write0(); // local_space_info, always zero for now.
|
||||
bool hasLocalSpaceInfo = m_PlatformEntityID != LWOOBJID_EMPTY;
|
||||
outBitStream.Write(hasLocalSpaceInfo);
|
||||
if (hasLocalSpaceInfo) {
|
||||
outBitStream.Write(m_PlatformEntityID);
|
||||
outBitStream.Write(m_LocalSpacePosition.x);
|
||||
outBitStream.Write(m_LocalSpacePosition.y);
|
||||
outBitStream.Write(m_LocalSpacePosition.z);
|
||||
outBitStream.Write(m_LocalSpaceLinearVelocity.x);
|
||||
outBitStream.Write(m_LocalSpaceLinearVelocity.y);
|
||||
outBitStream.Write(m_LocalSpaceLinearVelocity.z);
|
||||
}
|
||||
|
||||
if (!bIsInitialUpdate) {
|
||||
m_DirtyPosition = false;
|
||||
|
||||
Reference in New Issue
Block a user