private PositionColorIndexedTriangleBuffer InternalGetPositionColorIndexedTriangleBuffer(IMaterial material)
        {
            var key = new MaterialPlusClippingKey(material, null);

            if (!_positionColorIndexedTriangleBuffers.TryGetValue(key, out var result))
            {
                result = new PositionColorIndexedTriangleBuffer(this);
                _positionColorIndexedTriangleBuffers.Add(key, result);
            }

            return(result);
        }
        private PositionNormalColorIndexedTriangleBuffer InternalGetPositionNormalColorIndexedTriangleBuffer(IMaterial material, PlaneD3D[] clipPlanes)
        {
            // Transform the clip planes to our coordinate system

            var clipPlanesTransformed = clipPlanes.Select(plane => _transformation.Transform(plane)).ToArray();

            var key = new MaterialPlusClippingKey(material, clipPlanesTransformed);

            if (!_positionNormalColorIndexedTriangleBuffers.TryGetValue(key, out var result))
            {
                result = new PositionNormalColorIndexedTriangleBufferWithClipping(this, clipPlanesTransformed);
                _positionNormalColorIndexedTriangleBuffers.Add(key, result);
            }

            return(result);
        }
Exemple #3
0
 public int GetHashCode(MaterialPlusClippingKey obj)
 {
     return(obj.GetHashCode());
 }
		private PositionNormalColorIndexedTriangleBuffer InternalGetPositionNormalColorIndexedTriangleBuffer(IMaterial material, PlaneD3D[] clipPlanes)
		{
			// Transform the clip planes to our coordinate system

			var clipPlanesTransformed = clipPlanes.Select(plane => _transformation.Transform(plane)).ToArray();

			PositionNormalColorIndexedTriangleBuffer result;
			var key = new MaterialPlusClippingKey(material, clipPlanesTransformed);
			if (!_positionNormalColorIndexedTriangleBuffers.TryGetValue(key, out result))
			{
				result = new PositionNormalColorIndexedTriangleBufferWithClipping(this, clipPlanesTransformed);
				_positionNormalColorIndexedTriangleBuffers.Add(key, result);
			}

			return result;
		}
		private PositionColorIndexedTriangleBuffer InternalGetPositionColorIndexedTriangleBuffer(IMaterial material)
		{
			PositionColorIndexedTriangleBuffer result;
			var key = new MaterialPlusClippingKey(material, null);
			if (!_positionColorIndexedTriangleBuffers.TryGetValue(key, out result))
			{
				result = new PositionColorIndexedTriangleBuffer(this);
				_positionColorIndexedTriangleBuffers.Add(key, result);
			}

			return result;
		}
		public int GetHashCode(MaterialPlusClippingKey obj)
		{
			return obj.GetHashCode();
		}