29#ifndef PHYSX_MESHGENERATOR_H
30#define PHYSX_MESHGENERATOR_H
32#include "PxPhysicsAPI.h"
33#include "extensions/PxRemeshingExt.h"
35namespace meshgenerator
72 for (PxU32 i = 0; i < numPointsOnRing; ++i)
74 PxReal
angle = i * 2.0f * 3.1415926535898f / numPointsOnRing;
80 for (PxU32 i = 0; i < numPointsOnRing; ++i)
89 for (PxU32 i = 0; i < triVerts.
size(); ++i)
91 PxVec3 dir = triVerts[i] - center;
93 triVerts[i] = center + radius * dir;
99 for (PxU32 i = 0; i < triVerts.
size(); ++i)
101 PxVec3 dir = triVerts[i] - center;
111 triVerts[i] = center + radius * dir;
119 createCube(triVerts, triIndices, center, radius);
120 projectPointsOntoSphere(triVerts, center, radius);
123 projectPointsOntoSphere(triVerts, center, radius);
125 projectPointsOntoBowl(triVerts, center, radius);
PX_FORCE_INLINE uint32_t size() const
Definition PxArray.h:242
PX_INLINE void clear()
Definition PxArray.h:250
PX_FORCE_INLINE T & pushBack(const T &a)
Definition PxArray.h:296
static bool limitMaxEdgeLength(PxArray< PxU32 > &triangles, PxArray< PxVec3 > &points, PxReal maxEdgeLength, PxU32 maxIterations=100, PxArray< PxU32 > *triangleMap=NULL, PxU32 triangleCountThreshold=0xFFFFFFFF)
Processes a triangle mesh and makes sure that no triangle edge is longer than the maximal edge length...
Definition ExtRemeshingExt.cpp:151
3 Element vector class.
Definition PxVec3.h:50
PX_CUDA_CALLABLE PX_FORCE_INLINE float normalize()
normalizes the vector in place
Definition PxVec3.h:300
GLM_FUNC_DECL T angle(qua< T, Q > const &x)
Definition quaternion_trigonometric.inl:6
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxCos(float a)
Cosine of an angle (Unit: Radians)
Definition PxMath.h:190
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxSin(float a)
trigonometry – all angles are in radians.
Definition PxMath.h:178