vkmEngine
1.0.0
A C++ game engine ·
vkmengine.com
Loading...
Searching...
No Matches
codecs.h
1
#pragma once
2
3
#include <cstddef>
4
5
#include <glm/glm.hpp>
6
7
#include "ecs/component/core/transform.h"
8
#include "ecs/component/physics/character_controller.h"
9
#include "ecs/component/physics/ragdoll.h"
10
#include "ecs/component/physics/rigidbody.h"
11
#include "ecs/component/prefab/net_spawn.h"
12
#include "net/wire/bit_stream.h"
13
#include "net/wire/schema.h"
14
15
namespace
Vkm::Engine {
16
22
constexpr
size_t
NET_PREFAB_PATH_MAX = 200;
23
30
constexpr
size_t
NET_SPAWN_MAX_SLOTS = 32;
31
37
constexpr
size_t
NET_SPAWN_MAX_BYTES = 1 + NET_PREFAB_PATH_MAX + 10 *
sizeof
(float)
38
+ (6 + NET_SPAWN_MAX_SLOTS * (32 + 23) + 7) / 8;
39
45
constexpr
const
char
* NET_SPAWN_TYPE =
"NetSpawn"
;
46
58
glm::vec3 netScale(
const
glm::vec3& scale);
59
66
void
netEncode(
const
Transform
& value,
BitWriter
& out);
67
void
netDecode(
Transform
& value,
BitReader
& in);
68
76
void
netEncode(
const
Rigidbody
& value,
BitWriter
& out);
77
void
netDecode(
Rigidbody
& value,
BitReader
& in);
78
86
void
netEncode(
const
CharacterController
& value,
BitWriter
& out);
87
void
netDecode(
CharacterController
& value,
BitReader
& in);
88
96
void
netEncode(
const
Ragdoll
& value,
BitWriter
& out);
97
void
netDecode(
Ragdoll
& value,
BitReader
& in);
98
111
bool
isSayable(
const
NetSpawn
& spawn);
112
120
void
netEncode(
const
NetSpawn
& value,
BitWriter
& out);
121
void
netDecode(
NetSpawn
& value,
BitReader
& in);
122
131
void
registerEngineNetTypes(
NetSchema
& schema =
NetSchema::get
());
132
133
}
// namespace Vkm::Engine
Vkm::Engine::BitReader
Reads back what a BitWriter wrote, in the same order.
Definition
bit_stream.h:145
Vkm::Engine::BitWriter
Packs values to the bit into a byte buffer.
Definition
bit_stream.h:19
Vkm::Engine::NetSchema
The ordered list of what replicates, agreed by both ends before play.
Definition
schema.h:39
Vkm::Engine::NetSchema::get
static NetSchema & get()
The registry every end consults. Filled by ScriptModule::setupNetwork, read thereafter.
Vkm::Engine::CharacterController
Turns a desired direction into velocity on a Rigidbody, and reports what the body stands on.
Definition
character_controller.h:16
Vkm::Engine::NetSpawn
What a server built at this root after the scene loaded, so every client can build the same.
Definition
net_spawn.h:19
Vkm::Engine::Ragdoll
Turns a rig over to physics, and back.
Definition
ragdoll.h:49
Vkm::Engine::Rigidbody
Dynamics state for a physics body: motion, material response and mass.
Definition
rigidbody.h:31
Vkm::Engine::Transform
Local position, rotation and scale of an entity.
Definition
transform.h:17
net
wire
codecs.h
Generated by
1.14.0