Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
MovementTypedefs.h
Go to the documentation of this file.
1
/*
2
* This file is part of Project SkyFire https://www.projectskyfire.org.
3
* See LICENSE.md file for Copyright information
4
*/
5
6
#ifndef SKYFIRESERVER_TYPEDEFS_H
7
#define SKYFIRESERVER_TYPEDEFS_H
8
9
#include "
Common.h
"
10
11
namespace
G3D
12
{
13
class
Vector2;
14
class
Vector3;
15
class
Vector4;
16
}
17
18
namespace
Movement
19
{
20
using
G3D::Vector2;
21
using
G3D::Vector3;
22
using
G3D::Vector4;
23
24
inline
uint32
SecToMS
(
float
sec)
25
{
26
return
static_cast<
uint32
>
(sec * 1000.f);
27
}
28
29
inline
float
MSToSec
(
uint32
ms)
30
{
31
return
ms / 1000.f;
32
}
33
34
float
computeFallTime
(
float
path_length,
bool
isSafeFall);
35
float
computeFallElevation
(
float
t_passed,
bool
isSafeFall,
float
start_velocity = 0.0f);
36
/*
37
#ifndef static_assert
38
#define CONCAT(x, y) CONCAT1 (x, y)
39
#define CONCAT1(x, y) x##y
40
#define static_assert(expr, msg) typedef char CONCAT(static_assert_failed_at_line_, __LINE__) [(expr) ? 1 : -1]
41
#endif
42
*/
43
template
<
class
T, T limit>
44
class
counter
45
{
46
public
:
47
counter
() {
init
(); }
48
49
void
Increase
()
50
{
51
if
(
m_counter
== limit)
52
init
();
53
else
54
++
m_counter
;
55
}
56
57
T
NewId
() {
Increase
();
return
m_counter
; }
58
T
getCurrent
()
const
{
return
m_counter
; }
59
60
private
:
61
void
init
() {
m_counter
= 0; }
62
T
m_counter
;
63
};
64
65
typedef
counter<uint32, 0xFFFFFFFF>
UInt32Counter
;
66
67
extern
double
gravity
;
68
extern
UInt32Counter
splineIdGen
;
69
extern
std::string
MovementFlags_ToString
(
uint32
flags);
70
extern
std::string
MovementFlagsExtra_ToString
(
uint32
flags);
71
}
72
73
#endif
// SKYFIRESERVER_TYPEDEFS_H
Common.h
uint32
std::uint32_t uint32
Definition
Define.h:77
Movement::counter
Definition
MovementTypedefs.h:40
Movement::counter::init
void init()
Definition
MovementTypedefs.h:56
Movement::counter::NewId
T NewId()
Definition
MovementTypedefs.h:52
Movement::counter< uint32, 0xFFFFFFFF >::counter
counter()
Definition
MovementTypedefs.h:42
Movement::counter< uint32, 0xFFFFFFFF >::m_counter
uint32 m_counter
Definition
MovementTypedefs.h:57
Movement::counter::Increase
void Increase()
Definition
MovementTypedefs.h:44
Movement::counter::getCurrent
T getCurrent() const
Definition
MovementTypedefs.h:53
G3D
Definition
DynamicTree.h:13
Movement
Definition
Unit.h:365
Movement::gravity
double gravity
Definition
MovementUtil.cpp:12
Movement::computeFallTime
float computeFallTime(float path_length, bool isSafeFall)
Definition
MovementUtil.cpp:24
Movement::SecToMS
uint32 SecToMS(float sec)
Definition
MovementTypedefs.h:24
Movement::splineIdGen
UInt32Counter splineIdGen
Definition
MovementUtil.cpp:13
Movement::MovementFlags_ToString
std::string MovementFlags_ToString(uint32 flags)
Definition
MovementUtil.cpp:187
Movement::computeFallElevation
float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity=0.0f)
Definition
MovementUtil.cpp:48
Movement::MovementFlagsExtra_ToString
std::string MovementFlagsExtra_ToString(uint32 flags)
Definition
MovementUtil.cpp:194
Movement::UInt32Counter
counter< uint32, 0xFFFFFFFF > UInt32Counter
Definition
MovementTypedefs.h:60
Movement::MSToSec
float MSToSec(uint32 ms)
Definition
MovementTypedefs.h:29
src
server
game
Movement
Spline
MovementTypedefs.h
Generated on
for Project SkyFire Core by
1.17.0