2#ifdef StevEngine_RENDERER_GL
3#include "renderer/RenderComponent.hpp"
4#include "utilities/Vertex.hpp"
5#include "visuals/renderer/Object.hpp"
6#include "visuals/Material.hpp"
8#define CUBE_PRIMITIVE_TYPE "CubePrimitive"
9#define UVSPHERE_PRIMITIVE_TYPE "UVSpherePrimitive"
10#define ICOSPHERE_PRIMITIVE_TYPE "IcoSpherePrimitive"
11#define CYLINDER_PRIMITIVE_TYPE "CylinderPrimitive"
12#define CAPSULE_PRIMITIVE_TYPE "CapsulePrimitive"
16const double phi = (1 + sqrt(5)) / 2;
31 const std::vector<Utilities::Vertex> CubeVertices(TextureType textureType);
56 Renderer::RenderType renderType = Renderer::SOLID
69 std::string
GetType()
const {
return CUBE_PRIMITIVE_TYPE; }
84 const std::vector<Utilities::Vertex> UVSphereVertices(TextureType textureType,
bool smooth,
int detail = 30,
float height = RADIUS);
111 Renderer::RenderType renderType = Renderer::SOLID
124 std::string
GetType()
const {
return UVSPHERE_PRIMITIVE_TYPE; }
140 const std::vector<Utilities::Vertex> IcosphereVertices(TextureType textureType,
bool smooth,
int detail = 3);
167 Renderer::RenderType renderType = Renderer::SOLID
180 std::string
GetType()
const {
return ICOSPHERE_PRIMITIVE_TYPE; }
196 const std::vector<Utilities::Vertex> CylinderVertices(TextureType textureType,
bool smooth,
int detail = 30,
double height = RADIUS);
223 Renderer::RenderType renderType = Renderer::SOLID
236 std::string
GetType()
const {
return CYLINDER_PRIMITIVE_TYPE; }
252 const std::vector<Utilities::Vertex> CapsuleVertices(TextureType textureType,
bool smooth,
int detail = 30);
279 Renderer::RenderType renderType = Renderer::SOLID
292 std::string
GetType()
const {
return CAPSULE_PRIMITIVE_TYPE; }
static bool RegisterComponentType(std::string type)
Register a component type for creation.
Definition Component.hpp:133
Base component for renderable objects.
Definition RenderComponent.hpp:19
Utilities::Quaternion rotation
Local position offset.
Definition RenderComponent.hpp:51
Utilities::Vector3 scale
Local rotation offset.
Definition RenderComponent.hpp:52
Quaternion for 3D rotations.
Definition Quaternion.hpp:17
Stream for serialization of data.
Definition Stream.hpp:22
3D vector class
Definition Vector3.hpp:17
std::string GetType() const
Get component type.
Definition Primitive.hpp:292
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:653
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:302
CapsulePrimitive(Utilities::Vector3 position=Utilities::Vector3(), Utilities::Quaternion rotation=Utilities::Quaternion(), Utilities::Vector3 scale=Utilities::Vector3(1), Material material=Material(), bool smooth=true, TextureType textureType=COVER, Renderer::RenderType renderType=Renderer::SOLID)
Create capsule primitive.
Definition Primitive.cpp:646
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:301
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:118
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:78
std::string GetType() const
Get component type.
Definition Primitive.hpp:69
CubePrimitive(Utilities::Vector3 position=Utilities::Vector3(), Utilities::Quaternion rotation=Utilities::Quaternion(), Utilities::Vector3 scale=Utilities::Vector3(1), const Material &material=Material(), TextureType textureType=REPEAT, Renderer::RenderType renderType=Renderer::SOLID)
Create cube primitive.
Definition Primitive.cpp:109
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:584
std::string GetType() const
Get component type.
Definition Primitive.hpp:236
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:246
CylinderPrimitive(Utilities::Vector3 position=Utilities::Vector3(), Utilities::Quaternion rotation=Utilities::Quaternion(), Utilities::Vector3 scale=Utilities::Vector3(1), Material material=Material(), bool smooth=true, TextureType textureType=COVER, Renderer::RenderType renderType=Renderer::SOLID)
Create cylinder primitive.
Definition Primitive.cpp:576
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:245
IcospherePrimitive(Utilities::Vector3 position=Utilities::Vector3(), Utilities::Quaternion rotation=Utilities::Quaternion(), Utilities::Vector3 scale=Utilities::Vector3(1), Material material=Material(), bool smooth=true, TextureType textureType=COVER, Renderer::RenderType renderType=Renderer::SOLID)
Create icosphere primitive.
Definition Primitive.cpp:444
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:453
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:189
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:190
std::string GetType() const
Get component type.
Definition Primitive.hpp:180
Material properties for rendering.
Definition Material.hpp:14
UVSpherePrimitive(Utilities::Vector3 position=Utilities::Vector3(), Utilities::Quaternion rotation=Utilities::Quaternion(), Utilities::Vector3 scale=Utilities::Vector3(1), Material material=Material(), bool smooth=true, TextureType textureType=COVER, Renderer::RenderType renderType=Renderer::SOLID)
Create UV sphere primitive.
Definition Primitive.cpp:252
std::string GetType() const
Get component type.
Definition Primitive.hpp:124
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:261
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:134
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:133