示例#1
0
 ///<summary>
 /// Constructs a new compound shape from cached data.
 ///</summary>
 ///<param name="shapes">Shape entries used to create the compound. Assumed to be centered properly.</param>
 /// <param name="volumeDescription">Description of the volume and its distribution in the shape. Assumed to be correct; no processing or validation is performed.</param>
 public CompoundShape(IList <CompoundShapeEntry> shapes, EntityShapeVolumeDescription volumeDescription)
 {
     this.shapes = new RawList <CompoundShapeEntry>(shapes);
     UpdateEntityShapeVolume(volumeDescription);
 }
示例#2
0
 protected void UpdateEntityShapeVolume(EntityShapeVolumeDescription volume)
 {
     Volume             = volume.Volume;
     volumeDistribution = volume.VolumeDistribution;
 }
示例#3
0
        ///<summary>
        /// Constructs a new mobile mesh shape from cached data.
        ///</summary>
        ///<param name="meshData">Mesh data reprsenting the shape. Should already be properly centered.</param>
        /// <param name="hullVertices">Outer hull vertices of the mobile mesh shape used to quickly compute the bounding box.</param>
        ///<param name="solidity">Solidity state of the shape.</param>
        /// <param name="sidednessWhenSolid">Triangle sidedness to use when the shape is solid.</param>
        /// <param name="collisionMargin">Collision margin used to expand the mesh triangles.</param>
        /// <param name="volumeDescription">Description of the volume and its distribution in the shape. Assumed to be correct; no processing or validation is performed.</param>
        public MobileMeshShape(TransformableMeshData meshData, IList <Vector3f> hullVertices, MobileMeshSolidity solidity, TriangleSidedness sidednessWhenSolid, float collisionMargin, EntityShapeVolumeDescription volumeDescription)
        {
            triangleMesh        = new TriangleMesh(meshData);
            this.hullVertices   = new RawList <Vector3f>(hullVertices);
            meshCollisionMargin = collisionMargin;
            this.solidity       = solidity;
            SidednessWhenSolid  = sidednessWhenSolid;

            UpdateEntityShapeVolume(volumeDescription);
        }