feat: Add a bunch of behaviors (All rotations, DoDamage, OnTimer, OnStartup, MoveBackToStart) and make models move based on normals, not world axes (#2038)

* add rotation behavior logic (not working correctly for multiple axes)

* Fix FetchContent_Declare speed

* remove manual quaternion math

* feat: working rotations

* remove flag

* feat: make directional movements based on model rotation and not world axes

* poggers rotation on the strip

* Add OnStartup and OnTimer

* go home works

* Add DoDamage behavior and dont try and start the same node multiple times

* fix: pause bbb models

* interrupt rotations and save interrupt count across resets
This commit is contained in:
David Markowitz
2026-10-05 10:33:45 -07:00
committed by GitHub
parent 66e2790193
commit fc6a7fbd52
20 changed files with 465 additions and 127 deletions

View File

@@ -14,10 +14,12 @@ target_include_directories(dGameMessages PUBLIC "."
"${PROJECT_SOURCE_DIR}/dGame/dComponents" # direct MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dUtilities" # direct SlashCommandHandler.h
"${PROJECT_SOURCE_DIR}/dGame/dPropertyBehaviors" # direct ControlBehaviors.h
"${PROJECT_SOURCE_DIR}/dGame/dPropertyBehaviors/ControlBehaviorMessages" # direct ControlBehaviors.h
"${PROJECT_SOURCE_DIR}/dGame/dMission" # via MissionComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dBehaviors" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dInventory" # via InventoryComponent.h
"${PROJECT_SOURCE_DIR}/dGame/dEntity" # via dZoneManager/Spawner.h
"${PROJECT_SOURCE_DIR}/dZoneManager" # via GameMessages.cpp, GameMessageHandler.cpp
"${PROJECT_SOURCE_DIR}/dGame/d"
)
target_precompile_headers(dGameMessages REUSE_FROM dGameBase)

View File

@@ -86,7 +86,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream& inStream, const System
return;
}
}
msg->target = objectID;
msg->Deserialize(inStream);
msg->Handle(*entity, sysAddr);
return;

View File

@@ -42,6 +42,7 @@
#include "eStateChangeType.h"
#include "ServiceType.h"
#include "ePlayerFlag.h"
#include "ModelComponent.h"
#include <sstream>
#include <future>
@@ -2627,6 +2628,8 @@ void GameMessages::HandleBBBSaveRequest(RakNet::BitStream& inStream, Entity* ent
Entity* newEntity = Game::entityManager->CreateEntity(info, nullptr);
if (newEntity) {
Game::entityManager->ConstructEntity(newEntity);
auto* const modelComponent = newEntity->GetComponent<ModelComponent>();
if (modelComponent) modelComponent->Pause();
//Make sure the propMgmt doesn't delete our model after the server dies
//Trying to do this after the entity is constructed. Shouldn't really change anything but

View File

@@ -880,6 +880,22 @@ namespace GameMessages {
bool bIgnoreChecks{ false };
};
struct GetAngularVelocity : public GameMsg {
GetAngularVelocity() : GameMsg(MessageType::Game::GET_ANGULAR_VELOCITY) {}
NiPoint3 angVelocity{};
};
struct SetAngularVelocity : public GameMsg {
SetAngularVelocity() : GameMsg(MessageType::Game::SET_ANGULAR_VELOCITY) {}
NiPoint3 angVelocity{};
bool bIgnoreDirtyFlags{};
bool bForceFlagDirty{};
};
struct DropClientLoot : public GameMsg {
DropClientLoot() : GameMsg(MessageType::Game::DROP_CLIENT_LOOT) {}