Ocean
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"
14 #include "ocean/rendering/Cone.h"
16 #include "ocean/rendering/Engine.h"
19 #include "ocean/rendering/Lines.h"
23 #include "ocean/rendering/Points.h"
24 #include "ocean/rendering/Sphere.h"
25 #include "ocean/rendering/Text.h"
29 
30 #include "ocean/base/Frame.h"
31 
32 #include "ocean/math/RGBAColor.h"
33 
35 
36 namespace Ocean
37 {
38 
39 namespace Rendering
40 {
41 
42 /**
43  * This class implements utility functions for the rendering library.
44  * @ingroup rendering
45  */
46 class 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 colorsPerVertex The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor'
265  * @param material Optional resulting Material node; will be invalid if colorPerVertex is not empty
266  * @param attributeSet Optional resulting AttributeSet node
267  * @param lineStrips Optional resulting LineStrips node
268  * @param vertexSet Optional resulting VertexSet node
269  * @return The resulting transform node holding the geometry node
270  */
271  static TransformRef createLines(const Engine& engine, const Vectors3& vertices, const VertexIndexGroups& lineIndexGroups, const RGBAColor& emissiveColor, const RGBAColors& colorsPerVertex = RGBAColors(), MaterialRef* material = nullptr, AttributeSetRef* attributeSet = nullptr, LineStripsRef* lineStrips = nullptr, VertexSetRef* vertexSet = nullptr);
272 
273  /**
274  * Returns a Transform holding a geometry with lines (a wireframe of a mesh).
275  * @param engine The rendering engine to be used
276  * @param vertices The vertices of all points to be rendered, at least one
277  * @param triangleFaces The indices of triangle vertices for which lines will be created, at least one
278  * @param emissiveColor The emissiveColor of all vertices in case 'colorsPerVertex' is empty, can be transparent
279  * @param colorsPerVertex The optional colors of the individual vertices, one for each vertex or empty to use the 'emissiveColor'
280  * @param material Optional resulting Material node; will be invalid if colorPerVertex is not empty
281  * @param attributeSet Optional resulting AttributeSet node
282  * @param lines Optional resulting Lines node
283  * @param vertexSet Optional resulting VertexSet node
284  * @return The resulting transform node holding the geometry node
285  */
286  static TransformRef createLines(const Engine& engine, const Vectors3& vertices, const TriangleFaces& triangleFaces, const RGBAColor& emissiveColor, const RGBAColors& colorsPerVertex = RGBAColors(), MaterialRef* material = nullptr, AttributeSetRef* attributeSet = nullptr, LinesRef* lines = nullptr, VertexSetRef* vertexSet = nullptr);
287 
288  /**
289  * Returns a Transform holding a geometry with lines (normals for given points).
290  * @param engine Rendering engine to be used
291  * @param points The starting points where the normals will start, at least one
292  * @param normals The normal vectors, one for each point
293  * @param size The number of points (and normals), with range [1, infinity)
294  * @param scale The scale which will be applied to each normal (allowing to control the length of the normals), with range (-infinity, infinity)
295  * @param emissiveColor The emissiveColor of all normals, can be transparent
296  * @param material Optional resulting Material node
297  * @param vertexSet Optional result vertex set object which holds the vertices of the 3D normals, two vertices for each normal
298  * @return The Transform node holding the normals
299  */
300  static TransformRef createLines(const Engine& engine, const Vector3* points, const Vector3* normals, const size_t size, const Scalar scale, const RGBAColor& emissiveColor, MaterialRef* material = nullptr, VertexSetRef* vertexSet = nullptr);
301 
302  /**
303  * Returns the first attribute set object that is located in a given node tree.
304  * @param node The node defining the root of the tree in that the attribute set is located
305  * @return First attribute set object that can be found
306  */
308 
309  protected:
310 
311  /**
312  * Returns a 64-bit index based on two 32-bit indices.
313  * @param indexA The first 32-bit index
314  * @param indexB The second 32-bit index
315  * @return The resulting 64-bit index
316  */
317  static inline uint64_t makeSortedIndex64(const uint32_t indexA, const uint32_t indexB);
318 };
319 
320 inline uint64_t Utilities::makeSortedIndex64(const uint32_t indexA, const uint32_t indexB)
321 {
322  if (indexA < indexB)
323  {
324  return uint64_t(indexA) | (uint64_t(indexB) << 32ull);
325  }
326 
327  return uint64_t(indexB) | (uint64_t(indexA) << 32ull);
328 }
329 
330 }
331 
332 }
333 
334 #endif // META_OCEAN_RENDERING_UTILITIES_H
This class implements Ocean's image class.
Definition: Frame.h:1760
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
@ HA_LEFT
The text block is anchored at the left edge.
Definition: rendering/Text.h:106
AlignmentMode
Definition of individual alignment modes within the text block.
Definition: rendering/Text.h:46
@ AM_LEFT
The text is aligned to the left of the text block.
Definition: rendering/Text.h:59
VerticalAnchor
Definition of individual vertical anchor points for the entire text block.
Definition: rendering/Text.h:139
@ VA_TOP
The text block is anchored at the top edge.
Definition: rendering/Text.h:141
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:320
static TransformRef createLines(const Engine &engine, const Vectors3 &vertices, const VertexIndexGroups &lineIndexGroups, const RGBAColor &emissiveColor, 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 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 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 createLines(const Engine &engine, const Vectors3 &vertices, const TriangleFaces &triangleFaces, const RGBAColor &emissiveColor, 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 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 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 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.
static TransformRef createLines(const Engine &engine, const Vector3 *points, const Vector3 *normals, const size_t size, const Scalar scale, const RGBAColor &emissiveColor, MaterialRef *material=nullptr, VertexSetRef *vertexSet=nullptr)
Returns a Transform holding a geometry with lines (normals for given points).
std::vector< RGBAColor > RGBAColors
Definition of a vector holding rgba color objects.
Definition: RGBAColor.h:21
float Scalar
Definition of a scalar type.
Definition: Math.h:128
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:32
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:23
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