Ejemplo n.º 1
0
            private static PhysicsShape CreatePhysicsShapeFromTrimeshAndCache(MeshingStage meshingStage, ulong meshHash, PhysX.TriangleMeshGeometry triMesh)
            {
                PhysicsShape phyShape;

                phyShape = new PhysicsShape(triMesh, ShapeType.TriMesh, meshHash);
                phyShape.AddRef();

                //complex shapes are cached
                meshingStage.CacheShape(meshHash, phyShape, ShapeType.TriMesh);
                return(phyShape);
            }
Ejemplo n.º 2
0
            private static PhysicsShape CreatePhysicsShapeFromConvexSetAndCache(MeshingStage meshingStage, ulong meshHash, List <PhysX.ConvexMeshGeometry> convexes)
            {
                PhysicsShape phyShape;

                phyShape            = new PhysicsShape(convexes, meshHash);
                phyShape.Complexity = convexes.Count;
                phyShape.AddRef();

                //complex shapes are cached
                meshingStage.CacheShape(meshHash, phyShape, ShapeType.DecomposedConvexHulls);
                return(phyShape);
            }
Ejemplo n.º 3
0
            private static PhysicsShape CreatePhysicsShapeFromSingleConvexAndCache(MeshingStage meshingStage, ulong meshHash, PhysX.ConvexMeshGeometry convex)
            {
                PhysicsShape phyShape;

                phyShape = new PhysicsShape(new List <PhysX.ConvexMeshGeometry> {
                    convex
                }, meshHash, true);
                phyShape.AddRef();

                //complex shapes are cached
                meshingStage.CacheShape(meshHash, phyShape, ShapeType.SingleConvex);
                return(phyShape);
            }
Ejemplo n.º 4
0
            private static PhysicsShape CreatePhysicsShapeFromConvexSetAndCache(MeshingStage meshingStage, ulong meshHash, List<PhysX.ConvexMeshGeometry> convexes)
            {
                PhysicsShape phyShape;
                phyShape = new PhysicsShape(convexes, meshHash);
                phyShape.Complexity = convexes.Count;
                phyShape.AddRef();

                //complex shapes are cached
                meshingStage.CacheShape(meshHash, phyShape, ShapeType.DecomposedConvexHulls);
                return phyShape;
            }
Ejemplo n.º 5
0
            private static PhysicsShape CreatePhysicsShapeFromTrimeshAndCache(MeshingStage meshingStage, ulong meshHash, PhysX.TriangleMeshGeometry triMesh)
            {
                PhysicsShape phyShape;
                phyShape = new PhysicsShape(triMesh, ShapeType.TriMesh, meshHash);
                phyShape.AddRef();

                //complex shapes are cached
                meshingStage.CacheShape(meshHash, phyShape, ShapeType.TriMesh);
                return phyShape;
            }
Ejemplo n.º 6
0
            private static PhysicsShape CreatePhysicsShapeFromSingleConvexAndCache(MeshingStage meshingStage, ulong meshHash, PhysX.ConvexMeshGeometry convex)
            {
                PhysicsShape phyShape;
                phyShape = new PhysicsShape(new List<PhysX.ConvexMeshGeometry> { convex }, meshHash, true);
                phyShape.AddRef();

                //complex shapes are cached
                meshingStage.CacheShape(meshHash, phyShape, ShapeType.SingleConvex);
                return phyShape;
            }