class Enlighten::MergeGeometry
This is the very basic geometry description we operate on.
It's function is to provide a basic wrapper around simple arrays which is will release/delete with itself. You can construct it how you like, but there's some utils to allocate/delete arrays for you. The data is create/freeable in two halfs, geometry related stuff and tri-group/param related stuff.
Note | ||
---|---|---|
| ||
It intentionally doesn't handle "empty" geometry (no verts or indices or both). This case should be handled upstream. |
Functions
Variables
Name | Description |
---|---|
Geo::s32 * m_IdxBuffer32 | Vertex indices. Length assume to be a multiple of 3. |
Geo::GeoFileString m_Name | Name of the geometry that was used to create this MergeGeometry. |
Geo::s32 m_NumIndices | Length of m_IdxBuffer32. |
Geo::s32 m_NumParams | Length of the m_TriGroupParams array. |
Geo::s32 m_NumVertices | Length of m_Vert* arrays. |
Geo::s32 * m_ParamIdxFromGroupIdx | Maps tri group indices to param indices. Length of num tri groups. |
MergeTriGroupParams * m_TriGroupParams | Array of params for specific tri groups. |
Geo::TriGroupSelection * m_TriGroupSelection | The tri groups for this geometry. |
Geo::GeoPoint2 * m_VertChartUVs | Vertex chart UVs (provided, not generated). Length of m_NumVertices. |
Geo::v128 * m_VertNormals | Vertex normals. Length of m_NumVertices. |
Geo::v128 * m_VertPositions | Vertex positions. Length of m_NumVertices. |
Anchor | ||||
---|---|---|---|---|
|
Enlighten::MergeGeometry::~MergeGeometry
...
public: ~MergeGeometry()
...
Free all resources.
Anchor | ||||
---|---|---|---|---|
|
bool Enlighten::MergeGeometry::BuildMergeGeometryCache
...
public: bool BuildMergeGeometryCache()
...
Build cache data.
Anchor | ||||
---|---|---|---|---|
|
Geo::GeoBoundingBox Enlighten::MergeGeometry::CacheGetBoxForGroup
...
public: Geo::GeoBoundingBox CacheGetBoxForGroup
(
Geo::s32 groupIdx
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
Geo::s32 Enlighten::MergeGeometry::CacheGetNumGroups
...
public: Geo::s32 CacheGetNumGroups() const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
Geo::s32 Enlighten::MergeGeometry::CacheGetNumUniqueVertsInGroup
...
public: Geo::s32 CacheGetNumUniqueVertsInGroup
(
Geo::s32 groupIdx
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
FitModel Enlighten::MergeGeometry::CacheGetOptimalModelForGroup
...
public: FitModel CacheGetOptimalModelForGroup
(
Geo::s32 groupIdx
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
Geo::v128 Enlighten::MergeGeometry::CacheGetPrincipleNormalForGroup
...
public: Geo::v128 CacheGetPrincipleNormalForGroup
(
Geo::s32 groupIdx
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
const Geo::s32* Enlighten::MergeGeometry::CacheGetUniqueVertIndicesInGroup
...
public: const Geo::s32 * CacheGetUniqueVertIndicesInGroup
(
Geo::s32 groupIdx
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
double Enlighten::MergeGeometry::CacheGetWorldSurfaceAreaForGroup
...
public: double CacheGetWorldSurfaceAreaForGroup
(
Geo::s32 groupIdx
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::CacheSetFlagsOnGroup
...
public: void CacheSetFlagsOnGroup
(
Geo::s32 groupIdx,
Geo::u32 flags
)
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
bool Enlighten::MergeGeometry::CacheTestFlagsOnGroup
...
public: bool CacheTestFlagsOnGroup
(
Geo::s32 groupIdx,
Geo::u32 flags
) const
...
Access the cache data.
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::CalculateProjectedArea
...
public: float CalculateProjectedArea
(
const Geo::s32 * groupIndices,
Geo::s32 numGroups,
FitModel const & model
) const
...
calculate the total projected area of the passed in groups
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::ClearUp
...
public: void ClearUp()
...
Free all memory and reset the class to it's initial state.
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::ClearUpGeometry
...
public: void ClearUpGeometry()
...
Free just the vertex and index buffer data.
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::ClearUpTriGroupsAndParams
...
public: void ClearUpTriGroupsAndParams()
...
Free just the tri groups and param data.
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::ComputeGroupMaxDistance
...
public: float ComputeGroupMaxDistance
(
Geo::s32 groupIdx,
const FitModel & model,
float distanceThreshold
) const
...
...
The idea is that we want an optimal plane for the given combined groups.
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::ComputeModel
...
public: void ComputeModel
(
Geo::s32 groupIdx0,
Geo::s32 groupIdx1,
FitModel & model
) const
...
...
The idea is that we want an optimal plane for the given combined groups.
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::ComputeModel
...
public: void ComputeModel
(
Geo::s32 groupIdx,
FitModel & model
) const
...
...
The idea is that we want an optimal plane for the given combined groups.
Anchor | ||||
---|---|---|---|---|
|
Geo::v128 Enlighten::MergeGeometry::ComputeTriNormal
...
public: Geo::v128 ComputeTriNormal
(
Geo::s32 vertIdx0,
Geo::s32 vertIdx1,
Geo::s32 vertIdx2
) const
...
Get a single representative normal for a triangle in a MergeGeometry.
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::FitPlaneToGroups
...
public: void FitPlaneToGroups
(
const Geo::s32 * groupIndices,
Geo::s32 numGroups,
FitModel & model
) const
...
...
The idea is that we want an optimal plane for the given combined groups.
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::GetMaxGeneralNormalDeviationCosForGroupIdx
...
public: float GetMaxGeneralNormalDeviationCosForGroupIdx
(
Geo::s32 groupIdx
) const
...
access per group data
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::GetMaxInitialNormalDeviationCosForGroupIdx
...
public: float GetMaxInitialNormalDeviationCosForGroupIdx
(
Geo::s32 groupIdx
) const
...
access per group data
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::GetMaxPlaneDistanceForGroupIdx
...
public: float GetMaxPlaneDistanceForGroupIdx
(
Geo::s32 groupIdx
) const
...
access per group data
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::GetOverlapExpansionPercForGroupIdx
...
public: float GetOverlapExpansionPercForGroupIdx
(
Geo::s32 groupIdx
) const
...
access per group data
Anchor | ||||
---|---|---|---|---|
|
float Enlighten::MergeGeometry::GetSignificantAreaRatioForGroupIdx
...
public: float GetSignificantAreaRatioForGroupIdx
(
Geo::s32 groupIdx
) const
...
access per group data
Anchor | ||||
---|---|---|---|---|
|
void Enlighten::MergeGeometry::GetTriPoints
...
public: void GetTriPoints
(
Geo::s32 tri,
Geo::GeoPoint3 & p0,
Geo::GeoPoint3 & p1,
Geo::GeoPoint3 & p2
) const
...
Utility function that is used when computing triangle shrinkage.
Anchor | ||||
---|---|---|---|---|
|
bool Enlighten::MergeGeometry::InitialiseGeometry
...
public: bool InitialiseGeometry
(
Geo::s32 numVertices,
Geo::s32 numIndices
)
...
Initialise the vertex and index buffers to the given sizes.
This will clear any existing vertex and index buffer data first, but leaves all tri group and parameter data untouched.
The new buffers are initialised with -1 for indices and 0 for all other vertex data.
Anchor | ||||
---|---|---|---|---|
|
bool Enlighten::MergeGeometry::InitialiseTriGroupsAndParams
...
public: bool InitialiseTriGroupsAndParams
(
Geo::TriGroupSelection * triGroups,
Geo::s32 numParams
)
...
Takes ownership (not a copy) of the tri group selection and creates the trigroup and param arrays.
Parameters are left at their defaults, and the mapping is initialised to 0.
Anchor | ||||
---|---|---|---|---|
|
bool Enlighten::MergeGeometry::IsCacheValid
...
public: bool IsCacheValid() const
...
Checks if the cache is valid.
Anchor | ||||
---|---|---|---|---|
|
Enlighten::MergeGeometry::MergeGeometry
...
public: MergeGeometry()
...
Just nulls everything.