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
9//------------------------------------------------------------------------------
17struct Orientation : public Math::quat
18{
19 using Math::quat::quat; // default constructor
21 {
22 this->load(&q.x);
23 }
24
25 struct Traits;
26};
27
28//------------------------------------------------------------------------------
32{
33 Traits() = delete;
35 static constexpr auto name = "Orientation";
36 static constexpr auto fully_qualified_name = "Game.Orientation";
37 static constexpr size_t num_fields = 4;
38 static constexpr const char* field_names[num_fields] = {
39 "x",
40 "y",
41 "z",
42 "w"
43 };
44 static constexpr const char* field_typenames[num_fields] = {
45 "float",
46 "float",
47 "float",
48 "float"
49 };
50 static constexpr const char* field_descriptions[num_fields] = {
51 nullptr,
52 nullptr,
53 nullptr,
54 nullptr
55 };
56 using field_types = std::tuple<float, float, float, float>;
57 static constexpr size_t field_byte_offsets[num_fields] = {
58 offsetof(Orientation, x),
59 offsetof(Orientation, y),
60 offsetof(Orientation, z),
61 offsetof(Orientation, w),
62 };
63 static constexpr bool field_hide_in_inspector[num_fields] = {
64 false,
65 false,
66 false,
67 false
68 };
71 static constexpr uint32_t fixed_column_index = 2;
72};
73
74} // namespace Game
Game::EditorState.
Definition graphicsmanager.h:60
Definition orientation.h:32
static constexpr size_t field_byte_offsets[num_fields]
Definition orientation.h:57
static constexpr uint32_t fixed_column_index
This is the column that the entity orientation will reside in, in every table.
Definition orientation.h:71
static constexpr const char * field_typenames[num_fields]
Definition orientation.h:44
static constexpr auto fully_qualified_name
Definition orientation.h:36
static constexpr const char * field_descriptions[num_fields]
Definition orientation.h:50
static constexpr size_t num_fields
Definition orientation.h:37
std::tuple< float, float, float, float > field_types
Definition orientation.h:56
static constexpr bool field_hide_in_inspector[num_fields]
Definition orientation.h:63
static constexpr auto name
Definition orientation.h:35
static constexpr const char * field_names[num_fields]
Definition orientation.h:38
A component that stores the orientation of an entity.
Orientation(Math::quat const &q)
Definition orientation.h:20
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