RobWorkProject
20.10.1-
|
An abstract 3d object consisting of geometry information, material and texture. More...
#include <Model3D.hpp>
Inherited by Model3D::Object3D< T >.
Classes | |
struct | MaterialMapData |
Mapping from triangles to materials. More... | |
Public Types | |
typedef rw::core::Ptr< Object3DGeneric > | Ptr |
Smart pointer type for Object3DGeneric. | |
Public Member Functions | |
bool | hasTexture () const |
test if the object is textured | |
void | setMaterial (std::size_t material) |
set the material used by addTriangles More... | |
virtual void | scale (float scale)=0 |
Scales the object by scale. More... | |
virtual std::size_t | countFaces () const =0 |
Get the number of faces. More... | |
virtual std::vector< rw::math::Vector3D< float > > | getFaceVertices (size_t idx) const =0 |
Returns vertices corresponding to the idx face. More... | |
Public Attributes | |
std::string | _name |
name/id of object | |
int | _parentObj |
index of parent object | |
bool | _hasTexture |
true if any of the materials used has texture | |
std::vector< rw::math::Vector3D< float > > | _vertices |
Vertice array. | |
std::vector< rw::math::Vector3D< float > > | _normals |
Normal array, there must be exactly one normal per vertex. | |
std::vector< rw::math::Vector2D< float > > | _texCoords |
Texture coordinate array, the texture coordinates can be mapped to either vertices or faces. The reason for this is that often vertices share two or more texcoordinates and if mapping directly to vertices then additional vertices is necessary. | |
bool | _mappedToFaces |
if true then the tex coodinates are mapped to faces and not vertices. if false then the texCoords are mapped to each vertice | |
rw::math::Transform3D< float > | _transform |
Transform of the object. | |
std::vector< Object3DGeneric::Ptr > | _kids |
Child objects. | |
rw::math::Vector2D< float > | _texOffset |
Offset of texture. | |
rw::math::Vector2D< float > | _texRepeat |
Repeat texture. | |
std::vector< MaterialMapData > | _materialMap |
maps material into a range of triangles. | |
std::vector< MaterialPolys::Ptr > | _matPolys |
Polygons ordered according to material. | |
Protected Member Functions | |
Object3DGeneric (const std::string &name) | |
constructor More... | |
An abstract 3d object consisting of geometry information, material and texture.
To reduce memory, the geometry is implemented slightly differently for different mesh sizes. One of the concrete Object3D implementations should be used in practice.
|
inlineprotected |
constructor
name | [in] name of object |
|
pure virtual |
|
pure virtual |
Returns vertices corresponding to the idx face.
idx | [in] Index of the face |
Implemented in Model3D::Object3D< T >.
|
pure virtual |
Scales the object by scale.
scale | [in] The scaling factor. |
Implemented in Model3D::Object3D< T >.
|
inline |
set the material used by addTriangles
material |