* 1
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef PROGRAM_ENTITY_HPP
|
||||
#define PROGRAM_ENTITY_HPP
|
||||
|
||||
#include <zm/vec3.hpp>
|
||||
|
||||
class entity {
|
||||
private:
|
||||
zm::vec3 position_;
|
||||
|
||||
public:
|
||||
entity() {
|
||||
this->position_ = { 1, 1, 1 };
|
||||
}
|
||||
|
||||
zm::vec3 get_position() const {
|
||||
return this->position_;
|
||||
}
|
||||
void set_position(zm::vec3 v) {
|
||||
this->position_ = v;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // PROGRAM_ENTITY_HPP
|
||||
@@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef PROGRAM_LUA_INTEROP_HPP
|
||||
#define PROGRAM_LUA_INTEROP_HPP
|
||||
|
||||
#include <lua_zm_interop.hpp>
|
||||
|
||||
#define SOL_ALL_SAFETIES_ON 1
|
||||
#include <sol/forward.hpp>
|
||||
|
||||
void register_lua(sol::state& lua);
|
||||
|
||||
#endif // PROGRAM_LUA_INTEROP_HPP
|
||||
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef PROGRAM_LUA_ZM_INTEROP_HPP
|
||||
#define PROGRAM_LUA_ZM_INTEROP_HPP
|
||||
|
||||
#define SOL_ALL_SAFETIES_ON 1
|
||||
#include <sol/forward.hpp>
|
||||
|
||||
#include <zm/vec3.hpp>
|
||||
|
||||
#include <functional>
|
||||
|
||||
bool sol_lua_check(sol::types<zm::vec3>, lua_State* L, int index,
|
||||
std::function<sol::check_handler_type> handler,
|
||||
sol::stack::record& tracking);
|
||||
|
||||
zm::vec3 sol_lua_get(sol::types<zm::vec3>, lua_State* L,
|
||||
int index, sol::stack::record& tracking);
|
||||
|
||||
int sol_lua_push(
|
||||
sol::types<zm::vec3>, lua_State* L, const zm::vec3& v);
|
||||
|
||||
#endif // PROGRAM_LUA_ZM_INTEROP_HPP
|
||||
@@ -1,74 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef ZM_VEC3_HPP
|
||||
#define ZM_VEC3_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace zm {
|
||||
|
||||
struct vec3 {
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||
#pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4201) // nonstandard extension used :
|
||||
// nameless struct/union
|
||||
#pragma warning(disable : 4324) // structure was padded due to
|
||||
// alignment specifier
|
||||
#endif
|
||||
union {
|
||||
float elements[3];
|
||||
struct {
|
||||
union {
|
||||
float x, r, s;
|
||||
};
|
||||
union {
|
||||
float y, g, t;
|
||||
};
|
||||
union {
|
||||
float z, b, p;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
vec3() : x(0), y(0), z(0) {
|
||||
}
|
||||
|
||||
vec3(float x_, float y_, float z_)
|
||||
: x(x_), y(y_), z(z_) {
|
||||
}
|
||||
|
||||
constexpr float* data() {
|
||||
return elements;
|
||||
}
|
||||
|
||||
constexpr const float* data() const {
|
||||
return this->elements;
|
||||
}
|
||||
|
||||
constexpr float& operator[](std::size_t i) {
|
||||
return this->elements[i];
|
||||
}
|
||||
|
||||
constexpr const float& operator[](
|
||||
std::size_t i) const {
|
||||
return this->elements[i];
|
||||
}
|
||||
};
|
||||
} // namespace zm
|
||||
|
||||
#endif // ZM_VEC3_HPP
|
||||
Reference in New Issue
Block a user