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
9//------------------------------------------------------------------------------
17struct Scale : public Math::vec3
18{
20 {
21 this->set(1.0f,1.0f,1.0f);
22 }
23
25 {
26 this->load(&v.x);
27 }
28
29 struct Traits;
30};
31
32//------------------------------------------------------------------------------
36{
37 Traits() = delete;
38 using type = Scale;
39 static constexpr auto name = "Scale";
40 static constexpr auto fully_qualified_name = "Game.Scale";
41 static constexpr size_t num_fields = 3;
42 static constexpr const char* field_names[num_fields] = {
43 "x",
44 "y",
45 "z"
46 };
47 static constexpr const char* field_typenames[num_fields] = {
48 "float",
49 "float",
50 "float"
51 };
52 static constexpr const char* field_descriptions[num_fields] = {
53 nullptr,
54 nullptr,
55 nullptr
56 };
57 using field_types = std::tuple<float, float, float>;
58 static constexpr size_t field_byte_offsets[num_fields] = {
59 offsetof(Scale, x),
60 offsetof(Scale, y),
61 offsetof(Scale, z)
62 };
63 static constexpr bool field_hide_in_inspector[num_fields] = {
64 false,
65 false,
66 false
67 };
70 static constexpr uint32_t fixed_column_index = 3;
71};
72
73} // namespace Game
Game::EditorState.
Definition graphicsmanager.h:60
IM3D_API void Scale(float _x, float _y, float _z)
Definition im3d.cpp:137
Definition scale.h:36
static constexpr auto fully_qualified_name
Definition scale.h:40
static constexpr const char * field_typenames[num_fields]
Definition scale.h:47
static constexpr size_t field_byte_offsets[num_fields]
Definition scale.h:58
static constexpr const char * field_names[num_fields]
Definition scale.h:42
static constexpr auto name
Definition scale.h:39
static constexpr size_t num_fields
Definition scale.h:41
static constexpr const char * field_descriptions[num_fields]
Definition scale.h:52
static constexpr uint32_t fixed_column_index
This is the column that the entity scale will reside in, in every table.
Definition scale.h:70
std::tuple< float, float, float > field_types
Definition scale.h:57
static constexpr bool field_hide_in_inspector[num_fields]
Definition scale.h:63
A component that stores the scale of an entity.
Scale(Math::vec3 const &v)
Definition scale.h:24
Scale()
Definition scale.h:19
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