Nebula
Loading...
Searching...
No Matches
scale.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
9struct Scale : public Math::vec3
10{
12 {
13 this->set(1.0f,1.0f,1.0f);
14 }
15
17 {
18 this->load(&v.x);
19 }
20
21 struct Traits;
22};
23
24//------------------------------------------------------------------------------
28{
29 Traits() = delete;
30 using type = Scale;
31 static constexpr auto name = "Scale";
32 static constexpr auto fully_qualified_name = "Game.Scale";
33 static constexpr size_t num_fields = 3;
34 static constexpr const char* field_names[num_fields] = {
35 "x",
36 "y",
37 "z"
38 };
39 static constexpr const char* field_typenames[num_fields] = {
40 "float",
41 "float",
42 "float"
43 };
44 using field_types = std::tuple<float, float, float>;
45 static constexpr size_t field_byte_offsets[num_fields] = {
46 offsetof(Scale, x),
47 offsetof(Scale, y),
48 offsetof(Scale, z)
49 };
52 static constexpr uint32_t fixed_column_index = 3;
53};
54
55} // namespace Game
Game::EditorState.
Definition orientation.h:7
Definition scale.h:28
static constexpr auto fully_qualified_name
Definition scale.h:32
static constexpr const char * field_typenames[num_fields]
Definition scale.h:39
static constexpr size_t field_byte_offsets[num_fields]
Definition scale.h:45
static constexpr const char * field_names[num_fields]
Definition scale.h:34
static constexpr auto name
Definition scale.h:31
static constexpr size_t num_fields
Definition scale.h:33
static constexpr uint32_t fixed_column_index
This is the column that the entity scale will reside in, in every table.
Definition scale.h:52
std::tuple< float, float, float > field_types
Definition scale.h:44
Definition scale.h:10
Scale(Math::vec3 const &v)
Definition scale.h:16
Scale()
Definition scale.h:11
A 3D vector.
Definition vec3.h:40
float v[3]
Definition vec3.h:97
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
void set(scalar x, scalar y, scalar z)
set content
Definition vec3.h:310
float y
Definition vec3.h:94