Radium Engine  1.5.20
Loading...
Searching...
No Matches
DrawPrimitives.hpp
1#pragma once
2
3#include <Engine/RaEngine.hpp>
4
5#include <Core/Geometry/Obb.hpp>
6#include <Core/Geometry/Spline.hpp>
7#include <Core/Types.hpp>
8#include <Core/Utils/Color.hpp>
9
10#include <memory>
11
12namespace Ra {
13namespace Engine {
14namespace Rendering {
15class RenderObject;
16
17}
18
19namespace Scene {
20class Component;
21}
22
23namespace Data {
24class Mesh;
25class AttribArrayDisplayable;
26class LineMesh;
27
31namespace DrawPrimitives {
32using MeshPtr = std::shared_ptr<Mesh>;
33using LineMeshPtr = std::shared_ptr<LineMesh>;
34using AttribArrayDisplayablePtr = std::shared_ptr<AttribArrayDisplayable>;
35
38RA_ENGINE_API Rendering::RenderObject* Primitive( Scene::Component* comp, const MeshPtr& mesh );
39RA_ENGINE_API Rendering::RenderObject* Primitive( Scene::Component* comp, const LineMeshPtr& mesh );
41 const AttribArrayDisplayablePtr& mesh );
43
45RA_ENGINE_API LineMeshPtr Point( const Core::Vector3& point,
46 const Core::Utils::Color& color,
47 Scalar scale = 0.1f );
48
50RA_ENGINE_API LineMeshPtr Line( const Core::Vector3& a,
51 const Core::Vector3& b,
52 const Core::Utils::Color& color );
53
55RA_ENGINE_API LineMeshPtr Vector( const Core::Vector3& start,
56 const Core::Vector3& v,
57 const Core::Utils::Color& color );
58
60RA_ENGINE_API LineMeshPtr Ray( const Core::Ray& ray,
61 const Core::Utils::Color& color,
62 Scalar len = 1000_ra );
63
66RA_ENGINE_API AttribArrayDisplayablePtr Triangle( const Core::Vector3& a,
67 const Core::Vector3& b,
68 const Core::Vector3& c,
69 const Core::Utils::Color& color,
70 bool fill = false );
71
73RA_ENGINE_API MeshPtr QuadStrip( const Core::Vector3& a,
74 const Core::Vector3& x,
75 const Core::Vector3& y,
76 uint quads,
77 const Core::Utils::Color& color );
78
82RA_ENGINE_API LineMeshPtr Circle( const Core::Vector3& center,
83 const Core::Vector3& normal,
84 Scalar radius,
85 uint segments,
86 const Core::Utils::Color& color );
87
91RA_ENGINE_API LineMeshPtr CircleArc( const Core::Vector3& center,
92 const Core::Vector3& normal,
93 Scalar radius,
94 Scalar angle,
95 uint segments,
96 const Core::Utils::Color& color );
97
99RA_ENGINE_API MeshPtr Sphere( const Core::Vector3& center,
100 Scalar radius,
101 const Core::Utils::Color& color );
102
105RA_ENGINE_API MeshPtr ParametricSphere( const Core::Vector3& center,
106 Scalar radius,
107 const Core::Utils::Color& color,
108 bool generateTexCoord = false );
109
111RA_ENGINE_API MeshPtr Capsule( const Core::Vector3& p1,
112 const Core::Vector3& p2,
113 Scalar radius,
114 const Core::Utils::Color& color );
115
119RA_ENGINE_API MeshPtr Disk( const Core::Vector3& center,
120 const Core::Vector3& normal,
121 Scalar radius,
122 uint segments,
123 const Core::Utils::Color& color );
124
127RA_ENGINE_API LineMeshPtr Normal( const Core::Vector3& point,
128 const Core::Vector3& normal,
129 const Core::Utils::Color& color,
130 Scalar scale = 0.1f );
131
137RA_ENGINE_API MeshPtr Frame( const Core::Transform& frameFromEntity, Scalar scale = 0.1f );
138
141RA_ENGINE_API MeshPtr Grid( const Core::Vector3& center,
142 const Core::Vector3& x,
143 const Core::Vector3& y,
144 const Core::Utils::Color& color,
145 Scalar cellSize = 1.f,
146 uint res = 10 );
147
149RA_ENGINE_API MeshPtr AABB( const Core::Aabb& aabb, const Core::Utils::Color& color );
150
152RA_ENGINE_API MeshPtr OBB( const Core::Geometry::Obb& obb, const Core::Utils::Color& color );
153
154RA_ENGINE_API MeshPtr Spline( const Core::Geometry::Spline<3, 3>& spline,
155 uint pointCount,
156 const Core::Utils::Color& color,
157 Scalar scale = 1.0f );
158
160RA_ENGINE_API MeshPtr LineStrip( const Core::Vector3Array& vertices,
161 const Core::Vector4Array& colors );
162
163} // namespace DrawPrimitives
164} // namespace Data
165} // namespace Engine
166} // namespace Ra
An oriented bounding box.
Definition Obb.hpp:12
Handling spline curves of arbitrary dimensions.
Definition Spline.hpp:24
A component is an element that can be updated by a system. It is also linked to some other components...
Definition Component.hpp:31
MeshPtr Capsule(const Core::Vector3 &p1, const Core::Vector3 &p2, Scalar radius, const Core::Utils::Color &color)
Displays a capsule computed with given endpoints and radius.
LineMeshPtr Line(const Core::Vector3 &a, const Core::Vector3 &b, const Core::Utils::Color &color)
Displays given line.
LineMeshPtr CircleArc(const Core::Vector3 &center, const Core::Vector3 &normal, Scalar radius, Scalar angle, uint segments, const Core::Utils::Color &color)
MeshPtr ParametricSphere(const Core::Vector3 &center, Scalar radius, const Core::Utils::Color &color, bool generateTexCoord)
MeshPtr Disk(const Core::Vector3 &center, const Core::Vector3 &normal, Scalar radius, uint segments, const Core::Utils::Color &color)
AttribArrayDisplayablePtr Triangle(const Core::Vector3 &a, const Core::Vector3 &b, const Core::Vector3 &c, const Core::Utils::Color &color, bool fill)
MeshPtr AABB(const Core::Aabb &aabb, const Core::Utils::Color &color)
Display a wireframe AABB.
MeshPtr Frame(const Core::Transform &frameFromEntity, Scalar scale)
LineMeshPtr Vector(const Core::Vector3 &start, const Core::Vector3 &v, const Core::Utils::Color &color)
Displays given vector shown as an arrow originating from 'start'.
MeshPtr Grid(const Core::Vector3 &center, const Core::Vector3 &x, const Core::Vector3 &y, const Core::Utils::Color &color, Scalar cellSize, uint res)
MeshPtr LineStrip(const Core::Vector3Array &vertices, const Core::Vector4Array &colors)
Display a line strip.
LineMeshPtr Normal(const Core::Vector3 &point, const Core::Vector3 &normal, const Core::Utils::Color &color, Scalar scale)
MeshPtr Sphere(const Core::Vector3 &center, Scalar radius, const Core::Utils::Color &color)
Displays geodesic sphere computed with given center and radius.
LineMeshPtr Circle(const Core::Vector3 &center, const Core::Vector3 &normal, Scalar radius, uint segments, const Core::Utils::Color &color)
LineMeshPtr Point(const Core::Vector3 &point, const Core::Utils::Color &color, Scalar scale)
Displays given point shown as the crossing of 3 lines of length 'scale'.
Rendering::RenderObject * Primitive(Scene::Component *component, const MeshPtr &mesh)
MeshPtr OBB(const Obb &obb, const Core::Utils::Color &color)
Display a wireframe OBB.
MeshPtr QuadStrip(const Core::Vector3 &a, const Core::Vector3 &x, const Core::Vector3 &y, uint quads, const Core::Utils::Color &color)
Displays a strip of n quads, starting at A and with directions X and Y.
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3