///<summary> /// Constructs a new Terrain. ///</summary> ///<param name="heights">Height data to use to create the TerrainShape.</param> ///<param name="worldTransform">Transform to use for the terrain.</param> public Terrain(float[,] heights, AffineTransform worldTransform) : this(new TerrainShape(heights), worldTransform) { }
/// <summary> /// Precomputes the transform to bring triangles from their native local space to the local space of the convex. /// </summary> /// <param name="convexInverseWorldTransform">Inverse of the world transform of the convex shape.</param> /// <param name="fromMeshLocalToConvexLocal">Transform to apply to native local triangles to bring them into the local space of the convex.</param> protected override void PrecomputeTriangleTransform(ref AffineTransform convexInverseWorldTransform, out AffineTransform fromMeshLocalToConvexLocal) { //StaticMeshes only have transformable mesh data. var data = ((TransformableMeshData)mesh.Mesh.Data); AffineTransform.Multiply(ref data.worldTransform, ref convexInverseWorldTransform, out fromMeshLocalToConvexLocal); }
///<summary> /// Constructs a new static mesh. ///</summary> ///<param name="vertices">Vertex positions of the mesh.</param> ///<param name="indices">Index list of the mesh.</param> /// <param name="worldTransform">Transform to use to create the mesh initially.</param> public StaticMesh(Vector3[] vertices, int[] indices, AffineTransform worldTransform) { base.Shape = new StaticMeshShape(vertices, indices, worldTransform); Events = new ContactEventManager <StaticMesh>(); }
///<summary> /// Constructs a new InstancedMesh. ///</summary> ///<param name="meshShape">Shape to use for the instance.</param> ///<param name="worldTransform">Transform to use for the instance.</param> public InstancedMesh(InstancedMeshShape meshShape, AffineTransform worldTransform) { this.worldTransform = worldTransform; base.Shape = meshShape; Events = new ContactEventManager <InstancedMesh>(); }