FDatasmithMesh Class Reference

Public Member Functions

 FDatasmithMesh (const FDatasmithMesh &Other)
 
 FDatasmithMesh (FDatasmithMesh &&Other)
 
FDatasmithMesh & operator= (const FDatasmithMesh &Other)
 
FDatasmithMesh & operator= (FDatasmithMesh &&Other)
 
void SetName (const TCHAR *InName)
 
const TCHAR * GetName () const
 
void SetFacesCount (int32 NumFaces)
 Setting the amount of faces is mandatory before filling the array. More...
 
int32 GetFacesCount () const
 Retrieves the amount of faces. More...
 
void SetFace (int32 Index, int32 Vertex1, int32 Vertex2, int32 Vertex3, int32 MaterialId=0)
 Sets the geometry of the face. More...
 
void GetFace (int32 Index, int32 &Vertex1, int32 &Vertex2, int32 &Vertex3, int32 &MaterialId) const
 
void SetFaceSmoothingMask (int32 Index, uint32 SmoothingMask)
 Sets the smoothing mask of the face. More...
 
uint32 GetFaceSmoothingMask (int32 Index) const
 Gets the smoothing mask of a face. More...
 
int32 GetMaterialsCount () const
 
bool IsMaterialIdUsed (int32 MaterialId) const
 
void SetVerticesCount (int32 NumVerts)
 Setting the amount of geometric vertices is mandatory before filling the array. More...
 
int32 GetVerticesCount () const
 Retrieves the amount of geometric vertices. More...
 
void SetVertex (int32 Index, float X, float Y, float Z)
 Sets the 3d position of the vertex. More...
 
FVector GetVertex (int32 Index) const
 
void SetNormal (int32 Index, float X, float Y, float Z)
 Sets the 3d normal. More...
 
FVector GetNormal (int32 Index) const
 
void SetUVChannelsCount (int32 ChannelCount)
 Sets the amount of UV channels on this mesh. More...
 
void AddUVChannel ()
 Add a UV channel at the end. More...
 
void RemoveUVChannel ()
 Remove the last UV channel. More...
 
int32 GetUVChannelsCount () const
 Gets the amount of UV channels on this mesh. More...
 
void SetUVCount (int32 Channel, int32 NumVerts)
 Setting the amount of UV coordinates on the channel is mandatory before filling the array. More...
 
int32 GetUVCount (int32 Channel) const
 Retrieves the amount of UV coordinates on the channel. More...
 
void SetUV (int32 Channel, int32 Index, double U, double V)
 Sets the 2d position of the UV vertex for the first uv mapping. More...
 
uint32 GetHashForUVChannel (int32 Channel) const
 Get the hash for a uv channel. More...
 
FVector2D GetUV (int32 Channel, int32 Index) const
 Gets the UV coordinates for a channel. More...
 
void SetFaceUV (int32 Index, int32 Channel, int32 Vertex1, int32 Vertex2, int32 Vertex3)
 Sets the channel UV coordinates of the face. More...
 
void GetFaceUV (int32 Index, int32 Channel, int32 &Vertex1, int32 &Vertex2, int32 &Vertex3) const
 Gets the UV coordinates of the vertices of a face. More...
 
int32 GetVertexColorCount () const
 Get the number of vertex color. More...
 
void SetVertexColor (int32 Index, const FColor &Color)
 Set a vertex color. More...
 
FColor GetVertexColor (int32 Index) const
 Get the color for a vertex. More...
 
void SetLightmapSourceUVChannel (int32 Channel)
 Sets the UV channel that will be used as the source UVs for lightmap UVs generation at import, defaults to channel 0. More...
 
int32 GetLightmapSourceUVChannel () const
 Gets the UV channel that will be used for lightmap UVs generation at import. More...
 
void AddLOD (const FDatasmithMesh &InLODMesh)
 Adds a LOD mesh to this base LOD mesh. More...
 
void AddLOD (FDatasmithMesh &&InLODMesh)
 
int32 GetLODsCount () const
 
FDatasmithMesh & GetLOD (int32 Index)
 
const FDatasmithMesh & GetLOD (int32 Index) const
 
float ComputeArea () const
 Returns the total surface area. More...
 
FBox GetExtents () const
 Returns the bounding box containing all vertices of this mesh. More...
 

Detailed Description

Member Function Documentation

◆ AddLOD()

void FDatasmithMesh::AddLOD ( const FDatasmithMesh &  InLODMesh)

Adds a LOD mesh to this base LOD mesh.

Examples
DatasmithExportBasicSample.cpp.

◆ AddUVChannel()

void FDatasmithMesh::AddUVChannel ( )

Add a UV channel at the end.

◆ ComputeArea()

float FDatasmithMesh::ComputeArea ( ) const

Returns the total surface area.

◆ GetExtents()

FBox FDatasmithMesh::GetExtents ( ) const

Returns the bounding box containing all vertices of this mesh.

◆ GetFacesCount()

int32 FDatasmithMesh::GetFacesCount ( ) const

Retrieves the amount of faces.

◆ GetFaceSmoothingMask()

uint32 FDatasmithMesh::GetFaceSmoothingMask ( int32  Index) const

Gets the smoothing mask of a face.

Parameters
IndexIndex of the face to retrieve the smoothing mask from

◆ GetFaceUV()

void FDatasmithMesh::GetFaceUV ( int32  Index,
int32  Channel,
int32 &  Vertex1,
int32 &  Vertex2,
int32 &  Vertex3 
) const

Gets the UV coordinates of the vertices of a face.

Parameters
IndexIndex of the face to retrieve the UVs from
ChannelUV channel, starting at 0
Vertex1Index of the first uv vertex that defines this face
Vertex2Index of the second uv vertex that defines this face
Vertex3Index of the third uv vertex that defines this face

◆ GetHashForUVChannel()

uint32 FDatasmithMesh::GetHashForUVChannel ( int32  Channel) const

Get the hash for a uv channel.

◆ GetLightmapSourceUVChannel()

int32 FDatasmithMesh::GetLightmapSourceUVChannel ( ) const

Gets the UV channel that will be used for lightmap UVs generation at import.

◆ GetUV()

FVector2D FDatasmithMesh::GetUV ( int32  Channel,
int32  Index 
) const

Gets the UV coordinates for a channel.

Parameters
ChannelThe channel we want to retrieve the UVs from
IndexThe UV coordinates to retrieve

◆ GetUVChannelsCount()

int32 FDatasmithMesh::GetUVChannelsCount ( ) const

Gets the amount of UV channels on this mesh.

◆ GetUVCount()

int32 FDatasmithMesh::GetUVCount ( int32  Channel) const

Retrieves the amount of UV coordinates on the channel.

The validity of the vertex data is not guaranteed

◆ GetVertexColor()

FColor FDatasmithMesh::GetVertexColor ( int32  Index) const

Get the color for a vertex.

Parameters
IndexIndex of the vertex color to retrieve

◆ GetVertexColorCount()

int32 FDatasmithMesh::GetVertexColorCount ( ) const

Get the number of vertex color.

◆ GetVerticesCount()

int32 FDatasmithMesh::GetVerticesCount ( ) const

Retrieves the amount of geometric vertices.

The validity of the vertex data is not guaranteed

◆ RemoveUVChannel()

void FDatasmithMesh::RemoveUVChannel ( )

Remove the last UV channel.

◆ SetFace()

void FDatasmithMesh::SetFace ( int32  Index,
int32  Vertex1,
int32  Vertex2,
int32  Vertex3,
int32  MaterialId = 0 
)

Sets the geometry of the face.

Parameters
Indexvalue to choose the face that will be affected
Vertex1Index of the first geometric vertex that defines this face
Vertex2Index of the second geometric vertex that defines this face
Vertex3Index of the third geometric vertex that defines this face
Examples
DatasmithExportHelper.cpp.

◆ SetFacesCount()

void FDatasmithMesh::SetFacesCount ( int32  NumFaces)

Setting the amount of faces is mandatory before filling the array.

Examples
DatasmithExportHelper.cpp.

◆ SetFaceSmoothingMask()

void FDatasmithMesh::SetFaceSmoothingMask ( int32  Index,
uint32  SmoothingMask 
)

Sets the smoothing mask of the face.

Parameters
IndexIndex of the face that will be affected
SmoothingMask32 bits mask, 0 means no smoothing

◆ SetFaceUV()

void FDatasmithMesh::SetFaceUV ( int32  Index,
int32  Channel,
int32  Vertex1,
int32  Vertex2,
int32  Vertex3 
)

Sets the channel UV coordinates of the face.

Parameters
IndexIndex of the face that will be affected
ChannelUV channel, starting at 0
Vertex1Index of the first uv vertex that defines this face
Vertex2Index of the second uv vertex that defines this face
Vertex3Index of the third uv vertex that defines this face
Examples
DatasmithExportHelper.cpp.

◆ SetLightmapSourceUVChannel()

void FDatasmithMesh::SetLightmapSourceUVChannel ( int32  Channel)

Sets the UV channel that will be used as the source UVs for lightmap UVs generation at import, defaults to channel 0.

Will be overwritten during Mesh export if we choose to generate the lightmap source UVs.

◆ SetNormal()

void FDatasmithMesh::SetNormal ( int32  Index,
float  X,
float  Y,
float  Z 
)

Sets the 3d normal.

Parameters
Indexvalue to choose the normal that will be affected @x direction on the x axis @y direction on the y axis @z direction on the z axis
Examples
DatasmithExportHelper.cpp.

◆ SetUV()

void FDatasmithMesh::SetUV ( int32  Channel,
int32  Index,
double  U,
double  V 
)

Sets the 2d position of the UV vertex for the first uv mapping.

Parameters
IndexValue to choose the vertex that will be affected
UHorizontal coordinate
VVertical coordinate
Examples
DatasmithExportHelper.cpp.

◆ SetUVChannelsCount()

void FDatasmithMesh::SetUVChannelsCount ( int32  ChannelCount)

Sets the amount of UV channels on this mesh.

Parameters
ChannelCountThe number of UV channels

◆ SetUVCount()

void FDatasmithMesh::SetUVCount ( int32  Channel,
int32  NumVerts 
)

Setting the amount of UV coordinates on the channel is mandatory before filling the array.

Parameters
ChannelThe channel to set the numbers of UVs
NumVertsThe number of UVs in the channel
Examples
DatasmithExportHelper.cpp.

◆ SetVertex()

void FDatasmithMesh::SetVertex ( int32  Index,
float  X,
float  Y,
float  Z 
)

Sets the 3d position of the vertex.

Parameters
Indexvalue to choose the vertex that will be affected @x position on the x axis @y position on the y axis @z position on the z axis
Examples
DatasmithExportHelper.cpp.

◆ SetVertexColor()

void FDatasmithMesh::SetVertexColor ( int32  Index,
const FColor &  Color 
)

Set a vertex color.

Parameters
IndexIndex of the vertex color that will be affected
ColorThe color for the vertex

◆ SetVerticesCount()

void FDatasmithMesh::SetVerticesCount ( int32  NumVerts)

Setting the amount of geometric vertices is mandatory before filling the array.

Examples
DatasmithExportHelper.cpp.

The documentation for this class was generated from the following file: