adding in the axes for all the camera poses. failing to read the file properly though
This commit is contained in:
10
inc/body.hpp
10
inc/body.hpp
@@ -4,17 +4,17 @@
|
||||
#include <glm/glm.hpp>
|
||||
#include "util.hpp"
|
||||
|
||||
struct body {
|
||||
struct Body {
|
||||
glm::mat4 pose;
|
||||
float scale;
|
||||
uint ebo;
|
||||
uint vao;
|
||||
uint vbo;
|
||||
uint shader;
|
||||
array<float> verts;
|
||||
array<int> faces;
|
||||
Array<float> verts;
|
||||
Array<int> faces;
|
||||
glm::vec4 color;
|
||||
};
|
||||
|
||||
bool load_body(body* out_body, const char* obj_filepath);
|
||||
void draw_body(const body& b);
|
||||
bool load_body(Body* out_body, const char* obj_filepath);
|
||||
void draw_body(const Body& b);
|
||||
|
||||
6
inc/camera_poses.hpp
Normal file
6
inc/camera_poses.hpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "util.hpp"
|
||||
#include "body.hpp"
|
||||
|
||||
bool parse_poses(Array<Body> *bodies_out, const char* filepath);
|
||||
21
inc/util.hpp
21
inc/util.hpp
@@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdlib>
|
||||
#include <glm/ext/matrix_float4x4.hpp>
|
||||
#include <glm/ext/quaternion_float.hpp>
|
||||
#include <glm/ext/vector_float4.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
#define min(a, b) ((a < b) ? a : b)
|
||||
@@ -8,17 +11,19 @@
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
template<class T> struct array {
|
||||
template<class T> struct Array {
|
||||
T* data;
|
||||
size_t len;
|
||||
size_t cap;
|
||||
inline T& operator[](int i) { return data[i]; }
|
||||
};
|
||||
|
||||
template<class T> void append(array<T>& a, T el);
|
||||
template<class T> T pop(array<T>& a);
|
||||
template<class T> void resize(array<T>& a, size_t new_cap);
|
||||
template<class T> void clear(array<T>& a);
|
||||
bool read_file(array<char>* out, const char* filepath);
|
||||
array<char*> split_str(const char *s, char delimiter);
|
||||
array<char*> split_str(const char *s);
|
||||
template<class T> void append(Array<T>& a, T el);
|
||||
template<class T> T pop(Array<T>& a);
|
||||
template<class T> void resize(Array<T>& a, size_t new_cap);
|
||||
template<class T> void clear(Array<T>& a);
|
||||
bool read_file(Array<char>* out, const char* filepath);
|
||||
Array<char*> split_str(const char* s, char delimiter);
|
||||
Array<char*> split_str(const char* s);
|
||||
|
||||
glm::mat4 quat_to_mat4(glm::quat q);
|
||||
|
||||
Reference in New Issue
Block a user