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