예제 #1
0
            public override bool    Equals(object _Other)
            {
                ParameterFloat3 Other = _Other as ParameterFloat3;

                if (Other == null)
                {
                    throw new Exception("Other parameter is not of type FLOAT3 !");
                }

                return(Other.m_Value == m_Value);
            }
예제 #2
0
        /// <summary>
        /// Creates a new parameter
        /// </summary>
        /// <param name="_Name"></param>
        /// <param name="_Type"></param>
        /// <returns></returns>
        public Parameter        CreateParameter(string _Name, PARAMETER_TYPE _Type)
        {
            Parameter Result = null;

            switch (_Type)
            {
            case PARAMETER_TYPE.BOOL:
                Result = new ParameterBool(this, _Name);
                break;

            case PARAMETER_TYPE.INT:
                Result = new ParameterInt(this, _Name);
                break;

            case PARAMETER_TYPE.FLOAT:
                Result = new ParameterFloat(this, _Name);
                break;

            case PARAMETER_TYPE.FLOAT2:
                Result = new ParameterFloat2(this, _Name);
                break;

            case PARAMETER_TYPE.FLOAT3:
                Result = new ParameterFloat3(this, _Name);
                break;

            case PARAMETER_TYPE.FLOAT4:
                Result = new ParameterFloat4(this, _Name);
                break;

            case PARAMETER_TYPE.MATRIX4:
                Result = new ParameterMatrix4(this, _Name);
                break;

            case PARAMETER_TYPE.TEXTURE2D:
                Result = new ParameterTexture2D(this, _Name);
                break;

            default:
                throw new Exception("Unsupported parameter type !");
            }

            // Add it...
            m_Parameters.Add(Result);
            m_Name2Parameter.Add(Result.Name, Result);

            return(Result);
        }
예제 #3
0
        /// <summary>
        /// Creates a new parameter
        /// </summary>
        /// <param name="_Name"></param>
        /// <param name="_Type"></param>
        /// <returns></returns>
        public Parameter CreateParameter( string _Name, PARAMETER_TYPE _Type )
        {
            Parameter	Result = null;
            switch ( _Type )
            {
                case PARAMETER_TYPE.BOOL:
                    Result = new ParameterBool( this, _Name );
                    break;
                case PARAMETER_TYPE.INT:
                    Result = new ParameterInt( this, _Name );
                    break;
                case PARAMETER_TYPE.FLOAT:
                    Result = new ParameterFloat( this, _Name );
                    break;
                case PARAMETER_TYPE.FLOAT2:
                    Result = new ParameterFloat2( this, _Name );
                    break;
                case PARAMETER_TYPE.FLOAT3:
                    Result = new ParameterFloat3( this, _Name );
                    break;
                case PARAMETER_TYPE.FLOAT4:
                    Result = new ParameterFloat4( this, _Name );
                    break;
                case PARAMETER_TYPE.MATRIX4:
                    Result = new ParameterMatrix4( this, _Name );
                    break;
                case PARAMETER_TYPE.TEXTURE2D:
                    Result = new ParameterTexture2D( this, _Name );
                    break;

                default:
                    throw new Exception( "Unsupported parameter type !" );
            }

            // Add it...
            m_Parameters.Add( Result );
            m_Name2Parameter.Add( Result.Name, Result );

            return Result;
        }