Example #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);
            }
Example #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);
            }
Example #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);
            }
Example #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;
            }
Example #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;
            }
Example #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;
            }