Exemplo n.º 1
0
        public BoxRangeBufferData ToBoxBuffer()
        {
            var boxFrustum         = Intersection.ConvertBoxColliderToFrustumPoints(BoxRangeObjectRenderingDataProvider.GetBoundingBoxDefinition());
            var boxRangeBufferData = new BoxRangeBufferData();

            boxRangeBufferData.FC1 = boxFrustum.FC1;
            boxRangeBufferData.FC2 = boxFrustum.FC2;
            boxRangeBufferData.FC3 = boxFrustum.FC3;
            boxRangeBufferData.FC4 = boxFrustum.FC4;
            boxRangeBufferData.FC5 = boxFrustum.FC5;

            boxRangeBufferData.normal1 = boxFrustum.normal1;
            boxRangeBufferData.normal2 = boxFrustum.normal2;
            boxRangeBufferData.normal3 = boxFrustum.normal3;
            boxRangeBufferData.normal4 = boxFrustum.normal4;
            boxRangeBufferData.normal5 = boxFrustum.normal5;
            boxRangeBufferData.normal6 = boxFrustum.normal6;

            boxRangeBufferData.BoundingBoxMax = BoxRangeObjectRenderingDataProvider.BoundingBoxCollider.bounds.max;
            boxRangeBufferData.BoundingBoxMin = BoxRangeObjectRenderingDataProvider.BoundingBoxCollider.bounds.min;

            if (rangeTypeInherentConfigurationData.RangeColorProvider != null)
            {
                boxRangeBufferData.AuraColor = rangeTypeInherentConfigurationData.RangeColorProvider.Invoke();
            }
            else
            {
                boxRangeBufferData.AuraColor = rangeTypeInherentConfigurationData.RangeBaseColor;
            }

            return(boxRangeBufferData);
        }
Exemplo n.º 2
0
 public BoxRangeRenderData(BoxGroundEffectManager BoxGroundEffectManager) : base()
 {
     GroundEffectManager = BoxGroundEffectManager;
     BoxRangeBuffer      = new DynamicComputeBufferManager <BoxRangeBufferData>(BoxRangeBufferData.GetByteSize(), "BoxRangeBuffer", string.Empty, matPro);
 }