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

@@ -29,6 +29,10 @@ public:
void IncrementAction();
void Spawn(LOT object, Entity& entity);
// Checks the movement logic for whether or not to proceed
// Returns true if the movement can continue, false if it needs to wait more.
bool CheckMovement(float deltaTime, ModelComponent& modelComponent);
void Update(float deltaTime, ModelComponent& modelComponent);
void SpawnDrop(LOT dropLOT, Entity& entity);
void ProcNormalAction(float deltaTime, ModelComponent& modelComponent);
@@ -40,7 +44,8 @@ private:
// Indicates this Strip is waiting for an action to be taken upon it to progress to its actions
bool m_WaitingForAction{ false };
// The amount of time this strip is paused for. Any interactions with this strip should be bounced if this is greater than 0.
// The amount of time this strip is paused for. Any interactions with this strip should be bounced if this is greater than 0.
// Actions that do not use time do not use this (ex. positions).
float m_PausedTime{ 0.0f };
// The index of the next action to be played. This should always be within range of [0, m_Actions.size()).
@@ -51,6 +56,13 @@ private:
// The location of this strip on the UGBehaviorEditor UI
StripUiPosition m_Position;
// The current actions remaining distance to the target
// Only 1 of these vertexs' will be active at once for any given strip.
NiPoint3 m_InActionMove{};
// The position of the parent model on the previous frame
NiPoint3 m_PreviousFramePosition{};
};
#endif //!__STRIP__H__