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.
It intentionally doesn't handle "empty" geometry (no verts or indices or both). This case should be handled upstream. |
Name | Description |
---|---|
~MergeGeometry() | Free all resources. |
BuildMergeGeometryCache() | Build cache data. |
CacheGetBoxForGroup(Geo::s32) | Access the cache data. |
CacheGetNumGroups() | Access the cache data. |
CacheGetNumUniqueVertsInGroup(Geo::s32) | Access the cache data. |
CacheGetOptimalModelForGroup(Geo::s32) | Access the cache data. |
CacheGetPrincipleNormalForGroup(Geo::s32) | Access the cache data. |
CacheGetUniqueVertIndicesInGroup(Geo::s32) | Access the cache data. |
CacheGetWorldSurfaceAreaForGroup(Geo::s32) | Access the cache data. |
CacheSetFlagsOnGroup(Geo::s32, Geo::u32) | Access the cache data. |
CacheTestFlagsOnGroup(Geo::s32, Geo::u32) | Access the cache data. |
CalculateProjectedArea(const Geo::s32 *, Geo::s32, FitModel const &) | calculate the total projected area of the passed in groups |
ClearUp() | Free all memory and reset the class to it's initial state. |
ClearUpGeometry() | Free just the vertex and index buffer data. |
ClearUpTriGroupsAndParams() | Free just the tri groups and param data. |
ComputeGroupMaxDistance(Geo::s32, const FitModel &, float) | Given a vector of points, this computes the least-squares plane. |
ComputeModel(Geo::s32, Geo::s32, FitModel &) | Given a vector of points, this computes the least-squares plane. |
ComputeModel(Geo::s32, FitModel &) | Given a vector of points, this computes the least-squares plane. |
ComputeTriNormal(Geo::s32, Geo::s32, Geo::s32) | Get a single representative normal for a triangle in a MergeGeometry. |
FitPlaneToGroups(const Geo::s32 *, Geo::s32, FitModel &) | Given a vector of points, this computes the least-squares plane. |
GetMaxGeneralNormalDeviationCosForGroupIdx(Geo::s32) | access per group data |
GetMaxInitialNormalDeviationCosForGroupIdx(Geo::s32) | access per group data |
GetMaxPlaneDistanceForGroupIdx(Geo::s32) | access per group data |
GetOverlapExpansionPercForGroupIdx(Geo::s32) | access per group data |
GetSignificantAreaRatioForGroupIdx(Geo::s32) | access per group data |
GetTriPoints(Geo::s32, Geo::GeoPoint3 &, Geo::GeoPoint3 &, Geo::GeoPoint3 &) | Utility function that is used when computing triangle shrinkage. |
InitialiseGeometry(Geo::s32, Geo::s32) | Initialise the vertex and index buffers to the given sizes. |
InitialiseTriGroupsAndParams(Geo::TriGroupSelection *, Geo::s32) | Takes ownership (not a copy) of the tri group selection and creates the trigroup and param arrays. |
IsCacheValid() | Checks if the cache is valid. |
MergeGeometry() | Just nulls everything. |
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. |
public: ~MergeGeometry()
Free all resources.
public: bool BuildMergeGeometryCache()
Build cache data.
public: Geo::GeoBoundingBox CacheGetBoxForGroup
(
Geo::s32 groupIdx
) const
Access the cache data.
public: Geo::s32 CacheGetNumGroups() const
Access the cache data.
public: Geo::s32 CacheGetNumUniqueVertsInGroup
(
Geo::s32 groupIdx
) const
Access the cache data.
public: FitModel CacheGetOptimalModelForGroup
(
Geo::s32 groupIdx
) const
Access the cache data.
public: Geo::v128 CacheGetPrincipleNormalForGroup
(
Geo::s32 groupIdx
) const
Access the cache data.
public: const Geo::s32 * CacheGetUniqueVertIndicesInGroup
(
Geo::s32 groupIdx
) const
Access the cache data.
public: double CacheGetWorldSurfaceAreaForGroup
(
Geo::s32 groupIdx
) const
Access the cache data.
public: void CacheSetFlagsOnGroup
(
Geo::s32 groupIdx,
Geo::u32 flags
)
Access the cache data.
public: bool CacheTestFlagsOnGroup
(
Geo::s32 groupIdx,
Geo::u32 flags
) const
Access the cache data.
public: float CalculateProjectedArea
(
const Geo::s32 * groupIndices,
Geo::s32 numGroups,
FitModel const & model
) const
calculate the total projected area of the passed in groups
public: void ClearUp()
Free all memory and reset the class to it's initial state.
public: void ClearUpGeometry()
Free just the vertex and index buffer data.
public: void ClearUpTriGroupsAndParams()
Free just the tri groups and param data.
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.
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.
public: void ComputeModel
(
Geo::s32 groupIdx,
FitModel & model
) const
The idea is that we want an optimal plane for the given combined groups.
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.
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.
public: float GetMaxGeneralNormalDeviationCosForGroupIdx
(
Geo::s32 groupIdx
) const
access per group data
public: float GetMaxInitialNormalDeviationCosForGroupIdx
(
Geo::s32 groupIdx
) const
access per group data
public: float GetMaxPlaneDistanceForGroupIdx
(
Geo::s32 groupIdx
) const
access per group data
public: float GetOverlapExpansionPercForGroupIdx
(
Geo::s32 groupIdx
) const
access per group data
public: float GetSignificantAreaRatioForGroupIdx
(
Geo::s32 groupIdx
) const
access per group data
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.
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.
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.
public: bool IsCacheValid() const
Checks if the cache is valid.
public: MergeGeometry()
Just nulls everything.