Ocean
Loading...
Searching...
No Matches
rendering/Utilities.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_RENDERING_UTILITIES_H
9#define META_OCEAN_RENDERING_UTILITIES_H
10
13#include "ocean/rendering/Box.h"
29
30#include "ocean/base/Frame.h"
31
33
35
36namespace Ocean
37{
38
39namespace Rendering
40{
41
42/**
43 * This class implements utility functions for the rendering library.
44 * @ingroup rendering
45 */
46class OCEAN_RENDERING_EXPORT Utilities
47{
48 public:
49
50 /**
51 * Returns a Transform object holding a visible box, no material is applied.
52 * @param engine Rendering engine to be used
53 * @param dimension The dimension of the box in x, y and z direction, with range [0, infinity)x[0, infinity)x[0, infinity)
54 * @param box Optional resulting box object which is attached with the geometry
55 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
56 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
57 */
58 static TransformRef createBox(const EngineRef& engine, const Vector3& dimension, BoxRef* box = nullptr, AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr);
59
60 /**
61 * Returns a Transform object holding a visible box, further a material is applied.
62 * @param engine Rendering engine to be used
63 * @param dimension The dimension of the box in x, y and z direction
64 * @param color Diffuse color to be used
65 * @param box Optional resulting box object which is attached with the geometry
66 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
67 * @param material Optional resulting material object which is attached with the resulting box
68 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
69 */
70 static TransformRef createBox(const EngineRef& engine, const Vector3& dimension, const RGBAColor& color, BoxRef* box = nullptr, AttributeSetRef* attributeSet = nullptr, MaterialRef* material = nullptr, GeometryRef* geometry = nullptr);
71
72 /**
73 * Returns a Transform object holding a visible box, further a texture is applied.
74 * @param engine Rendering engine to be used
75 * @param dimension The dimension of the box in x, y and z direction
76 * @param textureMedium The frame medium which is used for the texture
77 * @param texture Optional resulting texture object which is attached with the resulting box
78 * @param createMipmaps True, to create a texture with mipmaps; False, to create a texture without mipmaps
79 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
80 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
81 * @param color Optional color to be used, nullptr to create a box without material
82 */
83 static TransformRef createBox(const EngineRef& engine, const Vector3& dimension, const Media::FrameMediumRef textureMedium, MediaTexture2DRef* texture = nullptr, const bool createMipmaps = true, AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr, const RGBAColor* color = nullptr);
84
85 /**
86 * Returns a Transform object holding a visible box, further a texture is applied.
87 * @param engine Rendering engine to be used
88 * @param dimension The dimension of the box in x, y and z direction
89 * @param frame The frame which is used for the texture, must own the image memory, must be valid
90 * @param texture Optional resulting texture object which is attached with the resulting box
91 * @param createMipmaps True, to create a texture with mipmaps; False, to create a texture without mipmaps
92 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
93 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
94 * @param color Optional color to be used, nullptr to create a box without material
95 */
96 static TransformRef createBox(const EngineRef& engine, const Vector3& dimension, Frame&& frame, FrameTexture2DRef* texture = nullptr, const bool createMipmaps = true, AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr, const RGBAColor* color = nullptr);
97
98 /**
99 * Returns a Transform object holding a visible sphere, no material is applied.
100 * @param engine Rendering engine to be used
101 * @param radius The radius of the sphere, with range [0, infinity)
102 * @param sphere Optional resulting sphere object which is attached with the geometry
103 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
104 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
105 */
106 static TransformRef createSphere(const EngineRef& engine, const Scalar radius, SphereRef* sphere = nullptr, AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr);
107
108 /**
109 * Returns a Transform object holding a visible sphere, further a material is applied.
110 * @param engine Rendering engine to be used
111 * @param radius The radius of the sphere, with range [0, infinity)
112 * @param color Diffuse color to be used
113 * @param sphere Optional resulting sphere object which is attached with the geometry
114 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
115 * @param material Optional resulting material object which is attached with the geometry
116 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
117 */
118 static TransformRef createSphere(const EngineRef& engine, const Scalar radius, const RGBAColor& color, SphereRef* sphere = nullptr, AttributeSetRef* attributeSet = nullptr, MaterialRef* material = nullptr, GeometryRef* geometry = nullptr);
119
120 /**
121 * Returns a Transform object holding a visible sphere, further a texture is applied.
122 * @param engine Rendering engine to be used
123 * @param radius The radius of the sphere, with range [0, infinity)
124 * @param frame The frame which is used for the texture, must own the image memory, must be valid
125 * @param texture Optional resulting texture object which is attached with the resulting sphere
126 * @param createMipmaps True, to create a texture with mipmaps; False, to create a texture without mipmaps
127 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
128 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
129 * @param color Optional color to be used, nullptr to create a sphere without material
130 */
131 static TransformRef createSphere(const EngineRef& engine, const Scalar radius, Frame&& frame, FrameTexture2DRef* texture = nullptr, const bool createMipmaps = true, AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr, const RGBAColor* color = nullptr);
132
133 /**
134 * Returns a Transform object holding a visible cylinder, further a material is applied.
135 * @param engine Rendering engine to be used
136 * @param radius The radius of the cylinder, with range (0, infinity)
137 * @param height The height of the cylinder, with range (0, infinity)
138 * @param color Diffuse color to be used
139 * @param cylinder Optional resulting cylinder object which is attached with the geometry
140 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
141 * @param material Optional resulting material object which is attached with the geometry
142 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
143 */
144 static TransformRef createCylinder(const EngineRef& engine, const Scalar radius, const Scalar height, const RGBAColor& color, CylinderRef* cylinder = nullptr, AttributeSetRef* attributeSet = nullptr, MaterialRef* material = nullptr, GeometryRef* geometry = nullptr);
145
146 /**
147 * Returns a Transform object holding a visible cone, further a material is applied.
148 * @param engine Rendering engine to be used
149 * @param radius The radius of the cone, with range (0, infinity)
150 * @param height The height of the cone, with range (0, infinity)
151 * @param color Diffuse color to be used
152 * @param cone Optional resulting cone object which is attached with the geometry
153 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
154 * @param material Optional resulting material object which is attached with the geometry
155 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
156 */
157 static TransformRef createCone(const EngineRef& engine, const Scalar radius, const Scalar height, const RGBAColor& color, ConeRef* cone = nullptr, AttributeSetRef* attributeSet = nullptr, MaterialRef* material = nullptr, GeometryRef* geometry = nullptr);
158
159 /**
160 * Returns a Transform object holding a visible coordinate system rendered as cylinders with cones.
161 * @param engine Rendering engine to be used
162 * @param length The length of the arrow, with range (0, infinity)
163 * @param topLength Length of the arrow top, with range (0, infinity)
164 * @param radius of the arrow, with range (0, infinity)
165 * @return Transform node
166 */
167 static TransformRef createCoordinateSystem(const EngineRef& engine, const Scalar length, const Scalar topLength, const Scalar radius);
168
169 /**
170 * Returns a Transform object holding several individual visible coordinate system rendered as thin lines.
171 * @param engine Rendering engine to be used
172 * @param world_T_coordinateSystems The individual coordinate systems, at least one
173 * @param length The length of each axis, with range (0, infinity)
174 * @param vertexSet Optional result vertex set object which holds the vertices of the 3D object, six vertices for each coordinate system, with order (origin, x-axis, origin, y-axis, origin, z-axis)
175 * @return The Transform node holding the coordinate system
176 */
177 static TransformRef createCoordinateSystems(const Engine& engine, const HomogenousMatrices4& world_T_coordinateSystems, const Scalar length, VertexSetRef* vertexSet = nullptr);
178
179 /**
180 * Returns an arrow with specified length and radius.
181 * @param engine Rendering engine to be used
182 * @param length The length of the arrow, with range [0, infinity)
183 * @param topLength Length of the arrow top, with range [0, infinity)
184 * @param radius of the arrow, with range [0, infinity)
185 * @param color The color to be applied, must be valid
186 * @return Transform node holding a visible arrow
187 */
188 static TransformRef createArrow(const EngineRef& engine, const Scalar length, const Scalar topLength, const Scalar radius, const RGBAColor& color);
189
190 /**
191 * Returns a mesh by a given set of vertices and their corresponding triangulation.
192 * @param engine Rendering engine to be used
193 * @param vertices The vertices defining the mesh
194 * @param triangleFaces Triangulation defining the topology
195 * @param color The color to be applied to the entire mesh, invalid to create an unlit mesh
196 * @param normals Optional normals of each vertex
197 * @param textureCoordinates Optional texture coordinates, one for each given vertex
198 * @param textureFrame Optional frame to be used as texture, most be owner of the memory if provided, invalid to use no texture or to use the textureMedium instead
199 * @param textureMedium Optional texture medium, invalid to use no texture or to use the textureFrame instead
200 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
201 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
202 * @param vertexSet Optional result vertex set object which holds the vertices of the 3D object
203 * @param texture Optional resulting texture object
204 * @return Transform node holding the mesh object
205 */
206 static TransformRef createMesh(const EngineRef& engine, const Vectors3& vertices, const TriangleFaces& triangleFaces, const RGBAColor& color, const Normals& normals = Normals(), const TextureCoordinates& textureCoordinates = TextureCoordinates(), Frame&& textureFrame = Frame(), const Media::FrameMediumRef& textureMedium = Media::FrameMediumRef(), AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr, VertexSetRef* vertexSet = nullptr, Texture2DRef* texture = nullptr);
207
208 /**
209 * Returns a textured plane with z-axis a normal.
210 * @param engine Rendering engine to be used, must be valid
211 * @param width The width of the plane in object domain (the size of the plane in x-direction), with range (0, infinity)
212 * @param height The height of the plane in object domain (the size of the plane, in y-direction), with range (0, infinity)
213 * @param textureMedium The frame medium which is used for the texture
214 * @param texture Optional resulting texture object which is attached with the resulting box
215 * @param createMipmaps True, to create a texture with mipmaps; False, to create a texture without mipmaps
216 * @param attributeSet Optional resulting AttributeSet object which is attached with the geometry
217 * @param geometry Optional resulting geometry object which is encapsulating the 3D object
218 * @return Transform node holding the plane
219 */
220 static TransformRef createTexturedPlane(const EngineRef& engine, const Scalar width, const Scalar height, const Media::FrameMediumRef textureMedium, MediaTexture2DRef* texture = nullptr, const bool createMipmaps = true, AttributeSetRef* attributeSet = nullptr, GeometryRef* geometry = nullptr);
221
222 /**
223 * Returns a planar text within the x,y plane.
224 * @param engine The rendering engine to be used
225 * @param textString The actual text to show
226 * @param foregroundColor The foreground color to be used
227 * @param backgroundColor The background color to be used, a transparent color to create a text without background
228 * @param shaded True, to create a text with shading/lighting; False, to create a text constant color
229 * @param fixedWidth The optional fixed width, with range [0, infinity)
230 * @param fixedHeight The optional fixed height, with range [0, infinity)
231 * @param fixedLineHeight The optional fixed line height, with range [0, infinity)
232 * @param alignmentMode The text's alignment mode
233 * @param horizontalAnchor The text's horizontal anchor
234 * @param verticalAnchor The text's vertical anchor
235 * @param fontFamily The font family to be used, empty to use a default font family
236 * @param styleName The font style to be used, empty to use the default font style
237 * @param text Optional resulting text node which will be part of the resulting Transform node, nullptr of not of interest
238 * @param foregroundMaterial Optional resulting foreground material of the new text, nullptr if not of interest
239 * @param backgroundMaterial Optional resulting background material of the new text, nullptr if not of interest
240 */
241 static TransformRef createText(const Engine& engine, const std::string& textString, const RGBAColor& foregroundColor, const RGBAColor& backgroundColor, const bool shaded, const Scalar fixedWidth, const Scalar fixedHeight, const Scalar fixedLineHeight, const Text::AlignmentMode alignmentMode = Text::AM_LEFT, const Text::HorizontalAnchor horizontalAnchor = Text::HA_LEFT, const Text::VerticalAnchor verticalAnchor = Text::VA_TOP, const std::string& fontFamily = std::string(), const std::string& styleName = std::string(), TextRef* text = nullptr, MaterialRef* foregroundMaterial = nullptr, MaterialRef* backgroundMaterial = nullptr);
242
243 /**
244 * Returns a Transform holding a geometry with points.
245 * @param engine The rendering engine to be used
246 * @param vertices The vertices of all points to be rendered, at least one
247 * @param emissiveColor The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent
248 * @param pointSize The size of the points, with range [1, infinity)
249 * @param colorsPerVertex The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor'
250 * @param material Optional resulting Material node; will be invalid if colorPerVertex is not empty
251 * @param attributeSet Optional resulting AttributeSet node
252 * @param points Optional resulting Points node
253 * @param vertexSet Optional resulting VertexSet node
254 * @return The resulting transform node holding the geometry node
255 */
256 static TransformRef createPoints(const Engine& engine, const Vectors3& vertices, const RGBAColor& emissiveColor, const Scalar pointSize = Scalar(5), const RGBAColors& colorsPerVertex = RGBAColors(), MaterialRef* material = nullptr, AttributeSetRef* attributeSet = nullptr, PointsRef* points = nullptr, VertexSetRef* vertexSet = nullptr);
257
258 /**
259 * Returns a Transform holding a geometry with lines.
260 * @param engine The rendering engine to be used
261 * @param vertices The vertices of all points to be rendered, at least one
262 * @param lineIndexGroups The group of vertex indices defining several individual lines, at least one
263 * @param emissiveColor The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent
264 * @param lineWidth The width of the lines in pixels, with range [1, infinity)
265 * @param colorsPerVertex The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor'
266 * @param material Optional resulting Material node; will be invalid if colorPerVertex is not empty
267 * @param attributeSet Optional resulting AttributeSet node
268 * @param lineStrips Optional resulting LineStrips node
269 * @param vertexSet Optional resulting VertexSet node
270 * @return The resulting transform node holding the geometry node
271 */
272 static TransformRef createLines(const Engine& engine, const Vectors3& vertices, const VertexIndexGroups& lineIndexGroups, const RGBAColor& emissiveColor, const Scalar lineWidth = Scalar(1), const RGBAColors& colorsPerVertex = RGBAColors(), MaterialRef* material = nullptr, AttributeSetRef* attributeSet = nullptr, LineStripsRef* lineStrips = nullptr, VertexSetRef* vertexSet = nullptr);
273
274 /**
275 * Returns a Transform holding a geometry with lines (a wireframe of a mesh).
276 * @param engine The rendering engine to be used
277 * @param vertices The vertices of all points to be rendered, at least one
278 * @param triangleFaces The indices of triangle vertices for which lines will be created, at least one
279 * @param emissiveColor The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent
280 * @param lineWidth The width of the lines in pixels, with range [1, infinity)
281 * @param colorsPerVertex The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor'
282 * @param material Optional resulting Material node; will be invalid if colorPerVertex is not empty
283 * @param attributeSet Optional resulting AttributeSet node
284 * @param lines Optional resulting Lines node
285 * @param vertexSet Optional resulting VertexSet node
286 * @return The resulting transform node holding the geometry node
287 */
288 static TransformRef createLines(const Engine& engine, const Vectors3& vertices, const TriangleFaces& triangleFaces, const RGBAColor& emissiveColor, const Scalar lineWidth = Scalar(1), const RGBAColors& colorsPerVertex = RGBAColors(), MaterialRef* material = nullptr, AttributeSetRef* attributeSet = nullptr, LinesRef* lines = nullptr, VertexSetRef* vertexSet = nullptr);
289
290 /**
291 * Returns a Transform holding a geometry with lines (normals for given points).
292 * @param engine Rendering engine to be used
293 * @param points The starting points where the normals will start, at least one
294 * @param normals The normal vectors, one for each point
295 * @param size The number of points (and normals), with range [1, infinity)
296 * @param scale The scale which will be applied to each normal (allowing to control the length of the normals), with range (-infinity, infinity)
297 * @param emissiveColor The emissiveColor of all normals, can be transparent
298 * @param lineWidth The width of the lines in pixels, with range [1, infinity)
299 * @param material Optional resulting Material node
300 * @param vertexSet Optional result vertex set object which holds the vertices of the 3D normals, two vertices for each normal
301 * @return The Transform node holding the normals
302 */
303 static TransformRef createLines(const Engine& engine, const Vector3* points, const Vector3* normals, const size_t size, const Scalar scale, const RGBAColor& emissiveColor, const Scalar lineWidth = Scalar(1), MaterialRef* material = nullptr, VertexSetRef* vertexSet = nullptr);
304
305 /**
306 * Returns the first attribute set object that is located in a given node tree.
307 * @param node The node defining the root of the tree in that the attribute set is located
308 * @return First attribute set object that can be found
309 */
311
312 protected:
313
314 /**
315 * Returns a 64-bit index based on two 32-bit indices.
316 * @param indexA The first 32-bit index
317 * @param indexB The second 32-bit index
318 * @return The resulting 64-bit index
319 */
320 static inline uint64_t makeSortedIndex64(const uint32_t indexA, const uint32_t indexB);
321};
322
323inline uint64_t Utilities::makeSortedIndex64(const uint32_t indexA, const uint32_t indexB)
324{
325 if (indexA < indexB)
326 {
327 return uint64_t(indexA) | (uint64_t(indexB) << 32ull);
328 }
329
330 return uint64_t(indexB) | (uint64_t(indexA) << 32ull);
331}
332
333}
334
335}
336
337#endif // META_OCEAN_RENDERING_UTILITIES_H
This class implements Ocean's image class.
Definition Frame.h:1808
This class implements a color defined by red, green, blue and alpha parameters.
Definition RGBAColor.h:41
This class is the base class for all rendering engines like.
Definition Engine.h:46
This class implements a smart rendering object reference.
Definition rendering/ObjectRef.h:34
HorizontalAnchor
Definition of individual horizontal anchor points for the entire text block.
Definition rendering/Text.h:94
AlignmentMode
Definition of individual alignment modes within the text block.
Definition rendering/Text.h:46
VerticalAnchor
Definition of individual vertical anchor points for the entire text block.
Definition rendering/Text.h:139
This class implements utility functions for the rendering library.
Definition rendering/Utilities.h:47
static TransformRef createMesh(const EngineRef &engine, const Vectors3 &vertices, const TriangleFaces &triangleFaces, const RGBAColor &color, const Normals &normals=Normals(), const TextureCoordinates &textureCoordinates=TextureCoordinates(), Frame &&textureFrame=Frame(), const Media::FrameMediumRef &textureMedium=Media::FrameMediumRef(), AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, VertexSetRef *vertexSet=nullptr, Texture2DRef *texture=nullptr)
Returns a mesh by a given set of vertices and their corresponding triangulation.
static TransformRef createSphere(const EngineRef &engine, const Scalar radius, const RGBAColor &color, SphereRef *sphere=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr)
Returns a Transform object holding a visible sphere, further a material is applied.
static TransformRef createBox(const EngineRef &engine, const Vector3 &dimension, BoxRef *box=nullptr, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr)
Returns a Transform object holding a visible box, no material is applied.
static uint64_t makeSortedIndex64(const uint32_t indexA, const uint32_t indexB)
Returns a 64-bit index based on two 32-bit indices.
Definition rendering/Utilities.h:323
static TransformRef createCylinder(const EngineRef &engine, const Scalar radius, const Scalar height, const RGBAColor &color, CylinderRef *cylinder=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr)
Returns a Transform object holding a visible cylinder, further a material is applied.
static TransformRef createLines(const Engine &engine, const Vectors3 &vertices, const VertexIndexGroups &lineIndexGroups, const RGBAColor &emissiveColor, const Scalar lineWidth=Scalar(1), const RGBAColors &colorsPerVertex=RGBAColors(), MaterialRef *material=nullptr, AttributeSetRef *attributeSet=nullptr, LineStripsRef *lineStrips=nullptr, VertexSetRef *vertexSet=nullptr)
Returns a Transform holding a geometry with lines.
static TransformRef createArrow(const EngineRef &engine, const Scalar length, const Scalar topLength, const Scalar radius, const RGBAColor &color)
Returns an arrow with specified length and radius.
static TransformRef createBox(const EngineRef &engine, const Vector3 &dimension, const RGBAColor &color, BoxRef *box=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr)
Returns a Transform object holding a visible box, further a material is applied.
static TransformRef createBox(const EngineRef &engine, const Vector3 &dimension, Frame &&frame, FrameTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr)
Returns a Transform object holding a visible box, further a texture is applied.
static TransformRef createCoordinateSystems(const Engine &engine, const HomogenousMatrices4 &world_T_coordinateSystems, const Scalar length, VertexSetRef *vertexSet=nullptr)
Returns a Transform object holding several individual visible coordinate system rendered as thin line...
static TransformRef createSphere(const EngineRef &engine, const Scalar radius, SphereRef *sphere=nullptr, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr)
Returns a Transform object holding a visible sphere, no material is applied.
static TransformRef createLines(const Engine &engine, const Vector3 *points, const Vector3 *normals, const size_t size, const Scalar scale, const RGBAColor &emissiveColor, const Scalar lineWidth=Scalar(1), MaterialRef *material=nullptr, VertexSetRef *vertexSet=nullptr)
Returns a Transform holding a geometry with lines (normals for given points).
static TransformRef createCoordinateSystem(const EngineRef &engine, const Scalar length, const Scalar topLength, const Scalar radius)
Returns a Transform object holding a visible coordinate system rendered as cylinders with cones.
static TransformRef createPoints(const Engine &engine, const Vectors3 &vertices, const RGBAColor &emissiveColor, const Scalar pointSize=Scalar(5), const RGBAColors &colorsPerVertex=RGBAColors(), MaterialRef *material=nullptr, AttributeSetRef *attributeSet=nullptr, PointsRef *points=nullptr, VertexSetRef *vertexSet=nullptr)
Returns a Transform holding a geometry with points.
static TransformRef createText(const Engine &engine, const std::string &textString, const RGBAColor &foregroundColor, const RGBAColor &backgroundColor, const bool shaded, const Scalar fixedWidth, const Scalar fixedHeight, const Scalar fixedLineHeight, const Text::AlignmentMode alignmentMode=Text::AM_LEFT, const Text::HorizontalAnchor horizontalAnchor=Text::HA_LEFT, const Text::VerticalAnchor verticalAnchor=Text::VA_TOP, const std::string &fontFamily=std::string(), const std::string &styleName=std::string(), TextRef *text=nullptr, MaterialRef *foregroundMaterial=nullptr, MaterialRef *backgroundMaterial=nullptr)
Returns a planar text within the x,y plane.
static TransformRef createLines(const Engine &engine, const Vectors3 &vertices, const TriangleFaces &triangleFaces, const RGBAColor &emissiveColor, const Scalar lineWidth=Scalar(1), const RGBAColors &colorsPerVertex=RGBAColors(), MaterialRef *material=nullptr, AttributeSetRef *attributeSet=nullptr, LinesRef *lines=nullptr, VertexSetRef *vertexSet=nullptr)
Returns a Transform holding a geometry with lines (a wireframe of a mesh).
static TransformRef createSphere(const EngineRef &engine, const Scalar radius, Frame &&frame, FrameTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr)
Returns a Transform object holding a visible sphere, further a texture is applied.
static TransformRef createBox(const EngineRef &engine, const Vector3 &dimension, const Media::FrameMediumRef textureMedium, MediaTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr, const RGBAColor *color=nullptr)
Returns a Transform object holding a visible box, further a texture is applied.
static TransformRef createCone(const EngineRef &engine, const Scalar radius, const Scalar height, const RGBAColor &color, ConeRef *cone=nullptr, AttributeSetRef *attributeSet=nullptr, MaterialRef *material=nullptr, GeometryRef *geometry=nullptr)
Returns a Transform object holding a visible cone, further a material is applied.
static TransformRef createTexturedPlane(const EngineRef &engine, const Scalar width, const Scalar height, const Media::FrameMediumRef textureMedium, MediaTexture2DRef *texture=nullptr, const bool createMipmaps=true, AttributeSetRef *attributeSet=nullptr, GeometryRef *geometry=nullptr)
Returns a textured plane with z-axis a normal.
static AttributeSetRef findAttributeSet(const NodeRef &node)
Returns the first attribute set object that is located in a given node tree.
std::vector< RGBAColor > RGBAColors
Definition of a vector holding rgba color objects.
Definition RGBAColor.h:27
float Scalar
Definition of a scalar type.
Definition Math.h:129
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition HomogenousMatrix4.h:73
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition Vector3.h:65
SmartMediumRef< FrameMedium > FrameMediumRef
Definition of a smart medium reference holding a frame medium object.
Definition FrameMedium.h:39
std::vector< TextureCoordinate > TextureCoordinates
Definition of a vector holding texture coordinates.
Definition rendering/Rendering.h:113
std::vector< Normal > Normals
Definition of a vector holding normals.
Definition rendering/Rendering.h:107
std::vector< TriangleFace > TriangleFaces
Definition of a vector holding triangle faces.
Definition TriangleFace.h:30
std::vector< VertexIndices > VertexIndexGroups
Definition of a vector holding vertex indices.
Definition rendering/Rendering.h:125
The namespace covering the entire Ocean framework.
Definition Accessor.h:15