2018-09-14 22:09:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
#include "Renderable.h"
|
|
|
|
#include "PoseableBatch.h"
|
|
|
|
#include "VertexFragmentShaderProgram.h"
|
|
|
|
|
|
|
|
namespace charcoal
|
|
|
|
{
|
|
|
|
namespace builtin
|
|
|
|
{
|
|
|
|
using namespace glm;
|
|
|
|
|
|
|
|
typedef vec3 Position;
|
|
|
|
typedef vec3 Normal;
|
|
|
|
typedef vec4 ColorRGBA;
|
|
|
|
typedef vec3 ColorRGB;
|
|
|
|
typedef vec2 UV;
|
|
|
|
|
|
|
|
typedef unsigned int Index;
|
|
|
|
|
|
|
|
// Generic Vertices
|
|
|
|
|
|
|
|
struct PVertex
|
|
|
|
{
|
|
|
|
void set_position(const Position& position) { this->position = position; }
|
|
|
|
|
|
|
|
Position position;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PNVertex
|
|
|
|
{
|
|
|
|
void set_position(const Position& position) { this->position = position; }
|
|
|
|
void set_normal(const Normal& normal) { this->normal = normal; }
|
|
|
|
|
|
|
|
Position position;
|
|
|
|
Normal normal;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Other Data Types
|
|
|
|
|
|
|
|
struct Light
|
|
|
|
{
|
2018-09-15 01:29:05 +00:00
|
|
|
Light(const Position& position, const ColorRGB& ambient, const ColorRGB& diffuse)
|
|
|
|
: position(position), ambient(ambient), diffuse(diffuse) {}
|
2018-09-14 22:09:43 +00:00
|
|
|
|
2018-09-15 01:29:05 +00:00
|
|
|
Position position;
|
2018-09-14 22:09:43 +00:00
|
|
|
ColorRGB ambient;
|
2018-09-15 01:29:05 +00:00
|
|
|
ColorRGB diffuse;
|
2018-09-14 22:09:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// typedefs for builtin types
|
|
|
|
|
|
|
|
typedef PVertex BasicVertex;
|
|
|
|
typedef Index BasicIndex;
|
|
|
|
typedef Renderable<BasicVertex, BasicIndex> BasicRenderable;
|
|
|
|
|
|
|
|
typedef PNVertex LitVertex;
|
|
|
|
typedef Index LitIndex;
|
|
|
|
typedef Renderable<LitVertex, LitIndex> LitRenderable;
|
|
|
|
}
|
|
|
|
}
|