Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 public int GetHashCode(MaterialPlusClippingKey obj)
 {
     return(obj.GetHashCode());
 }
Пример #4
0
		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;
		}
Пример #5
0
		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;
		}
Пример #6
0
		public int GetHashCode(MaterialPlusClippingKey obj)
		{
			return obj.GetHashCode();
		}