예제 #1
0
 ///<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)
 {
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 ///<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>();
 }
예제 #4
0
 ///<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>();
 }