コード例 #1
0
    //-----------------------------------------------------------------------
    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);


        }
    }
コード例 #2
0
    //-----------------------------------------------------------------------
    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);			
		}
    }
コード例 #3
0
    //-----------------------------------------------------------------------
    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;
    }
コード例 #4
0
	//-----------------------------------------------------------------------
	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);
		}

	}
コード例 #5
0
	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);
		}
	}
コード例 #6
0
    //-----------------------------------------------------------------------
    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);
        }
    }
コード例 #7
0
ファイル: OgreRotationAffector.cpp プロジェクト: Kanma/Ogre
    //-----------------------------------------------------------------------
    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);
        }
    }
コード例 #8
0
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
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";
}
コード例 #9
0
ファイル: OgreCgProgram.cpp プロジェクト: wjwwood/ogre
	//-----------------------------------------------------------------------
	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);
		}
		
	}
コード例 #10
0
    //-----------------------------------------------------------------------
    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);
        }
    }
コード例 #11
0
    //-----------------------------------------------------------------------
    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]);
			}
        }
    }
コード例 #12
0
	//-----------------------------------------------------------------------
	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();
	}
コード例 #13
0
    //-----------------------------------------------------------------------
    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);

        }

    }
コード例 #14
0
    //---------------------------------------------------------------------
    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);

    }
コード例 #15
0
    //-----------------------------------------------------------------------
    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);
    }
コード例 #16
0
	//-----------------------------------------------------------------------
	FireExtinguisherAffector::FireExtinguisherAffector(ParticleSystem* psys)
		: ParticleAffector(psys)
	{
		mType = "FireExtinguisher";

		// defaults
		mEffectiveness = 1.0;
		mEfaf = 0;

		// Set up parameters
		if (createParamDictionary("FireExtinguisherAffector"))
		{
			addBaseParameters();
			// Add extra paramaters
			ParamDictionary* dict = getParamDictionary();
			dict->addParameter(ParameterDef("effectiveness",
				"How effective is your fire extinguisher? Anything higher than one is more effective than water while everything lower than one is less effective than water.",
				PT_REAL), &msEffectivenessCmd);
		}

		// get fire affector factory
		ParticleSystemManager::ParticleAffectorFactoryIterator pafi = ParticleSystemManager::getSingleton().getAffectorFactoryIterator();
		ParticleAffectorFactory *paf;

		while(pafi.hasMoreElements())
		{
			paf = pafi.getNext();
			if ( paf->getName() == "ExtinguishableFire" )
			{
				mEfaf = (ExtinguishableFireAffectorFactory *)paf;
				break;
			}	
		}
		if (!mEfaf) LOG("ERROR: Couldn't find an ExtinguishableFireAffectorFactory instance. Was it registered in the content manager?");
	}
コード例 #17
0
    //-----------------------------------------------------------------------
    void OverlayElement::addBaseParameters(void)    
    {
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(ParameterDef("left", 
            "The position of the left border of the gui element."
            , PT_REAL),
            &msLeftCmd);
        dict->addParameter(ParameterDef("top", 
            "The position of the top border of the gui element."
            , PT_REAL),
            &msTopCmd);
        dict->addParameter(ParameterDef("width", 
            "The width of the element."
            , PT_REAL),
            &msWidthCmd);
        dict->addParameter(ParameterDef("height", 
            "The height of the element."
            , PT_REAL),
            &msHeightCmd);
        dict->addParameter(ParameterDef("material", 
            "The name of the material to use."
            , PT_STRING),
            &msMaterialCmd);
        dict->addParameter(ParameterDef("caption", 
            "The element caption, if supported."
            , PT_STRING),
            &msCaptionCmd);
        dict->addParameter(ParameterDef("metrics_mode", 
            "The type of metrics to use, either 'relative' to the screen, 'pixels' or 'relative_aspect_adjusted'."
            , PT_STRING),
            &msMetricsModeCmd);
        dict->addParameter(ParameterDef("horz_align", 
            "The horizontal alignment, 'left', 'right' or 'center'."
            , PT_STRING),
            &msHorizontalAlignCmd);
        dict->addParameter(ParameterDef("vert_align", 
            "The vertical alignment, 'top', 'bottom' or 'center'."
            , PT_STRING),
            &msVerticalAlignCmd);
        dict->addParameter(ParameterDef("visible", 
            "Initial visibility of element, either 'true' or 'false' (default true)."
            , PT_STRING),
            &msVisibleCmd);
    }
コード例 #18
0
	//-----------------------------------------------------------------------
	ExtinguishableFireAffector::ExtinguishableFireAffector(ParticleSystem* psys)
		: ParticleAffector(psys), mPsys(psys)
	{
		mType = "ExtinguishableFire";

		// defaults
		mMiddlePoint = Vector3::ZERO;
		mRadius = 1.0;
		mIntensity = 3000.0;
		originalIntensity = mIntensity;
		mIntensityGrowth = 10;
		mMaxIntensity = 4000.0;
		updateIntensityRequired = false;
		firstFrame = true;
		
		// Set up parameters
		if (createParamDictionary("ExtinguishableFireAffector"))
		{
			addBaseParameters();
			// Add extra paramaters
			ParamDictionary* dict = getParamDictionary();
			dict->addParameter(ParameterDef("middle_point",
				"The middle point of the sphere on which water particles will interact.",
				PT_VECTOR3), &msMiddlePointCmd);
			dict->addParameter(ParameterDef("intensity",
				"The amount of water particles that a fire can withstand before being extinguished.",
				PT_REAL), &msIntensityCmd);
			dict->addParameter(ParameterDef("max_intensity",
				"The maximum intensity the fire can grow to.",
				PT_REAL), &msMaxIntensityCmd);
			dict->addParameter(ParameterDef("intensity_growth",
				"The amount by which the intensity of the fire grows per second.",
				PT_REAL), &msMaxIntensityCmd);
			dict->addParameter(ParameterDef("radius",
				"The radius of the sphere.",
				PT_REAL), &msRadiusCmd);
		}

		// predefine objectInstanceName
		objectInstanceName = "unknown";

		ScriptEngine::getSingleton().fireEvent(objectInstanceName, mIntensity);
	}
コード例 #19
0
    //-----------------------------------------------------------------------
    ColourFaderAffector2::ColourFaderAffector2(ParticleSystem* psys) : ParticleAffector(psys)
    {
        mRedAdj1 = mGreenAdj1 = mBlueAdj1 = mAlphaAdj1 = 0;
		mRedAdj2 = mGreenAdj2 = mBlueAdj2 = mAlphaAdj2 = 0;
        mType = "ColourFader2";
		StateChangeVal = 1;	// Switch when there is 1 second left on the TTL

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

			// Phase 1
            dict->addParameter(ParameterDef("red1", 
                "The amount by which to adjust the red component of particles per second.",
                PT_REAL), &msRedCmd1);
            dict->addParameter(ParameterDef("green1", 
                "The amount by which to adjust the green component of particles per second.",
                PT_REAL), &msGreenCmd1);
            dict->addParameter(ParameterDef("blue1", 
                "The amount by which to adjust the blue component of particles per second.",
                PT_REAL), &msBlueCmd1);
            dict->addParameter(ParameterDef("alpha1", 
                "The amount by which to adjust the alpha component of particles per second.",
                PT_REAL), &msAlphaCmd1);

			// Phase 2
            dict->addParameter(ParameterDef("red2", 
                "The amount by which to adjust the red component of particles per second.",
                PT_REAL), &msRedCmd2);
            dict->addParameter(ParameterDef("green2", 
                "The amount by which to adjust the green component of particles per second.",
                PT_REAL), &msGreenCmd2);
            dict->addParameter(ParameterDef("blue2", 
                "The amount by which to adjust the blue component of particles per second.",
                PT_REAL), &msBlueCmd2);
            dict->addParameter(ParameterDef("alpha2", 
                "The amount by which to adjust the alpha component of particles per second.",
                PT_REAL), &msAlphaCmd2);

			// State Change Value
            dict->addParameter(ParameterDef("state_change", 
                "When the particle has this much time to live left, it will switch to state 2.",
                PT_REAL), &msStateCmd);

        }
    }
コード例 #20
0
    //-----------------------------------------------------------------------
    void PanelOverlayElement::addBaseParameters(void)
    {
        OverlayContainer::addBaseParameters();
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(ParameterDef("uv_coords",
           "The texture coordinates for the texture. 1 set of uv values."
           , PT_STRING),
           &msCmdUVCoords);

        dict->addParameter(ParameterDef("tiling",
            "The number of times to repeat the background texture."
            , PT_STRING),
            &msCmdTiling);

        dict->addParameter(ParameterDef("transparent",
            "Sets whether the panel is transparent, i.e. invisible itself "
            "but it's contents are still displayed."
            , PT_BOOL),
            &msCmdTransparent);
    }
コード例 #21
0
ファイル: ScaleAffector.cpp プロジェクト: zgpxgame/iEngine
//-----------------------------------------------------------------------
ScaleAffector::ScaleAffector() {
  mScaleAdj = 0;
  mType = "Scaler";

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

    dict->addParameter(ParameterDef("rate",
                                    "The amount by which to adjust the x and y scale components of particles per second.",
                                    PT_REAL), &msScaleCmd);
  }
}
コード例 #22
0
    //-----------------------------------------------------------------------
    ColourImageAffector::ColourImageAffector(ParticleSystem* psys)
        :ParticleAffector(psys), mColourImageLoaded(false)
    {
        mType = "ColourImage";

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

			dict->addParameter(ParameterDef("image", "image where the colours come from", PT_STRING), &msImageCmd);
        }
    }
コード例 #23
0
ファイル: OgreRibbonRenderer.cpp プロジェクト: gitrider/wxsj2
    RibbonRenderer::RibbonRenderer()
        : mRibbonSet(NULL)
        , mWorldSpace(false)
        , mNextRibbonIndex(0)
    {
        if (createParamDictionary("RibbonRenderer"))
        {
            ParamDictionary* dict = getParamDictionary();
            dict->addParameter(ParameterDef("head_alpha", 
                "the alpha value of the head of ribbon.",
                PT_REAL),
                &msRibbonHeadAlphaCmd);

            dict->addParameter(ParameterDef("tail_alpha", 
                "the alpha value of the tail of ribbon.",
                PT_REAL),
                &msRibbonTailAlphaCmd);

            dict->addParameter(ParameterDef("head_width_scale", 
                "the width scale value of the head of ribbon.",
                PT_REAL),
                &msRibbonHeadWidthScaleCmd);

            dict->addParameter(ParameterDef("tail_width_scale", 
                "the width scale value of the tail of ribbon.",
                PT_REAL),
                &msRibbonTailWidthScaleCmd);

            dict->addParameter(ParameterDef("element_count",
                "the element count of the ribbon.",
                PT_UNSIGNED_INT),
                &msRibbonElementCountCmd);
        }

        mRibbonSet = new RibbonSet("", 15);
    }
コード例 #24
0
ファイル: OgreGpuProgram.cpp プロジェクト: whztt07/ogre3d
    //-----------------------------------------------------------------------------
    void GpuProgram::setupBaseParamDictionary(void)
    {
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(
            ParameterDef("type", "'vertex_program', 'geometry_program', 'fragment_program', 'hull_program', 'domain_program', 'compute_program'",
                         PT_STRING), &msTypeCmd);
        dict->addParameter(
            ParameterDef("syntax", "Syntax code, e.g. vs_1_1", PT_STRING), &msSyntaxCmd);
        dict->addParameter(
            ParameterDef("includes_skeletal_animation", 
                         "Whether this vertex program includes skeletal animation", PT_BOOL), 
            &msSkeletalCmd);
        dict->addParameter(
            ParameterDef("includes_morph_animation", 
                         "Whether this vertex program includes morph animation", PT_BOOL), 
            &msMorphCmd);
        dict->addParameter(
            ParameterDef("includes_pose_animation", 
                         "The number of poses this vertex program supports for pose animation", PT_INT),
            &msPoseCmd);
        dict->addParameter(
            ParameterDef("uses_vertex_texture_fetch", 
                         "Whether this vertex program requires vertex texture fetch support.", PT_BOOL), 
            &msVTFCmd);
        dict->addParameter(
            ParameterDef("manual_named_constants", 
                         "File containing named parameter mappings for low-level programs.", PT_BOOL), 
            &msManNamedConstsFileCmd);
        dict->addParameter(
            ParameterDef("uses_adjacency_information",
                         "Whether this geometry program requires adjacency information from the input primitives.", PT_BOOL),
            &msAdjacencyCmd);
        dict->addParameter(
            ParameterDef("compute_group_dimensions",
                         "The number of process groups created by this compute program.", PT_VECTOR3),
            &msComputeGroupDimsCmd);
            
    }
コード例 #25
0
	//-----------------------------------------------------------------------
	//-----------------------------------------------------------------------
	UnifiedHighLevelGpuProgram::UnifiedHighLevelGpuProgram(
		ResourceManager* creator, const String& name, ResourceHandle handle,
		const String& group, bool isManual, ManualResourceLoader* loader)
		:HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
	{
		if (createParamDictionary("UnifiedHighLevelGpuProgram"))
		{
			setupBaseParamDictionary();

			ParamDictionary* dict = getParamDictionary();

			dict->addParameter(ParameterDef("delegate", 
				"Additional delegate programs containing implementations.",
				PT_STRING),&msCmdDelegate);
		}

	}
コード例 #26
0
ファイル: OgreGLSLProgram.cpp プロジェクト: brock7/TianLong
	//-----------------------------------------------------------------------
    GLSLProgram::GLSLProgram(ResourceManager* creator, 
        const String& name, ResourceHandle handle,
        const String& group, bool isManual, ManualResourceLoader* loader)
        : HighLevelGpuProgram(creator, name, handle, group, isManual, loader)
    {
		// add parameter command "attach" to the material serializer dictionary
        if (createParamDictionary("GLSLProgram"))
        {
            setupBaseParamDictionary();
            ParamDictionary* dict = getParamDictionary();

            dict->addParameter(ParameterDef("attach", 
                "name of another GLSL program needed by this program",
                PT_STRING),&msCmdAttach);
        }
        // Manually assign language now since we use it immediately
        mSyntaxCode = "glsl";

		// want scenemanager to pass on surface and light states to the rendersystem
		mPassSurfaceAndLightStates = true;

        
    }
コード例 #27
0
    //---------------------------------------------------------------------
    void TextAreaOverlayElement::addBaseParameters(void)
    {
        OverlayElement::addBaseParameters();
        ParamDictionary* dict = getParamDictionary();

        dict->addParameter(ParameterDef("char_height", 
            "Sets the height of the characters in relation to the screen."
            , PT_REAL),
            &msCmdCharHeight);

        dict->addParameter(ParameterDef("space_width", 
            "Sets the width of a space in relation to the screen."
            , PT_REAL),
            &msCmdSpaceWidth);

        dict->addParameter(ParameterDef("font_name", 
            "Sets the name of the font to use."
            , PT_STRING),
            &msCmdFontName);

        dict->addParameter(ParameterDef("colour", 
            "Sets the colour of the font (a solid colour)."
            , PT_STRING),
            &msCmdColour);

        dict->addParameter(ParameterDef("colour_bottom", 
            "Sets the colour of the font at the bottom (a gradient colour)."
            , PT_STRING),
            &msCmdColourBottom);

        dict->addParameter(ParameterDef("colour_top", 
            "Sets the colour of the font at the top (a gradient colour)."
            , PT_STRING),
            &msCmdColourTop);

        dict->addParameter(ParameterDef("alignment", 
            "Sets the alignment of the text: 'left', 'center' or 'right'."
            , PT_STRING),
            &msCmdAlignment);
    }
コード例 #28
0
    //-----------------------------------------------------------------------
    BillboardParticleRenderer::BillboardParticleRenderer()
    {
        if (createParamDictionary("BillboardParticleRenderer"))
        {
            ParamDictionary* dict = getParamDictionary();
            dict->addParameter(ParameterDef("billboard_type", 
                "The type of billboard to use. 'point' means a simulated spherical particle, " 
                "'oriented_common' means all particles in the set are oriented around common_direction, "
                "'oriented_self' means particles are oriented around their own direction, "
                "'perpendicular_common' means all particles are perpendicular to common_direction, "
                "and 'perpendicular_self' means particles are perpendicular to their own direction.",
                PT_STRING),
                &msBillboardTypeCmd);

            dict->addParameter(ParameterDef("billboard_origin", 
                "This setting controls the fine tuning of where a billboard appears in relation to it's position. "
                "Possible value are: 'top_left', 'top_center', 'top_right', 'center_left', 'center', 'center_right', "
                "'bottom_left', 'bottom_center' and 'bottom_right'. Default value is 'center'.",
                PT_STRING),
                &msBillboardOriginCmd);

            dict->addParameter(ParameterDef("billboard_rotation_type", 
                "This setting controls the billboard rotation type. "
				"'vertex' means rotate the billboard's vertices around their facing direction."
                "'texcoord' means rotate the billboard's texture coordinates. Default value is 'texcoord'.",
                PT_STRING),
                &msBillboardRotationTypeCmd);

            dict->addParameter(ParameterDef("common_direction", 
                "Only useful when billboard_type is oriented_common or perpendicular_common. "
				"When billboard_type is oriented_common, this parameter sets the common orientation for "
				"all particles in the set (e.g. raindrops may all be oriented downwards). "
				"When billboard_type is perpendicular_common, this parameter sets the perpendicular vector for "
				"all particles in the set (e.g. an aureola around the player and parallel to the ground).",
                PT_VECTOR3),
                &msCommonDirectionCmd);

            dict->addParameter(ParameterDef("common_up_vector",
                "Only useful when billboard_type is perpendicular_self or perpendicular_common. This "
				"parameter sets the common up-vector for all particles in the set (e.g. an aureola around "
				"the player and parallel to the ground).",
                PT_VECTOR3),
                &msCommonUpVectorCmd);
            dict->addParameter(ParameterDef("point_rendering",
                "Set whether or not particles will use point rendering "
				"rather than manually generated quads. This allows for faster "
				"rendering of point-oriented particles although introduces some "
				"limitations too such as requiring a common particle size."
				"Possible values are 'true' or 'false'.",
                PT_BOOL),
                &msPointRenderingCmd);
			dict->addParameter(ParameterDef("accurate_facing",
				"Set whether or not particles will be oriented to the camera "
				"based on the relative position to the camera rather than just "
				"the camera direction. This is more accurate but less optimal. "
				"Cannot be combined with point rendering.",
				PT_BOOL),
				&msAccurateFacingCmd);
        }

        // Create billboard set
        mBillboardSet = OGRE_NEW BillboardSet("", 0, true);
        // World-relative axes
        mBillboardSet->setBillboardsInWorldSpace(true);
    }
コード例 #29
0
ファイル: ParticleEmitter.cpp プロジェクト: zgpxgame/iEngine
//-----------------------------------------------------------------------
void ParticleEmitter::addBaseParameters(void) {
  ParamDictionary* dict = getParamDictionary();

  dict->addParameter(ParameterDef("angle",
                                  "The angle up to which particles may vary in their initial direction "
                                  "from the emitters direction, in degrees." , PT_REAL),
                     &msAngleCmd);

  dict->addParameter(ParameterDef("colour",
                                  "The colour of emitted particles.", PT_COLOURVALUE),
                     &msColourCmd);

  dict->addParameter(ParameterDef("colour_range_start",
                                  "The start of a range of colours to be assigned to emitted particles.", PT_COLOURVALUE),
                     &msColourRangeStartCmd);

  dict->addParameter(ParameterDef("colour_range_end",
                                  "The end of a range of colours to be assigned to emitted particles.", PT_COLOURVALUE),
                     &msColourRangeEndCmd);

  dict->addParameter(ParameterDef("direction",
                                  "The base direction of the emitter." , PT_VECTOR3),
                     &msDirectionCmd);

  dict->addParameter(ParameterDef("emission_rate",
                                  "The number of particles emitted per second." , PT_REAL),
                     &msEmissionRateCmd);

  dict->addParameter(ParameterDef("position",
                                  "The position of the emitter relative to the particle system center." , PT_VECTOR3),
                     &msPositionCmd);

  dict->addParameter(ParameterDef("velocity",
                                  "The initial velocity to be assigned to every particle, in world units per second." , PT_REAL),
                     &msVelocityCmd);

  dict->addParameter(ParameterDef("velocity_min",
                                  "The minimum initial velocity to be assigned to each particle." , PT_REAL),
                     &msMinVelocityCmd);

  dict->addParameter(ParameterDef("velocity_max",
                                  "The maximum initial velocity to be assigned to each particle." , PT_REAL),
                     &msMaxVelocityCmd);

  dict->addParameter(ParameterDef("time_to_live",
                                  "The lifetime of each particle in seconds." , PT_REAL),
                     &msTTLCmd);

  dict->addParameter(ParameterDef("time_to_live_min",
                                  "The minimum lifetime of each particle in seconds." , PT_REAL),
                     &msMinTTLCmd);

  dict->addParameter(ParameterDef("time_to_live_max",
                                  "The maximum lifetime of each particle in seconds." , PT_REAL),
                     &msMaxTTLCmd);

  dict->addParameter(ParameterDef("duration",
                                  "The length of time in seconds which an emitter stays enabled for." , PT_REAL),
                     &msDurationCmd);

  dict->addParameter(ParameterDef("duration_min",
                                  "The minimum length of time in seconds which an emitter stays enabled for." , PT_REAL),
                     &msMinDurationCmd);

  dict->addParameter(ParameterDef("duration_max",
                                  "The maximum length of time in seconds which an emitter stays enabled for." , PT_REAL),
                     &msMaxDurationCmd);

  dict->addParameter(ParameterDef("repeat_delay",
                                  "If set, after disabling an emitter will repeat (reenable) after this many seconds." , PT_REAL),
                     &msRepeatDelayCmd);

  dict->addParameter(ParameterDef("repeat_delay_min",
                                  "If set, after disabling an emitter will repeat (reenable) after this minimum number of seconds." , PT_REAL),
                     &msMinRepeatDelayCmd);

  dict->addParameter(ParameterDef("repeat_delay_max",
                                  "If set, after disabling an emitter will repeat (reenable) after this maximum number of seconds." , PT_REAL),
                     &msMaxRepeatDelayCmd);
}
コード例 #30
0
    PolarEmitter::PolarEmitter(ParticleSystem* psys)
        : ParticleEmitter(psys)
		, mRadiusMin(0.0f)
		, mRadiusStep(0.0f)
		, mRadiusMax(0.0f)
	    , mThetaMin(0.0f)
		, mThetaStep(0.0f)
		, mThetaMax(0.0f)
	    , mPhiMin(0.0f)
	    , mPhiStep(0.0f)
		, mPhiMax(0.0f)
		, mThetaTotal(0.0f)
		, mPhiTotal(0.0f)
		, mRadiusTotal(0.0f)
		, mUsePolarStep(false)
		, mFlipYZAxis(false)
        , mResetRadiusCount(0)
        , mResetRadius(false)
        , mCurrentResetRadiusCount(0)

    {
        mType = "PolarEmitter";

        // Set up parameters
        if (createParamDictionary("PolarEmitter"))
        {
            addBaseParameters();

            // Add extra paramaters
            ParamDictionary* dict = getParamDictionary();
            dict->addParameter(ParameterDef("radius_start", 
                "The vector representing the force to apply.",
                PT_REAL),&msRadiusMinCmd);

			dict->addParameter(ParameterDef("radius_step", 
				"The vector representing the force to apply.",
				PT_REAL),&msRadiusStepCmd);

			dict->addParameter(ParameterDef("radius_end", 
				"The vector representing the force to apply.",
				PT_REAL),&msRadiusMaxCmd);

            dict->addParameter(ParameterDef("theta_start", 
                "The vector representing the force to apply.",
                PT_REAL),&msThetaMinCmd);

            dict->addParameter(ParameterDef("theta_step", 
                "The vector representing the force to apply.",
                PT_REAL),&msThetaStepCmd);

			dict->addParameter(ParameterDef("theta_end", 
				"The vector representing the force to apply.",
				PT_REAL),&msThetaMaxCmd);

			dict->addParameter(ParameterDef("phi_start", 
				"The vector representing the force to apply.",
				PT_REAL),&msPhiMinCmd);

            dict->addParameter(ParameterDef("phi_step", 
                "The vector representing the force to apply.",
                PT_REAL),&msPhiStepCmd);

			dict->addParameter(ParameterDef("phi_end", 
				"The vector representing the force to apply.",
				PT_REAL),&msPhiMaxCmd);

			dict->addParameter(ParameterDef("use_polar_step", 
				"The vector representing the force to apply.",
				PT_BOOL),&msUsePolarStepCmd);

			dict->addParameter(ParameterDef("flip_yz_axis", 
				"The vector representing the force to apply.",
				PT_BOOL),&msFlipYZAxisCmd);

            dict->addParameter(ParameterDef("reset_radius_count", 
                "when you use the radius step, this value can control the radius reset"
                "by emitting reset_radius_count particles.",
                PT_INT),&msResetRadiusCountCmd);

            dict->addParameter(ParameterDef("reset_radius", 
                "when you use the radius step, this value can control the radius reset.",
                PT_BOOL),&msResetRadiusCmd);
        }
    }