feat: Movement behaviors (#1815)

* Move in all directions is functional

* feat: add movement behaviors

the following behaviors will function
MoveRight
MoveLeft
FlyUp
FlyDown
MoveForward
MoveBackward

The behavior of the behaviors is once a move in an axis is active, that behavior must finish its movement before another one on that axis can do another movement on it.
This commit is contained in:
David Markowitz
2025-06-11 12:52:15 -07:00
committed by GitHub
parent 6ae1c7a376
commit 2f315d9288
9 changed files with 210 additions and 22 deletions

View File

@@ -124,6 +124,8 @@ public:
// then return the collision group from that.
int32_t GetCollisionGroup() const;
const NiPoint3& GetVelocity() const;
/**
* Setters
*/
@@ -148,6 +150,8 @@ public:
void SetRespawnRot(const NiQuaternion& rotation);
void SetVelocity(const NiPoint3& velocity);
/**
* Component management
*/
@@ -329,7 +333,7 @@ public:
* @brief The observable for player entity position updates.
*/
static Observable<Entity*, const PositionUpdate&> OnPlayerPositionUpdate;
protected:
LWOOBJID m_ObjectID;
@@ -435,7 +439,7 @@ const T& Entity::GetVar(const std::u16string& name) const {
template<typename T>
T Entity::GetVarAs(const std::u16string& name) const {
const auto data = GetVarAsString(name);
return GeneralUtils::TryParse<T>(data).value_or(LDFData<T>::Default);
}