当前位置: 首页>>代码示例>>C++>>正文


C++ ParamDictionary::addParameter方法代码示例

本文整理汇总了C++中ParamDictionary::addParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamDictionary::addParameter方法的具体用法?C++ ParamDictionary::addParameter怎么用?C++ ParamDictionary::addParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParamDictionary的用法示例。


在下文中一共展示了ParamDictionary::addParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ParticleAffector

    //-----------------------------------------------------------------------
    ColourFaderAffector::ColourFaderAffector(ParticleSystem* psys) : ParticleAffector(psys)
    {
        mRedAdj = mGreenAdj = mBlueAdj = mAlphaAdj = 0;
        mType = "ColourFader";

        // Init parameters
        if (createParamDictionary("ColourFaderAffector"))
        {
            ParamDictionary* dict = getParamDictionary();

            dict->addParameter(ParameterDef("red", 
                "The amount by which to adjust the red component of particles per second.",
                PT_REAL), &msRedCmd);
            dict->addParameter(ParameterDef("green", 
                "The amount by which to adjust the green component of particles per second.",
                PT_REAL), &msGreenCmd);
            dict->addParameter(ParameterDef("blue", 
                "The amount by which to adjust the blue component of particles per second.",
                PT_REAL), &msBlueCmd);
            dict->addParameter(ParameterDef("alpha", 
                "The amount by which to adjust the alpha component of particles per second.",
                PT_REAL), &msAlphaCmd);


        }
    }
开发者ID:Ali-il,项目名称:gamekit,代码行数:27,代码来源:OgreColourFaderAffector.cpp

示例2: mAnimationLoop

    //-----------------------------------------------------------------------
    MeshAnimationAffector::MeshAnimationAffector(ParticleSystem* psys)
		:ParticleAffector(psys),
		mAnimationName(""),
        mAnimationLoop(false),
        mAnimationSpeedFactor(1.0f)
    {
        mType = "MeshAnimationAffector";
		
		// Init parameters
		if (createParamDictionary("MeshAnimationAffector"))
		{
			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("animation_name", 
				"the name of the animation.", PT_STRING),
				&msAnimationNameCmd);

			dict->addParameter(ParameterDef("animation_loop", 
				"set the looping of the animation.", PT_BOOL),
				&msAnimationLoopCmd);	

            dict->addParameter(ParameterDef("animation_speed", 
                "set the speed factor of the animation.", PT_REAL),
                &msAnimationSpeedFactorCmd);			
		}
    }
开发者ID:brock7,项目名称:TianLong,代码行数:27,代码来源:OgreMeshAnimationAffector.cpp

示例3: initDefaults

    //-----------------------------------------------------------------------
    bool AreaEmitter::initDefaults(const String& t)
    {
        // called by the constructor as initDefaults("Type")

        // Defaults
        mDirection = Vector3::UNIT_Z;
        mUp = Vector3::UNIT_Y;
        setSize(100,100,100);
        mType = t;

        // Set up parameters
        if (createParamDictionary(mType + "Emitter"))
        {

            addBaseParameters();
            ParamDictionary* dict = getParamDictionary();

            // Custom params
            dict->addParameter(ParameterDef("width", 
                "Width of the shape in world coordinates.",
                PT_REAL),&msWidthCmd);
            dict->addParameter(ParameterDef("height", 
                "Height of the shape in world coordinates.",
                PT_REAL),&msHeightCmd);
            dict->addParameter(ParameterDef("depth", 
                "Depth of the shape in world coordinates.",
                PT_REAL),&msDepthCmd);
            return true;

        }
        return false;
    }
开发者ID:jjiezheng,项目名称:pap_full,代码行数:33,代码来源:OgreAreaEmitter.cpp

示例4: HighLevelGpuProgram

	//-----------------------------------------------------------------------
	D3D10HLSLProgram::D3D10HLSLProgram(ResourceManager* creator, const String& name, 
		ResourceHandle handle, const String& group, bool isManual, 
		ManualResourceLoader* loader, D3D10Device & device)
		: HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
		, mpMicroCode(NULL), mErrorsInCompile(false), mConstantBuffer(NULL), mDevice(device), 
		mpIShaderReflection(NULL), mShaderReflectionConstantBuffer(NULL), mpVertexShader(NULL)//, mpConstTable(NULL)
	{
		if ("Hatch_ps_hlsl" == name)
		{
			mpMicroCode = NULL;
		}
		ZeroMemory(&mConstantBufferDesc, sizeof(mConstantBufferDesc)) ;
		ZeroMemory(&mShaderDesc, sizeof(mShaderDesc)) ;

		if (createParamDictionary("D3D10HLSLProgram"))
		{
			setupBaseParamDictionary();
			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("entry_point", 
				"The entry point for the HLSL program.",
				PT_STRING),&msCmdEntryPoint);
			dict->addParameter(ParameterDef("target", 
				"Name of the assembler target to compile down to.",
				PT_STRING),&msCmdTarget);
			dict->addParameter(ParameterDef("preprocessor_defines", 
				"Preprocessor defines use to compile the program.",
				PT_STRING),&msCmdPreprocessorDefines);
			dict->addParameter(ParameterDef("column_major_matrices", 
				"Whether matrix packing in column-major order.",
				PT_BOOL),&msCmdColumnMajorMatrices);
		}

	}
开发者ID:jjiezheng,项目名称:pap_full,代码行数:35,代码来源:OgreD3D10HLSLProgram.cpp

示例5: addBaseParams

	void ExternalTextureSource::addBaseParams()
	{
		if( mDictionaryName == "NotAssigned" )
            OGRE_EXCEPT(Exception::ERR_FILE_NOT_FOUND, 
                "Plugin " + mPlugInName + 
				" needs to override default mDictionaryName", 
                "ExternalTextureSource::addBaseParams");

		//Create Dictionary Here
        if (createParamDictionary( mDictionaryName ))
		{
	        ParamDictionary* dict = getParamDictionary();
			
			dict->addParameter(ParameterDef("filename", 
			    "A source for the texture effect (only certain plugins require this)"
				, PT_STRING),
				&ExternalTextureSource::msCmdInputFile);
			dict->addParameter(ParameterDef("frames_per_second", 
			    "How fast should playback be (only certain plugins use this)"
				, PT_INT),
				&ExternalTextureSource::msCmdFramesPerSecond);
			dict->addParameter(ParameterDef("play_mode", 
			    "How the playback starts(only certain plugins use this)"
				, PT_STRING),
				&ExternalTextureSource::msCmdPlayMode);
			dict->addParameter(ParameterDef("set_T_P_S", 
			    "Set the technique, pass, and state level of this texture_unit (eg. 0 0 0 )"
				, PT_STRING),
				&ExternalTextureSource::msCmdTecPassState);
		}
	}
开发者ID:Strongc,项目名称:game-ui-solution,代码行数:31,代码来源:OgreExternalTextureSource.cpp

示例6: ParticleAffector

    //-----------------------------------------------------------------------
    DeflectorPlaneAffector::DeflectorPlaneAffector(ParticleSystem* psys)
        : ParticleAffector(psys)
    {
        mType = "DeflectorPlane";

        // defaults
        mPlanePoint = Vector3::ZERO;
        mPlaneNormal = Vector3::UNIT_Y;
        mBounce = 1.0;

        // Set up parameters
        if (createParamDictionary("DeflectorPlaneAffector"))
        {
            addBaseParameters();
            // Add extra paramaters
            ParamDictionary* dict = getParamDictionary();
            dict->addParameter(ParameterDef("plane_point",
                "A point on the deflector plane. Together with the normal vector it defines the plane.",
                PT_VECTOR3), &msPlanePointCmd);
            dict->addParameter(ParameterDef("plane_normal",
                "The normal vector of the deflector plane. Together with the point it defines the plane.",
                PT_VECTOR3), &msPlaneNormalCmd);
            dict->addParameter(ParameterDef("bounce",
                "The amount of bouncing when a particle is deflected. 0 means no deflection and 1 stands for 100 percent reflection.",
                PT_REAL), &msBounceCmd);
        }
    }
开发者ID:jjiezheng,项目名称:pap_full,代码行数:28,代码来源:OgreDeflectorPlaneAffector.cpp

示例7: ParticleAffector

    //-----------------------------------------------------------------------
    RotationAffector::RotationAffector(ParticleSystem* psys) :
        ParticleAffector(psys),
        mRotationSpeedRangeStart(0),
        mRotationSpeedRangeEnd(0),
        mRotationRangeStart(0),
        mRotationRangeEnd(0)
    {
        mType = "Rotator";

        // Init parameters
        if (createParamDictionary("RotationAffector"))
        {
            ParamDictionary* dict = getParamDictionary();

            dict->addParameter(ParameterDef("rotation_speed_range_start",
                "The start of a range of rotation speed to be assigned to emitted particles.", PT_REAL),
                &msRotationSpeedRangeStartCmd);

            dict->addParameter(ParameterDef("rotation_speed_range_end",
                "The end of a range of rotation speed to be assigned to emitted particles.", PT_REAL),
                &msRotationSpeedRangeEndCmd);

            dict->addParameter(ParameterDef("rotation_range_start",
                "The start of a range of rotation angles to be assigned to emitted particles.", PT_REAL),
                &msRotationRangeStartCmd);

            dict->addParameter(ParameterDef("rotation_range_end",
                "The end of a range of rotation angles to be assigned to emitted particles.", PT_REAL),
                &msRotationRangeEndCmd);
        }
    }
开发者ID:Kanma,项目名称:Ogre,代码行数:32,代码来源:OgreRotationAffector.cpp

示例8: HighLevelGpuProgram

//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
GLSLESProgram::GLSLESProgram(ResourceManager* creator,
                             const String& name, ResourceHandle handle,
                             const String& group, bool isManual, ManualResourceLoader* loader)
    : HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
    , mGLShaderHandle(0)
    , mGLProgramHandle(0)
    , mCompiled(0)
#if !OGRE_NO_GLES2_GLSL_OPTIMISER
    , mIsOptimised(false)
    , mOptimiserEnabled(false)
#endif
{
    if (createParamDictionary("GLSLESProgram"))
    {
        setupBaseParamDictionary();
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(ParameterDef("preprocessor_defines",
                                        "Preprocessor defines use to compile the program.",
                                        PT_STRING),&msCmdPreprocessorDefines);
#if !OGRE_NO_GLES2_GLSL_OPTIMISER
        dict->addParameter(ParameterDef("use_optimiser",
                                        "Should the GLSL optimiser be used. Default is false.",
                                        PT_BOOL),&msCmdOptimisation);
#endif
    }
    // Manually assign language now since we use it immediately
    mSyntaxCode = "glsles";
}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:31,代码来源:OgreGLSLESProgram.cpp

示例9: HighLevelGpuProgram

	//-----------------------------------------------------------------------
	CgProgram::CgProgram(ResourceManager* creator, const String& name, 
		ResourceHandle handle, const String& group, bool isManual, 
		ManualResourceLoader* loader, CGcontext context)
		: HighLevelGpuProgram(creator, name, handle, group, isManual, loader), 
		mCgContext(context), 
		mSelectedCgProfile(CG_PROFILE_UNKNOWN), mCgArguments(0), mParametersMapSizeAsBuffer(0)
	{
		if (createParamDictionary("CgProgram"))
		{
			setupBaseParamDictionary();

			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("entry_point", 
				"The entry point for the Cg program.",
				PT_STRING),&msCmdEntryPoint);
			dict->addParameter(ParameterDef("profiles", 
				"Space-separated list of Cg profiles supported by this profile.",
				PT_STRING),&msCmdProfiles);
			dict->addParameter(ParameterDef("compile_arguments", 
				"A string of compilation arguments to pass to the Cg compiler.",
				PT_STRING),&msCmdArgs);
		}
		
	}
开发者ID:wjwwood,项目名称:ogre,代码行数:26,代码来源:OgreCgProgram.cpp

示例10: ParticleAffector

    //-----------------------------------------------------------------------
    DirectionRandomiserAffector::DirectionRandomiserAffector(ParticleSystem* psys)
       : ParticleAffector(psys)
    {
        mType = "DirectionRandomiser";

        // defaults
        mRandomness = 1.0;
        mScope = 1.0;
        mKeepVelocity = false;

        // Set up parameters
        if (createParamDictionary("DirectionRandomiserAffector"))
        {
            addBaseParameters();
            // Add extra paramaters
            ParamDictionary* dict = getParamDictionary();
            dict->addParameter(ParameterDef("randomness",
                "The amount of randomness (chaos) to apply to the particle movement.",
                PT_REAL), &msRandomnessCmd);
            dict->addParameter(ParameterDef("scope",
                "The percentage of particles which is affected.",
                PT_REAL), &msScopeCmd);
            dict->addParameter(ParameterDef("keep_velocity",
                "Detemines whether the velocity of the particles is changed.",
                PT_BOOL), &msKeepVelocityCmd);
        }
    }
开发者ID:milram,项目名称:ogre-1.7.4-osx,代码行数:28,代码来源:OgreDirectionRandomiserAffector.cpp

示例11: ParticleAffector

    //-----------------------------------------------------------------------
    ColourInterpolatorAffector::ColourInterpolatorAffector(ParticleSystem* psys)
        : ParticleAffector(psys)
    {
		for (int i=0;i<MAX_STAGES;i++)
		{
			// set default colour to transparent grey, transparent since we might not want to display the particle here
			// grey because when a colour component is 0.5f the maximum difference to another colour component is 0.5f
			mColourAdj[i]	= ColourValue(0.5f, 0.5f, 0.5f, 0.0f);
			mTimeAdj[i]		= 1.0f;
		}

        mType = "ColourInterpolator";

        // Init parameters
        if (createParamDictionary("ColourInterpolatorAffector"))
        {
            ParamDictionary* dict = getParamDictionary();

			for (int i=0;i<MAX_STAGES;i++)
			{
				msColourCmd[i].mIndex	= i;
				msTimeCmd[i].mIndex		= i;

				StringUtil::StrStreamType stage;
				stage << i;
				String	colour_title	= String("colour") + stage.str();
				String	time_title		= String("time") + stage.str();
				String	colour_descr	= String("Stage ") + stage.str() + String(" colour.");
				String	time_descr		= String("Stage ") + stage.str() + String(" time.");

				dict->addParameter(ParameterDef(colour_title, colour_descr, PT_COLOURVALUE), &msColourCmd[i]);
				dict->addParameter(ParameterDef(time_title,   time_descr,   PT_REAL),		 &msTimeCmd[i]);
			}
        }
    }
开发者ID:Anti-Mage,项目名称:ogre,代码行数:36,代码来源:OgreColourInterpolatorAffector.cpp

示例12: mNextPoolIndex

	//-----------------------------------------------------------------------
	MeshParticleRenderer::MeshParticleRenderer() :
	mMaterialName(""),
	mMeshName(""),
	mWorldSpace(false),
	mParticleSystemNode(NULL),
	mMeshRotation(false),
	mMeshSizeChanged(false),
	mDefaultWidth(1.0f),
	mDefaultHeight(1.0f),
	mMeshOrientationType(MOT_ORIENTED_ORIGIN),
    mNextPoolIndex(0)
	{		
		if (createParamDictionary("MeshParticleRenderer"))
		{
			ParamDictionary* dict = getParamDictionary();
			dict->addParameter(ParameterDef("mesh_name", 
				"the name of the mesh.",
				PT_STRING),
				&msMeshNameCmd);	

			dict->addParameter(ParameterDef("orientation_type", 
				"the orientation type of mesh particle,"
				"'oriented_origin' means particles are oriened origin direction,"
				"'oriented_self' means particles are oriented around their own direction.",
				PT_STRING),
				&msOrientationTypeCmd);

		}

		_freeParticleMeshVisualDatas();
	}
开发者ID:gitrider,项目名称:wxsj2,代码行数:32,代码来源:OgreMeshParticleRenderer.cpp

示例13: addBaseParameters

    //-----------------------------------------------------------------------
    LinearForceAffector::LinearForceAffector(ParticleSystem* psys)
        :ParticleAffector(psys)
    {
        mType = "LinearForce";

        // Default to gravity-like
        mForceApplication = FA_ADD;
        mForceVector.x = mForceVector.z = 0;
        mForceVector.y = -100;

        // Set up parameters
        if (createParamDictionary("LinearForceAffector"))
        {
            addBaseParameters();
            // Add extra paramaters
            ParamDictionary* dict = getParamDictionary();
            dict->addParameter(ParameterDef("force_vector",
                "The vector representing the force to apply.",
                PT_VECTOR3),&msForceVectorCmd);
            dict->addParameter(ParameterDef("force_application",
                "How to apply the force vector to particles.",
                PT_STRING),&msForceAppCmd);

        }

    }
开发者ID:Kanma,项目名称:Ogre,代码行数:27,代码来源:OgreLinearForceAffector.cpp

示例14: addBaseParameters

    //---------------------------------------------------------------------
    void BorderPanelOverlayElement::addBaseParameters(void)
    {
        PanelOverlayElement::addBaseParameters();
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(ParameterDef("border_size", 
            "The sizes of the borders relative to the screen size, in the order "
            "left, right, top, bottom."
            , PT_STRING),
            &msCmdBorderSize);
        dict->addParameter(ParameterDef("border_material", 
            "The material to use for the border."
            , PT_STRING),
            &msCmdBorderMaterial);
        dict->addParameter(ParameterDef("border_topleft_uv", 
            "The texture coordinates for the top-left corner border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderTopLeftUV);
        dict->addParameter(ParameterDef("border_topright_uv", 
            "The texture coordinates for the top-right corner border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderTopRightUV);
        dict->addParameter(ParameterDef("border_bottomright_uv", 
            "The texture coordinates for the bottom-right corner border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderBottomRightUV);
        dict->addParameter(ParameterDef("border_bottomleft_uv", 
            "The texture coordinates for the bottom-left corner border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderBottomLeftUV);
        dict->addParameter(ParameterDef("border_left_uv", 
            "The texture coordinates for the left edge border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderLeftUV);
        dict->addParameter(ParameterDef("border_top_uv", 
            "The texture coordinates for the top edge border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderTopUV);
        dict->addParameter(ParameterDef("border_right_uv", 
            "The texture coordinates for the right edge border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderRightUV);
        dict->addParameter(ParameterDef("border_bottom_uv", 
            "The texture coordinates for the bottom edge border texture. 2 sets of uv values, "
            "one for the top-left corner, the other for the bottom-right corner."
            , PT_STRING),
            &msCmdBorderBottomUV);

    }
开发者ID:JobsSteve,项目名称:gamekit-2,代码行数:57,代码来源:OgreBorderPanelOverlayElement.cpp

示例15: AreaEmitter

    //-----------------------------------------------------------------------
    RingEmitter::RingEmitter(ParticleSystem* psys)
        : AreaEmitter(psys)
    {
        if (initDefaults("Ring"))
        {
            // Add custom parameters
            ParamDictionary* pDict = getParamDictionary();

            pDict->addParameter(ParameterDef("inner_width", "Parametric value describing the proportion of the "
                "shape which is hollow.", PT_REAL), &msCmdInnerX);
            pDict->addParameter(ParameterDef("inner_height", "Parametric value describing the proportion of the "
                "shape which is hollow.", PT_REAL), &msCmdInnerY);
        }
        // default is half empty
        setInnerSize(0.5,0.5);
    }
开发者ID:JoeyZh,项目名称:ogre-android,代码行数:17,代码来源:OgreRingEmitter.cpp


注:本文中的ParamDictionary::addParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。