Nebula
Loading...
Searching...
No Matches
orientation.h
Go to the documentation of this file.
1#pragma once
2#include "core/types.h"
3#include "game/entity.h"
4#include "math/quat.h"
5//------------------------------------------------------------------------------
6namespace Game
7{
8
9struct Orientation : public Math::quat
10{
11 using Math::quat::quat; // default constructor
13 {
14 this->load(&q.x);
15 }
16
17 struct Traits;
18};
19
20//------------------------------------------------------------------------------
24{
25 Traits() = delete;
27 static constexpr auto name = "Orientation";
28 static constexpr auto fully_qualified_name = "Game.Orientation";
29 static constexpr size_t num_fields = 4;
30 static constexpr const char* field_names[num_fields] = {
31 "x",
32 "y",
33 "z",
34 "w"
35 };
36 static constexpr const char* field_typenames[num_fields] = {
37 "float",
38 "float",
39 "float",
40 "float"
41 };
42 using field_types = std::tuple<float, float, float, float>;
43 static constexpr size_t field_byte_offsets[num_fields] = {
44 offsetof(Orientation, x),
45 offsetof(Orientation, y),
46 offsetof(Orientation, z),
47 offsetof(Orientation, w),
48 };
51 static constexpr uint32_t fixed_column_index = 2;
52};
53
54} // namespace Game
Game::EditorState.
Definition orientation.h:7
Definition orientation.h:24
static constexpr size_t field_byte_offsets[num_fields]
Definition orientation.h:43
static constexpr uint32_t fixed_column_index
This is the column that the entity orientation will reside in, in every table.
Definition orientation.h:51
static constexpr const char * field_typenames[num_fields]
Definition orientation.h:36
static constexpr auto fully_qualified_name
Definition orientation.h:28
static constexpr size_t num_fields
Definition orientation.h:29
std::tuple< float, float, float, float > field_types
Definition orientation.h:42
static constexpr auto name
Definition orientation.h:27
static constexpr const char * field_names[num_fields]
Definition orientation.h:30
Definition orientation.h:10
Orientation(Math::quat const &q)
Definition orientation.h:12
A quaternion is usually used to represent an orientation in 3D space.
Definition quat.h:30
float y
Definition quat.h:78
quat()
default constructor
Definition quat.h:88
void load(const scalar *ptr)
load content from 16-byte-aligned memory
Definition quat.h:153
float z
Definition quat.h:78
float w
Definition quat.h:78
float x
Definition quat.h:78