示例#1
0
        private PhysX.RigidStatic CreateGround(PhysX.Scene scene, PhysX.HeightFieldGeometry hfGeom)
        {
            var hfActor = scene.Physics.CreateRigidStatic();

            hfActor.CreateShape(hfGeom, material);

            hfActor.GlobalPose = PhysX.Math.Matrix.RotationYawPitchRoll(0f, (float)Math.PI / 2, 0f) * PhysX.Math.Matrix.Translation(0f, 256 - 1, 0f);

            return(hfActor);
            //return CreateTriangle(scene);
        }
示例#2
0
        private PhysX.HeightFieldGeometry CreateHfGeom(PhysX.Scene scene)
        {
            const int rows = 256, columns = 256;
            var       samples = CreateSampleGrid(rows, columns);

            var heightFieldDesc = new PhysX.HeightFieldDesc()
            {
                NumberOfRows    = rows,
                NumberOfColumns = columns,
                Samples         = samples
            };

            PhysX.HeightField heightField = scene.Physics.CreateHeightField(heightFieldDesc);

            PhysX.HeightFieldGeometry hfGeom = new PhysX.HeightFieldGeometry(heightField, 0, 1.0f, 1.0f, 1.0f);

            return(hfGeom);
        }
示例#3
0
文件: Form1.cs 项目: kf6kjg/halcyon
        private PhysX.HeightFieldGeometry CreateHfGeom(PhysX.Scene scene)
        {
            const int rows = 256, columns = 256;
            var samples = CreateSampleGrid(rows, columns);

            var heightFieldDesc = new PhysX.HeightFieldDesc()
            {
                NumberOfRows = rows,
                NumberOfColumns = columns,
                Samples = samples
            };

            PhysX.HeightField heightField = scene.Physics.CreateHeightField(heightFieldDesc);

            PhysX.HeightFieldGeometry hfGeom = new PhysX.HeightFieldGeometry(heightField, 0, 1.0f, 1.0f, 1.0f);

            return hfGeom;
        }