This is the documentation for Enlighten.
class Enlighten IPrecompInputMesh
class Enlighten::IPrecompInputMesh
└>Geo::IGeoSerialisable
└>Geo::IGeoReleasable
The standard precompute mesh input class.
Functions
Name | Description |
---|---|
AddFaces(const PrecompInputFace *, const PrecompInputFace *) | Copies all faces between [begin, end) into this object. |
AddLinks(const Geo::IdxLink *, const Geo::IdxLink *) | Copies all index links between [begin, end) into this object. |
AddLinksForIdenticalVertices(bool, bool, bool, bool) | Utility to generate links between identical vertices. |
AddMaterialGuidMapping(Geo::GeoGuid, Geo::u32) | Add an explicit mapping from 128-bit material GUID to 32-bit material ID. |
AddVertices(const PrecompInputVertex *, const PrecompInputVertex *) | Copies all vertices between [begin, end) into this object. |
CalculateSurfaceArea() | Returns the world-space surface area of the mesh. |
Clone() | Create a deep copy of this mesh. |
Create() | Create a new empty IPrecompInputMesh. |
GetFaceArray() | Read-only access to the faces. |
GetFaceArray() | Modification access to the faces. |
GetFaceVertexIndicesView() | Return a view of the vertex indices of each face. |
GetLinkArray() | Modification access to the link array. |
GetLinkArray() | Read-only access to the link array. |
GetMaterialGuidMappingsArray() | Read-only access to the material GUID to 32-bit material ID mapping array. |
GetNumFaces() | How many faces in this mesh. |
GetNumLinks() | How many links are in this mesh. |
GetNumMaterialGuidMappings() | Gets the number of material GUID to 32-bit material ID mappings, as added by AddMaterialGuidMapping. |
GetNumVertices() | How many vertices in this mesh. |
GetVertexArray() | Read-only access to the vertices. |
GetVertexArray() | Modification access to the vertices. |
GetVertexPositionsView() | Return a view of the positions of each vertex. |
Load(IGeoInputStream &, Geo::u32) | Load an instance of this class from an IGeoInputStream. |
NonCopyable(NonCopyable &&) | Defaulted to allow move. |
operator=(NonCopyable &&) | Defaulted to allow move. |
Release() | Free this object that was created within the Enlighten libraries. |
Save(IGeoStream &, Geo::u32) | Save an instance of this class to an IGeoStream. |
virtual bool Enlighten::IPrecompInputMesh::AddFaces
public: bool AddFaces
(
const PrecompInputFace * begin,
const PrecompInputFace * end
)
Copies all faces between [begin, end) into this object.
Parameters
[in] | begin | A pointer to the first element to be added |
[in] | end | A pointer to an element one past the last entity (as standard STL syntax) |
Returns
True if operation succeeded, false if there was not enough memory to satisfy request
virtual bool Enlighten::IPrecompInputMesh::AddLinks
public: bool AddLinks
(
const Geo::IdxLink * begin,
const Geo::IdxLink * end
)
Copies all index links between [begin, end) into this object.
An IdxLink is a pair of vertex indices that denote that the two vertices should be considered to be part of the same group. By default Enlighten will treat triangles that share vertices as being in the same "triangle group" and treat as an item. Triangles that do not share vertices will be processed independently. IdxLinks allow you to add additional constraints to this. Please see the technical SDK documentation for further details and examples of this.
Parameters
[in] | begin | A pointer to the first element to be added |
[in] | end | A pointer to an element one past the last entity (as standard STL syntax) |
Returns
True if operation succeeded, false if there was not enough memory to satisfy request
virtual bool Enlighten::IPrecompInputMesh::AddLinksForIdenticalVertices
public: bool AddLinksForIdenticalVertices
(
bool comparePositions,
bool compareNormals,
bool compareChartUvs,
bool compareAlbedoUvs
)
Utility to generate links between identical vertices.
This will append the link array with a set of links that link together bitwise identical vertices into the same tri group. The four boolean parameters control which elements of the vertices should be considered during the comparison. For example, if you have authored your chart UV and want to ensure that each authored chart becomes a tri group you should set compareChartUvs to true and all others to false so only comparisons of UV locations effects the joining.
All comparisons are bit-wise comparisons, and the generated links are appended onto any links that have already been added.
Note
The behaviour of this system before links were exposed in the API was to compare on positions, normals and chart uvs but not albedo uvs. Setting this combination of bools will produce the same behaviour as previous versions.
virtual bool Enlighten::IPrecompInputMesh::AddMaterialGuidMapping
public: bool AddMaterialGuidMapping
(
Geo::GeoGuid guid,
Geo::u32 materialId
)
Add an explicit mapping from 128-bit material GUID to 32-bit material ID.
The 32-bit material ID can then be set on a PrecompInputFace.m_AlbedoId and the material properties set at precompute time using the corresponding GUID.
Parameters
[in] | guid | A 128-bit GUID |
[in] | materialId | A 32-bit material ID |
Returns
True if mapping successfully added (or if the mapping already existed), false if the mapping could not be added as it would conflict with an existing mapping.
virtual bool Enlighten::IPrecompInputMesh::AddVertices
public: bool AddVertices
(
const PrecompInputVertex * begin,
const PrecompInputVertex * end
)
Copies all vertices between [begin, end) into this object.
Parameters
[in] | begin | A pointer to the first element to be added |
[in] | end | A pointer to an element one past the last entity (as standard STL syntax) |
Returns
True if operation succeeded, false if there was not enough memory to satisfy request
virtual float Enlighten::IPrecompInputMesh::CalculateSurfaceArea
public: float CalculateSurfaceArea() const
Returns the world-space surface area of the mesh.
virtual IPrecompInputMesh* Enlighten::IPrecompInputMesh::Clone
public: IPrecompInputMesh * Clone() const
Create a deep copy of this mesh.
static IPrecompInputMesh* Enlighten::IPrecompInputMesh::Create
public: IPrecompInputMesh * Create()
Create a new empty IPrecompInputMesh.
virtual const PrecompInputFace* Enlighten::IPrecompInputMesh::GetFaceArray
public: const PrecompInputFace * GetFaceArray() const
Read-only access to the faces.
virtual PrecompInputFace* Enlighten::IPrecompInputMesh::GetFaceArray
public: PrecompInputFace * GetFaceArray()
Modification access to the faces.
Geo::StridedArrayView<PrecompIndex3> Enlighten::IPrecompInputMesh::GetFaceVertexIndicesView
public: Geo::StridedArrayView< PrecompIndex3 > GetFaceVertexIndicesView() const
Return a view of the vertex indices of each face.
virtual Geo::IdxLink* Enlighten::IPrecompInputMesh::GetLinkArray
public: Geo::IdxLink * GetLinkArray()
Modification access to the link array.
virtual const Geo::IdxLink* Enlighten::IPrecompInputMesh::GetLinkArray
public: const Geo::IdxLink * GetLinkArray() const
Read-only access to the link array.
virtual const MaterialGuidMapping* Enlighten::IPrecompInputMesh::GetMaterialGuidMappingsArray
public: const MaterialGuidMapping * GetMaterialGuidMappingsArray() const
Read-only access to the material GUID to 32-bit material ID mapping array.
virtual Geo::s32 Enlighten::IPrecompInputMesh::GetNumFaces
public: Geo::s32 GetNumFaces() const
How many faces in this mesh.
virtual Geo::s32 Enlighten::IPrecompInputMesh::GetNumLinks
public: Geo::s32 GetNumLinks() const
How many links are in this mesh.
virtual Geo::s32 Enlighten::IPrecompInputMesh::GetNumMaterialGuidMappings
public: Geo::s32 GetNumMaterialGuidMappings() const
Gets the number of material GUID to 32-bit material ID mappings, as added by AddMaterialGuidMapping.
virtual Geo::s32 Enlighten::IPrecompInputMesh::GetNumVertices
public: Geo::s32 GetNumVertices() const
How many vertices in this mesh.
virtual const PrecompInputVertex* Enlighten::IPrecompInputMesh::GetVertexArray
public: const PrecompInputVertex * GetVertexArray() const
Read-only access to the vertices.
virtual PrecompInputVertex* Enlighten::IPrecompInputMesh::GetVertexArray
public: PrecompInputVertex * GetVertexArray()
Modification access to the vertices.
Geo::StridedArrayView<Geo::GeoPoint3> Enlighten::IPrecompInputMesh::GetVertexPositionsView
public: Geo::StridedArrayView< Geo::GeoPoint3 > GetVertexPositionsView() const
Return a view of the positions of each vertex.
virtual bool Geo::IGeoSerialisable::Load
public: bool Load
(
IGeoInputStream & stream,
Geo::u32 section
)
Load an instance of this class from an IGeoInputStream.
The stream must be ready to read from. You can load sections of an object by passing a bitmask representing the desired sections rather than Iff::AllSectionsMask, which will load all sections. It is also safe to call this method on an object multiple times with different section arguments to load multiple parts.
Geo::NonCopyable::NonCopyable
public: NonCopyable
(
NonCopyable &&
)
Defaulted to allow move.
NonCopyable& Geo::NonCopyable::operator=
public: NonCopyable & operator=
(
NonCopyable &&
)
Defaulted to allow move.
virtual void Geo::IGeoReleasable::Release
public: void Release()
Free this object that was created within the Enlighten libraries.
Expect this to behave in a similar way to calling 'delete(this)'
virtual bool Geo::IGeoSerialisable::Save
public: bool Save
(
IGeoStream & stream,
Geo::u32 section
) const
Save an instance of this class to an IGeoStream.
The stream must be ready to write to. You can save sections of an object by passing a bitmask representing the desired sections rather than Iff::AllSectionsMask, which will save all sections that are available.