mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
Various Cleanups (movement/)
This commit is contained in:
parent
6379a746d7
commit
0d2bedadae
13 changed files with 1122 additions and 1113 deletions
|
|
@ -20,7 +20,8 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
namespace Movement{
|
namespace Movement
|
||||||
|
{
|
||||||
|
|
||||||
extern float computeFallTime(float path_length, bool isSafeFall);
|
extern float computeFallTime(float path_length, bool isSafeFall);
|
||||||
extern float computeFallElevation(float time_passed, bool isSafeFall, float start_velocy);
|
extern float computeFallElevation(float time_passed, bool isSafeFall, float start_velocy);
|
||||||
|
|
@ -106,7 +107,8 @@ struct FallInitializer
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum{
|
enum
|
||||||
|
{
|
||||||
minimal_duration = 1,
|
minimal_duration = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -216,7 +218,8 @@ bool MoveSplineInitArgs::_checkPathBounds() const
|
||||||
{
|
{
|
||||||
if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2)
|
if (!(flags & MoveSplineFlag::Mask_CatmullRom) && path.size() > 2)
|
||||||
{
|
{
|
||||||
enum{
|
enum
|
||||||
|
{
|
||||||
MAX_OFFSET = (1 << 11) / 2,
|
MAX_OFFSET = (1 << 11) / 2,
|
||||||
};
|
};
|
||||||
Vector3 middle = (path.front()+path.back()) / 2;
|
Vector3 middle = (path.front()+path.back()) / 2;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@ namespace Movement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Spline<int32> MySpline;
|
typedef Spline<int32> MySpline;
|
||||||
enum UpdateResult{
|
enum UpdateResult
|
||||||
|
{
|
||||||
Result_None = 0x01,
|
Result_None = 0x01,
|
||||||
Result_Arrived = 0x02,
|
Result_Arrived = 0x02,
|
||||||
Result_NextCycle = 0x04,
|
Result_NextCycle = 0x04,
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ namespace Movement
|
||||||
class MoveSplineFlag
|
class MoveSplineFlag
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum eFlags{
|
enum eFlags
|
||||||
|
{
|
||||||
None = 0x00000000,
|
None = 0x00000000,
|
||||||
// x00-xFF(first byte) used as animation Ids storage in pair with Animation flag
|
// x00-xFF(first byte) used as animation Ids storage in pair with Animation flag
|
||||||
Done = 0x00000100,
|
Done = 0x00000100,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ namespace Movement
|
||||||
|
|
||||||
union FacingInfo
|
union FacingInfo
|
||||||
{
|
{
|
||||||
struct{
|
struct
|
||||||
|
{
|
||||||
float x,y,z;
|
float x,y,z;
|
||||||
} f;
|
} f;
|
||||||
uint64 target;
|
uint64 target;
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <G3D/Matrix4.h>
|
#include <G3D/Matrix4.h>
|
||||||
|
|
||||||
namespace Movement{
|
namespace Movement
|
||||||
|
{
|
||||||
|
|
||||||
SplineBase::EvaluationMethtod SplineBase::evaluators[SplineBase::ModesEnd] =
|
SplineBase::EvaluationMethtod SplineBase::evaluators[SplineBase::ModesEnd] =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
#include <G3D/Vector3.h>
|
#include <G3D/Vector3.h>
|
||||||
|
|
||||||
namespace Movement {
|
namespace Movement
|
||||||
|
{
|
||||||
|
|
||||||
class SplineBase
|
class SplineBase
|
||||||
{
|
{
|
||||||
|
|
@ -48,7 +49,8 @@ protected:
|
||||||
uint8 m_mode;
|
uint8 m_mode;
|
||||||
bool cyclic;
|
bool cyclic;
|
||||||
|
|
||||||
enum{
|
enum
|
||||||
|
{
|
||||||
// could be modified, affects segment length evaluation precision
|
// could be modified, affects segment length evaluation precision
|
||||||
// lesser value saves more performance in cost of lover precision
|
// lesser value saves more performance in cost of lover precision
|
||||||
// minimal value is 1
|
// minimal value is 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue