![]() cookConvexMesh ( convexDesc, buf )) return NULL maxVerts = 10 PxDefaultMemoryOutputStream buf if ( ! cooking. flags = PxConvexFlag :: eCOMPUTE_CONVEX convexDesc. Using PxConvexMeshGeometryFlag::eTIGHT_BOUNDS enables smaller/tighter bounds, which are more expensive to compute but could result in improved simulation performance when a lot of convex objects are interacting with each other. By default the system computes approximate (loose) bounds around convex objects. PxConvexMeshGeometry also contains flags to tweak some aspects of the convex object. ![]() Negative scale is not supported for convex meshes. The user can optionally provide a per-instance PxMeshScale in the PxConvexMeshGeometry. Providing PxConvexFlag::eFAST_INERTIA_COMPUTATION flag the volume integration will use SIMD code path which does faster computation but with lesser precision. Please note that mesh validation is required for debug and checked builds, as creating meshes from unvalidated input descriptors may result in undefined behavior. flags = PxConvexFlag :: eCOMPUTE_CONVEX | PxConvexFlag :: eDISABLE_MESH_VALIDATION | PxConvexFlag :: eFAST_INERTIA_COMPUTATION #ifdef _DEBUG // mesh should be validated before cooking without the mesh cleaning bool res = theCooking -> validateConvexMesh ( convexDesc ) PX_ASSERT ( res ) #endif PxConvexMesh * aConvexMesh = theCooking -> createConvexMesh ( convexDesc, thePhysics -> getPhysicsInsertionCallback ()) Each mesh (or height field) has a reference count that tracks the number of PxShapes whose geometries reference the mesh. It can be awkward in this case to retrieve the geometry without knowing its type, so PhysX provides a union-like wrapper class (PxGeometryHolder) that can be used to pass any geometry type by value. When passed into and out of the SDK for use as simulation geometry, the geometry is copied into and out of a PxShape class. The larger objects must be created using a cooking process, described for each type below. meshes or height fields (PxConvexMeshGeometry, PxTriangleMeshGeometry, PxHeightFieldGeometry), where the geometry object contains a pointer to a much larger object (PxConvexMesh, PxTriangleMesh, PxHeightField respectively) You can use these objects with different scales in each PxGeometry type which references them.primitives (PxBoxGeometry, PxSphereGeometry, PxCapsuleGeometry, PxPlaneGeometry) where the geometry object contains all of the data.For plane and capsule geometry types PhysX provides helper functions to construct these transforms from common alternative representations. A transform specifies the frame in which the geometry is interpreted. Each geometry class defines a volume or surface with a fixed position and orientation. Geometries are value types, and inherit from a common base class, PxGeometry. PhysX also provides standalone functions for testing intersection between geometries, raycasting against them, and sweeping one geometry against another. Geometries are used to build shapes for rigid bodies, as collision triggers, and as volumes in PhysX' scene query system. This section discusses the PhysX geometry classes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |