8#ifndef META_OCEAN_SCENEDESCRIPTION_SDL_OBJ_OBJ_SCENE_H
9#define META_OCEAN_SCENEDESCRIPTION_SDL_OBJ_OBJ_SCENE_H
134 using FacePair = std::pair<FaceType, MaterialIndex>;
This class holds vertex, normal and texture indices for a triangle.
Definition OBJScene.h:59
Rendering::VertexIndices vertexIndices_
Vertex indices.
Definition OBJScene.h:97
Rendering::VertexIndices textureIndices_
Texture coordinate indices.
Definition OBJScene.h:103
const Rendering::VertexIndices & textureIndices() const
Returns the texture coordinate indices of the face.
Definition OBJScene.h:279
Rendering::VertexIndices normalIndices_
Noraml indices.
Definition OBJScene.h:100
const Rendering::VertexIndices & vertexIndices() const
Returns the vertex indices of the face.
Definition OBJScene.h:269
const Rendering::VertexIndices & normalIndices() const
Returns the normal indices of the face.
Definition OBJScene.h:274
FaceType type() const
Returns the face type of this object.
Definition OBJScene.h:264
Face(const Rendering::VertexIndices &vertexIndices, const Rendering::VertexIndices &normalIndices, const Rendering::VertexIndices &textureIndices)
Creates a new face object.
Definition OBJScene.h:254
Rendering::TextureCoordinates textureCoordinates_
Vector holding all texture coordinate of the obj scene.
Definition OBJScene.h:239
void setCurrentMaterial(const std::string &material)
Sets the current selected material.
void addVertex(const Rendering::Vertex &vertex)
Adds a new vertex to the scene.
Definition OBJScene.h:304
void addMaterials(Materials &&materials)
Adds materials to the obj scene.
MaterialIndexMap materialIndexMap_
Map mapping material names to material indices.
Definition OBJScene.h:248
OBJScene(const std::string &filename)
Creates a new OBJ scene object.
FaceType
Definition of different face types.
Definition OBJScene.h:44
@ TYPE_VNT
Face holding vertices, texture coordinates and normals.
Definition OBJScene.h:52
@ TYPE_VT
Face holding vertices and texture coordinates.
Definition OBJScene.h:50
@ TYPE_VN
Face holding vertices and normals.
Definition OBJScene.h:48
@ TYPE_V
Face holding vertices only.
Definition OBJScene.h:46
static constexpr MaterialIndex invalidMaterialIndex_
Definition of an invalid material index.
Definition OBJScene.h:119
Rendering::SceneRef internalApply(const Rendering::EngineRef &engine) override
Applies the entire scene to the rendering engine.
std::unordered_map< std::string, unsigned int > MaterialIndexMap
Definition of a map mapping material names to material indices.
Definition OBJScene.h:124
unsigned int MaterialIndex
Definition of a material index.
Definition OBJScene.h:114
void addNormal(const Rendering::Normal &normal)
Adds a new normal to the scene.
Definition OBJScene.h:309
Rendering::Vertices vertices_
Vector holding all vertices of the obj scene.
Definition OBJScene.h:233
std::vector< Material > Materials
Definition of a vector holding materials.
Definition OBJScene.h:109
const Rendering::Normals & normals() const
Returns the normals of the entire obj scene.
Definition OBJScene.h:289
unsigned int selectedMaterialIndex_
Current selected material index.
Definition OBJScene.h:251
void addTextureCoordinate(const Rendering::TextureCoordinate &textureCoordinate)
Adds a new texture coordinate to the scene.
Definition OBJScene.h:314
const Rendering::Vertices & vertices() const
Returns the vertices of the entire obj scene.
Definition OBJScene.h:284
void addFace(const Face &face)
Adds a new face to the scene.
Rendering::Normals normals_
Vector holding all normals of the obj scene.
Definition OBJScene.h:236
std::pair< FaceType, MaterialIndex > FacePair
Definition of a pair of face type and material index.
Definition OBJScene.h:134
const Rendering::TextureCoordinates & textureCoordinates() const
Returns the texture coordinates of the entire obj scene.
Definition OBJScene.h:294
std::map< FacePair, Faces > FacesMap
Definition of a map mapping face pairs to faces.
Definition OBJScene.h:139
std::vector< Face > Faces
Definition of a vector holding faces.
Definition OBJScene.h:129
Rendering::NodeRef createTriangles(const Rendering::EngineRef &engine)
Creates a new triangle mesh object.
Materials materials_
All material objects of this scene.
Definition OBJScene.h:245
~OBJScene() override
Destructs an OBJ scene object.
FacesMap facesMap_
Map holding all faces of the obj scene.
Definition OBJScene.h:242
const FacesMap & facesMap() const
Returns all faces of the entire obj scene.
Definition OBJScene.h:299
SDLScene(const std::string &filename)
Creates a new scene object.
const std::string & filename() const
Returns the filename of this scene.
Definition scenedescription/Scene.h:57
Ocean::ObjectRef< Engine > EngineRef
Definition of an engine reference object.
Definition Engine.h:30
std::vector< VertexIndex > VertexIndices
Definition of a vector holding vertex indices.
Definition rendering/Rendering.h:101
std::vector< TextureCoordinate > TextureCoordinates
Definition of a vector holding texture coordinates.
Definition rendering/Rendering.h:113
Vector3 Vertex
Definition of a 3D vertex.
Definition rendering/Rendering.h:95
std::vector< Normal > Normals
Definition of a vector holding normals.
Definition rendering/Rendering.h:107
Vector3 Normal
Definition of a 3D normal.
Definition rendering/Rendering.h:83
std::vector< Vertex > Vertices
Definition of a vector holding vertices.
Definition rendering/Rendering.h:119
SmartObjectRef< Node > NodeRef
Definition of a smart object reference holding a node.
Definition rendering/Node.h:34
SmartObjectRef< Scene > SceneRef
Definition of a smart object reference holding a scene node.
Definition rendering/Scene.h:29
Vector2 TextureCoordinate
Definition of a 2D texture coordinate.
Definition rendering/Rendering.h:89
Namespace of the SDL OBJ SceneDescription library.
Definition scenedescription/sdl/obj/jni/JNI.h:25
Namespace of the SceneDescription library.
Definition DynamicNode.h:21
The namespace covering the entire Ocean framework.
Definition Accessor.h:15