Exemplo n.º 1
0
        public override IPositionNormalUIndexedTriangleBuffer GetPositionNormalUIndexedTriangleBuffer(IMaterial material, PlaneD3D[] clipPlanes, Gdi.Plot.IColorProvider colorProvider)
        {
            // Transform the clip planes to our coordinate system

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

            var key = new MaterialPlusClippingPlusColorProviderKey(material, clipPlanesTransformed, colorProvider);

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

            return(result);
        }
Exemplo n.º 2
0
		public override IPositionNormalUIndexedTriangleBuffer GetPositionNormalUIndexedTriangleBuffer(IMaterial material, PlaneD3D[] clipPlanes, Gdi.Plot.IColorProvider colorProvider)
		{
			// Transform the clip planes to our coordinate system

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

			PositionNormalUIndexedTriangleBuffer result;
			var key = new MaterialPlusClippingPlusColorProviderKey(material, clipPlanesTransformed, colorProvider);
			if (!_positionNormalUIndexedTriangleBuffers.TryGetValue(key, out result))
			{
				result = new PositionNormalUIndexedTriangleBuffer(this);
				_positionNormalUIndexedTriangleBuffers.Add(key, result);
			}

			return result;
		}