예제 #1
0
        // SHOW POSITION VISUALIZATION //
        //
        private void ShowPositionVisualization()
        {
            Vector4 v;

            BaseProperty.eDataMode dm;

            if (value.dataMode == BaseProperty.eDataMode.Reference)
            {
                dm = value.reference.property.dataMode;
            }
            else
            {
                dm = value.dataMode;
            }

            switch (dm)
            {
            case VectorProperty.eDataMode.Constant:
                Handles.color = new Color(1f, 1f, 1f, 1f);
                v             = value.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex);
                AmpsHelpers.DrawPositionHandle(v, 0.125f, weight.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex));
                break;

            case VectorProperty.eDataMode.RandomConstant:
                if (value.coordSystemConversionMode != BaseProperty.eCoordSystemConversionMode.NoConversion)
                {
                    v = value.ConvertCoordinateSystem(value.randomMin, ownerBlueprint.ownerEmitter.exampleInputParticleIndex);
                }
                else
                {
                    v = value.randomMin;
                }
                Handles.color = new Color(1f, 1f, 1f, 1f);
                AmpsHelpers.DrawPositionHandle(v, 0.0625f, weight.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex));

                if (value.coordSystemConversionMode != BaseProperty.eCoordSystemConversionMode.NoConversion)
                {
                    v = value.ConvertCoordinateSystem(value.randomMax, ownerBlueprint.ownerEmitter.exampleInputParticleIndex);
                }
                else
                {
                    v = value.randomMax;
                }
                Handles.color = new Color(1f, 1f, 1f, 1f);
                AmpsHelpers.DrawPositionHandle(v, 0.125f, weight.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex));
                break;

            case VectorProperty.eDataMode.Curve:
                //Handles.color = Color.white;
                //v = value.GetValue(ownerEmitter.exampleInputParticleIndex);
                //AmpsHelpers.DrawCrossHandle(v, 0.125f);
                break;

            case VectorProperty.eDataMode.RandomCurve:
                // TODO: RandomCurve vis.
                break;
            }
        }
예제 #2
0
        // SHOW POSITION VISUALIZATION //
        //
        private void ShowPositionVisualization()
        {
            Vector4        v;
            VectorProperty actualPoint;

            float timeSinceLastSample = ownerBlueprint.ownerEmitter.particleTimes[ownerBlueprint.ownerEmitter.exampleInputParticleIndex] - (lastSampleTimes[ownerBlueprint.ownerEmitter.exampleInputParticleIndex] + intervalOffset.GetValue());

            if (vector.dataMode == BaseProperty.eDataMode.Reference)
            {
                actualPoint = (VectorProperty)vector.reference.property;
            }
            else
            {
                actualPoint = vector;
            }

            switch (actualPoint.dataMode)
            {
            case VectorProperty.eDataMode.Constant:
                Handles.color = new Color(1f, 1f, 1f, 1f);
                if (actualPoint.coordSystemConversionMode != BaseProperty.eCoordSystemConversionMode.NoConversion)
                {
                    v = actualPoint.ConvertCoordinateSystem(actualPoint.constant, ownerBlueprint.ownerEmitter.exampleInputParticleIndex);
                }
                else
                {
                    v = actualPoint.constant;
                }
                AmpsHelpers.DrawPositionHandle(v, 0.125f, weight.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex));
                AmpsHelpers.DrawSamplingIndicator(v, 0.0625f, timeSinceLastSample);
                break;

            case VectorProperty.eDataMode.RandomConstant:
                if (actualPoint.coordSystemConversionMode != BaseProperty.eCoordSystemConversionMode.NoConversion)
                {
                    v = actualPoint.ConvertCoordinateSystem(actualPoint.randomMin, ownerBlueprint.ownerEmitter.exampleInputParticleIndex);
                }
                else
                {
                    v = actualPoint.randomMin;
                }
                Handles.color = new Color(1f, 1f, 1f, 1f);
                AmpsHelpers.DrawPositionHandle(v, 0.0625f, weight.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex));
                AmpsHelpers.DrawSamplingIndicator(v, 0.0625f, timeSinceLastSample);

                if (actualPoint.coordSystemConversionMode != BaseProperty.eCoordSystemConversionMode.NoConversion)
                {
                    v = actualPoint.ConvertCoordinateSystem(actualPoint.randomMax, ownerBlueprint.ownerEmitter.exampleInputParticleIndex);
                }
                else
                {
                    v = actualPoint.randomMax;
                }

                Handles.color = new Color(1f, 1f, 1f, 1f);
                AmpsHelpers.DrawPositionHandle(v, 0.125f, weight.GetValue(ownerBlueprint.ownerEmitter.exampleInputParticleIndex));
                AmpsHelpers.DrawSamplingIndicator(v, 0.0625f, timeSinceLastSample);
                break;

            case VectorProperty.eDataMode.Curve:
                // TODO: Curve vis.

                //Handles.color = new Color(1f, 1f, 1f, 1f);
                //v = actualPoint.convertCoordinateSystem(actualPoint.GetValue(ownerEmitter.exampleInputParticleIndex), ownerEmitter.exampleInputParticleIndex);
                //AmpsHelpers.DrawPositionHandle(v, 0.125f, weight.GetValue(ownerEmitter.exampleInputParticleIndex));
                //AmpsHelpers.DrawSamplingIndicator(v, 0.0625f, timeSinceLastSample);
                break;

            case VectorProperty.eDataMode.RandomCurve:
                // TODO: RandomCurve vis.
                break;
            }
        }