29#ifndef GU_ADJACENCIES_H
30#define GU_ADJACENCIES_H
32#define MSH_ADJACENCIES_INCLUDE_CONVEX_BITS
33#include "foundation/Px.h"
34#include "GuTriangle.h"
35#include "common/PxPhysXCommonConfig.h"
41#ifdef MSH_ADJACENCIES_INCLUDE_CONVEX_BITS
42 #define ADJ_TRIREF_MASK 0x1fffffff
43 #define IS_CONVEX_EDGE(x) (x & 0x20000000)
45 #define ADJ_TRIREF_MASK 0x3fffffff
48 #define MAKE_ADJ_TRI(x) (x & ADJ_TRIREF_MASK)
49 #define GET_EDGE_NB(x) (x>>30)
51 #define IS_BOUNDARY(x) ((x & ADJ_TRIREF_MASK)==ADJ_TRIREF_MASK)
83 #define SET_EDGE_NB(link, code) \
84 link&=ADJ_TRIREF_MASK; \
89#ifdef MSH_ADJACENCIES_INCLUDE_TOPOLOGY
90 :
public IndexedTriangle
119 bool HasNeighbor(PxU32 tref, PxU32* index=NULL)
const;
127 PX_INLINE PxU32 GetLink(SharedEdgeIndex edge_index)
const {
return mATri[edge_index]; }
128 PX_INLINE PxU32 GetAdjTri(SharedEdgeIndex edge_index)
const {
return MAKE_ADJ_TRI(
mATri[edge_index]); }
129 PX_INLINE PxU32 GetAdjEdge(SharedEdgeIndex edge_index)
const {
return GET_EDGE_NB(
mATri[edge_index]); }
130 PX_INLINE PxIntBool IsBoundaryEdge(SharedEdgeIndex edge_index)
const {
return IS_BOUNDARY(
mATri[edge_index]); }
131#ifdef MSH_ADJACENCIES_INCLUDE_CONVEX_BITS
132 PX_INLINE PxIntBool HasActiveEdge01()
const {
return PxIntBool(IS_CONVEX_EDGE(
mATri[EDGE01])); }
133 PX_INLINE PxIntBool HasActiveEdge20()
const {
return PxIntBool(IS_CONVEX_EDGE(
mATri[EDGE02])); }
134 PX_INLINE PxIntBool HasActiveEdge12()
const {
return PxIntBool(IS_CONVEX_EDGE(
mATri[EDGE12])); }
135 PX_INLINE PxIntBool HasActiveEdge(PxU32 i)
const {
return PxIntBool(IS_CONVEX_EDGE(
mATri[i])); }
151#ifdef MSH_ADJACENCIES_INCLUDE_CONVEX_BITS
161#ifdef MSH_ADJACENCIES_INCLUDE_CONVEX_BITS
183 PxU32 Link = current_tri.GetLink(edge_nb);
186 if(IS_BOUNDARY(Link))
return NULL;
189 PxU32 Id = MAKE_ADJ_TRI(Link);
199#ifdef MSH_ADJACENCIES_INCLUDE_TOPOLOGY
205#ifdef MSH_ADJACENCIES_INCLUDE_TOPOLOGY
212 void AssignNewEdgeCode(PxU32 link, PxU8 edge_nb);
A triangle class used to compute the adjacency structures.
Definition GuAdjacencies.h:94
PxU32 ComputeNbBoundaryEdges() const
Definition GuAdjacencies.cpp:65
PxU32 ComputeNbNeighbors() const
Definition GuAdjacencies.cpp:79
PX_INLINE ~AdjTriangle()
Destructor.
Definition GuAdjacencies.h:99
bool HasNeighbor(PxU32 tref, PxU32 *index=NULL) const
Definition GuAdjacencies.cpp:94
void Flip()
Definition GuAdjacencies.cpp:50
PxU32 mATri[3]
Definition GuAdjacencies.h:142
PX_INLINE AdjTriangle()
Constructor.
Definition GuAdjacencies.h:97
Definition GuAdjacencies.h:217
bool Init(const ADJACENCIESCREATE &create)
Definition GuAdjacencies.cpp:568
Definition GuAdjacencies.h:168
PxU32 mNbFaces
Number of faces involved in the computation.
Definition GuAdjacencies.h:173
PxU32 ComputeNbBoundaryEdges() const
Definition GuAdjacencies.cpp:116
bool MakeLastRef(AdjTriangle &cur_tri, PxU32 vref, IndexedTriangle32 *cur_topo)
Definition GuAdjacencies.cpp:227
AdjTriangle * mFaces
A list of AdjTriangles (one/face)
Definition GuAdjacencies.h:174
bool GetBoundaryVertices(PxU32 nb_verts, bool *bound_status, const IndexedTriangle32 *faces) const
Definition GuAdjacencies.cpp:140
Definition PxUserAllocated.h:43
3 Element vector class.
Definition PxVec3.h:50
#define PX_INLINE
Definition PxPreprocessor.h:320
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
The adjacencies creation structure.
Definition GuAdjacencies.h:147
PxU32 NbFaces
Number of faces in source topo.
Definition GuAdjacencies.h:158
ADJACENCIESCREATE()
Constructor.
Definition GuAdjacencies.h:149
const PxU16 * WFaces
List of faces (words) or NULL.
Definition GuAdjacencies.h:160
const PxU32 * DFaces
List of faces (dwords) or NULL.
Definition GuAdjacencies.h:159
Definition GuTriangle.h:48