Nebula
Loading...
Searching...
No Matches
position.h
Go to the documentation of this file.
1#pragma once
2#include "core/types.h"
3#include "game/entity.h"
4#include "math/vec3.h"
5//------------------------------------------------------------------------------
6namespace Game
7{
8
9//------------------------------------------------------------------------------
18struct Position : public Math::vec3
19{
20 using Math::vec3::vec3; // default constructor
22 {
23 this->load(&v.x);
24 }
25
26 struct Traits;
27};
28
29//------------------------------------------------------------------------------
33{
34 Traits() = delete;
35 using type = Position;
36 static constexpr auto name = "Position";
37 static constexpr auto fully_qualified_name = "Game.Position";
38 static constexpr size_t num_fields = 3;
39 static constexpr const char* field_names[num_fields] = {
40 "x",
41 "y",
42 "z"
43 };
44 static constexpr const char* field_typenames[num_fields] = {
45 "float",
46 "float",
47 "float"
48 };
49 static constexpr const char* field_descriptions[num_fields] = {
50 nullptr,
51 nullptr,
52 nullptr
53 };
54 using field_types = std::tuple<float, float, float>;
55 static constexpr size_t field_byte_offsets[num_fields] = {
56 offsetof(Position, x),
57 offsetof(Position, y),
58 offsetof(Position, z)
59 };
60 static constexpr bool field_hide_in_inspector[num_fields] = {
61 false,
62 false,
63 false
64 };
67 static constexpr uint32_t fixed_column_index = 1;
68};
69
70} // namespace Game
Game::EditorState.
Definition graphicsmanager.h:60
Definition position.h:33
static constexpr bool field_hide_in_inspector[num_fields]
Definition position.h:60
std::tuple< float, float, float > field_types
Definition position.h:54
static constexpr const char * field_typenames[num_fields]
Definition position.h:44
static constexpr auto name
Definition position.h:36
static constexpr auto fully_qualified_name
Definition position.h:37
static constexpr const char * field_descriptions[num_fields]
Definition position.h:49
static constexpr uint32_t fixed_column_index
This is the column that the entity position will reside in, in every table.
Definition position.h:67
static constexpr size_t num_fields
Definition position.h:38
static constexpr size_t field_byte_offsets[num_fields]
Definition position.h:55
static constexpr const char * field_names[num_fields]
Definition position.h:39
A component that stores the position of an entity in world space coordinates.
Position(Math::vec3 const &v)
Definition position.h:21
A 3D vector.
Definition vec3.h:40
float v[3]
Definition vec3.h:97
vec3()=default
default constructor, NOTE: does NOT setup components!
void load(const scalar *ptr)
load content from 16-byte-aligned memory
Definition vec3.h:162
float x
Definition vec3.h:94
float z
Definition vec3.h:94
float y
Definition vec3.h:94