Nebula
Toggle main menu visibility
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
//------------------------------------------------------------------------------
6
namespace
Game
7
{
8
9
//------------------------------------------------------------------------------
17
struct
Orientation
:
public
Math::quat
18
{
19
using
Math::quat::quat
;
// default constructor
20
Orientation
(
Math::quat
const
& q)
21
{
22
this->
load
(&q.
x
);
23
}
24
25
struct
Traits;
26
};
27
28
//------------------------------------------------------------------------------
31
struct
Orientation::Traits
32
{
33
Traits
() =
delete
;
34
using
type
=
Orientation
;
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
};
69
71
static
constexpr
uint32_t
fixed_column_index
= 2;
72
};
73
74
}
// namespace Game
entity.h
Game
Game::EditorState.
Definition
graphicsmanager.h:67
quat.h
Game::Orientation::Traits
Definition
orientation.h:32
Game::Orientation::Traits::Traits
Traits()=delete
Game::Orientation::Traits::field_byte_offsets
static constexpr size_t field_byte_offsets[num_fields]
Definition
orientation.h:57
Game::Orientation::Traits::fixed_column_index
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
Game::Orientation::Traits::field_typenames
static constexpr const char * field_typenames[num_fields]
Definition
orientation.h:44
Game::Orientation::Traits::fully_qualified_name
static constexpr auto fully_qualified_name
Definition
orientation.h:36
Game::Orientation::Traits::field_descriptions
static constexpr const char * field_descriptions[num_fields]
Definition
orientation.h:50
Game::Orientation::Traits::num_fields
static constexpr size_t num_fields
Definition
orientation.h:37
Game::Orientation::Traits::field_types
std::tuple< float, float, float, float > field_types
Definition
orientation.h:56
Game::Orientation::Traits::field_hide_in_inspector
static constexpr bool field_hide_in_inspector[num_fields]
Definition
orientation.h:63
Game::Orientation::Traits::name
static constexpr auto name
Definition
orientation.h:35
Game::Orientation::Traits::field_names
static constexpr const char * field_names[num_fields]
Definition
orientation.h:38
Game::Orientation::Traits::type
Orientation type
Definition
orientation.h:34
Game::Orientation::Orientation
Orientation(Math::quat const &q)
Definition
orientation.h:20
Math::quat
A quaternion is usually used to represent an orientation in 3D space.
Definition
quat.h:30
Math::quat::y
float y
Definition
quat.h:78
Math::quat::quat
quat()
default constructor
Definition
quat.h:89
Math::quat::load
void load(const scalar *ptr)
load content from 16-byte-aligned memory
Definition
quat.h:154
Math::quat::z
float z
Definition
quat.h:78
Math::quat::w
float w
Definition
quat.h:78
Math::quat::x
float x
Definition
quat.h:78
types.h
code
application
basegamefeature
components
orientation.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.