2#include "visuals/renderer/Object.hpp"
3#ifdef StevEngine_RENDERER_GL
4#include "renderer/RenderComponent.hpp"
5#include "utilities/Vertex.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"
29 const std::vector<Utilities::Vertex> CubeVertices(TextureType textureType);
54 Renderer::RenderType renderType = Renderer::SOLID
67 std::string
GetType()
const {
return CUBE_PRIMITIVE_TYPE; }
82 const std::vector<Utilities::Vertex> UVSphereVertices(TextureType textureType,
bool smooth,
int detail = 30,
float height = RADIUS);
109 Renderer::RenderType renderType = Renderer::SOLID
122 std::string
GetType()
const {
return UVSPHERE_PRIMITIVE_TYPE; }
138 const std::vector<Utilities::Vertex> IcosphereVertices(TextureType textureType,
bool smooth,
int detail = 3);
165 Renderer::RenderType renderType = Renderer::SOLID
178 std::string
GetType()
const {
return ICOSPHERE_PRIMITIVE_TYPE; }
194 const std::vector<Utilities::Vertex> CylinderVertices(TextureType textureType,
bool smooth,
int detail = 30,
double height = RADIUS);
221 Renderer::RenderType renderType = Renderer::SOLID
234 std::string
GetType()
const {
return CYLINDER_PRIMITIVE_TYPE; }
250 const std::vector<Utilities::Vertex> CapsuleVertices(TextureType textureType,
bool smooth,
int detail = 30);
277 Renderer::RenderType renderType = Renderer::SOLID
290 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:19
Stream for serialization of data.
Definition Stream.hpp:20
3D vector class
Definition Vector3.hpp:19
std::string GetType() const
Get component type.
Definition Primitive.hpp:290
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:654
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:300
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:647
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:299
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:76
std::string GetType() const
Get component type.
Definition Primitive.hpp:67
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:585
std::string GetType() const
Get component type.
Definition Primitive.hpp:234
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:244
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:577
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:243
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:445
Utilities::Stream Export(Utilities::StreamType type) const
Serialize component to a stream.
Definition Primitive.cpp:454
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:187
const bool smooth
Whether to use smooth shading.
Definition Primitive.hpp:188
std::string GetType() const
Get component type.
Definition Primitive.hpp:178
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:122
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:132
const Visuals::TextureType textureType
Texture mapping mode.
Definition Primitive.hpp:131