BulletSpeedOperator::BulletSpeedOperator(BulletEventSystem* eventSystem) : BulletOperator(),
		m_isOperated(false)
	{
		m_type = "speed";
		m_parent = eventSystem;
		
		m_direction = Ogre::Vector3::ZERO;
		m_speed = 0.0;

		if (createParamDictionary("BulletSpeedOperator"))
        {
			Ogre::ParamDictionary* dict = getParamDictionary();
			dict->addParameter(Ogre::ParameterDef("mode", 
				"The mode of bullet speed operator.",
				Ogre::PT_STRING),&ms_modeCmd);	  

			dict->addParameter(Ogre::ParameterDef("direction", 
				"The direction of bullet speed operator.",
				Ogre::PT_VECTOR3),&ms_directionCmd);	

			dict->addParameter(Ogre::ParameterDef("speed", 
				"The speed of bullet speed operator.",
				Ogre::PT_REAL),&ms_speedCmd);	

		}
	}
示例#2
0
LogFile::LogFile(Ogre::ResourceManager *creator, const Ogre::String &name, Ogre::ResourceHandle handle, const Ogre::String &group, bool isManual, Ogre::ManualResourceLoader *loader)
    : Ogre::Resource(creator, name, handle, group, isManual, loader)
{
    /* If you were storing a pointer to an object, then you would set that pointer to NULL here.
         */
    createParamDictionary("LogFile");
}
	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);
		}
	}
示例#4
0
EntityRecipe::EntityRecipe(Ogre::ResourceManager* creator, const Ogre::String& name, Ogre::ResourceHandle handle, const Ogre::String& group, bool isManual, Ogre::ManualResourceLoader* loader) :
	Resource(creator, name, handle, group, isManual, loader), mEntitySpec(0)
{
	if (createParamDictionary("EntityRecipe")) {
		// no custom params
	}
}
    //-----------------------------------------------------------------------
    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);			
		}
    }
    //---------------------------------------------------------------------
    PanelOverlayElement::PanelOverlayElement(const String& name)
        : OverlayContainer(name)
        , mTransparent(false)
        // Defer creation of texcoord buffer until we know how big it needs to be
        , mNumTexCoordsInBuffer(0)
        , mU1(0.0)
        , mV1(0.0)
        , mU2(1.0)
        , mV2(1.0)

    {
        // Init tiling
        for (ushort i = 0; i < OGRE_MAX_TEXTURE_COORD_SETS; ++i)
        {
            mTileX[i] = 1.0f;
            mTileY[i] = 1.0f;
        }

        // No normals or colours
        if (createParamDictionary("PanelOverlayElement"))
        {
            addBaseParameters();
        }

    }
示例#7
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;
    }
示例#8
0
    /** Default constructor. */
    GravityAffector(Ogre::ParticleSystem *psys)
      : ParticleAffector(psys)
      , mForce(0.0f)
      , mForceType(Type_Wind)
      , mPosition(0.0f)
      , mDirection(0.0f)
    {
        mType = "Gravity";

        // Init parameters
        if(createParamDictionary("GravityAffector"))
        {
            Ogre::ParamDictionary *dict = getParamDictionary();

            Ogre::String force_title("force");
            Ogre::String force_descr("Amount of force applied to particles.");
            Ogre::String force_type_title("force_type");
            Ogre::String force_type_descr("Type of force applied to particles (point or wind).");
            Ogre::String direction_title("direction");
            Ogre::String direction_descr("Direction of wind forces.");
            Ogre::String position_title("position");
            Ogre::String position_descr("Position of point forces.");

            dict->addParameter(Ogre::ParameterDef(force_title, force_descr, Ogre::PT_REAL), &msForceCmd);
            dict->addParameter(Ogre::ParameterDef(force_type_title, force_type_descr, Ogre::PT_STRING), &msForceTypeCmd);
            dict->addParameter(Ogre::ParameterDef(direction_title, direction_descr, Ogre::PT_VECTOR3), &msDirectionCmd);
            dict->addParameter(Ogre::ParameterDef(position_title, position_descr, Ogre::PT_VECTOR3), &msPositionCmd);
        }
    }
    //---------------------------------------------------------------------
	bool AnimationEffectInfo::initParamDictionary(void)
	{
		if (createParamDictionary("AnimationEffectInfo"))
		{
			Ogre::ParamDictionary* dict = getParamDictionary();			

			dict->addParameter(Ogre::ParameterDef("AttachTime", 
				"the time that showing the effect.",
				Ogre::PT_REAL),&msAttachTimeCmd);	  

			dict->addParameter(Ogre::ParameterDef("AttachPoint", 
				"the attached bone or locator.",
				Ogre::PT_STRING),&msAttachPointCmd);	  

			dict->addParameter(Ogre::ParameterDef("EffectTemplateName", 
				"name of effect template.",
				Ogre::PT_STRING),&msEffectTemplateNameCmd);	  

			dict->addParameter(Ogre::ParameterDef("OffsetPos", 
				"offset position to the attach point.",
				Ogre::PT_VECTOR3),&msOffsetPosCmd);	  

			dict->addParameter(Ogre::ParameterDef("OffsetRotation", 
				"offset orientation to the attach point.",
				Ogre::PT_QUATERNION),&msOffsetRotationCmd);	  

			dict->addParameter(Ogre::ParameterDef("Attach", 
				"whether the effect will move along with the attach point.",
				Ogre::PT_BOOL),&msAttachCmd);	  

			return true;
		}

		return false;
	}
示例#10
0
    //-----------------------------------------------------------------------
    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);
        }
    }
示例#11
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();
	}
    //-----------------------------------------------------------------------
    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]);
			}
        }
    }
示例#13
0
	//---------------------------------------------------------------------
	bool Skill::initParamDictionary(void)
	{
		if (createParamDictionary("Skill"))
		{
			Ogre::ParamDictionary* dict = getParamDictionary();			

			dict->addParameter(Ogre::ParameterDef("Animation", 
				"name of animation.",
				Ogre::PT_STRING),&msAnimationNameCmd);	  

			dict->addParameter(Ogre::ParameterDef("BreakTime", 
				"the break time of skill.",
				Ogre::PT_STRING),&msBreakTimeCmd);	  

			dict->addParameter(Ogre::ParameterDef("HitTime", 
				"the hit time of skill.",
				Ogre::PT_STRING),&msHitTimeCmd);	  

			dict->addParameter(Ogre::ParameterDef("ShakeTime", 
				"the shake time of skill.",
				Ogre::PT_STRING),&msShakeTimeCmd);	 

            dict->addParameter(Ogre::ParameterDef("RepeatEffect", 
                "whether recreate effect when the animation is loop.",
                Ogre::PT_BOOL),&msRepeatEffectCmd);	  

			return true;
		}

		return false;
	}
    //-----------------------------------------------------------------------
    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);
        }
    }
    AnimationSceneLightInfo::AnimationSceneLightInfo(void) :
    mAttachTime(0.0f),
    mLastTime(0.0f),
    mFadeInTime(0.0f),
    mFadeOutTime(0.0f),
    mDestColour(Ogre::ColourValue::Black)
    {
        if (createParamDictionary("AnimationSceneLightInfo"))
        {
            Ogre::ParamDictionary* dict = getParamDictionary();

            dict->addParameter(Ogre::ParameterDef("AttachTime", 
                "the time that starting changing the light.",
                Ogre::PT_REAL),&msAttachTimeCmd);	

            dict->addParameter(Ogre::ParameterDef("LastTime", 
                "the last time that changing the light.",
                Ogre::PT_REAL),&msLastTimeCmd);			

            dict->addParameter(Ogre::ParameterDef("FadeInTime", 
                "the fade in time.",
                Ogre::PT_REAL),&msFadeInTimeCmd);

            dict->addParameter(Ogre::ParameterDef("FadeOutTime", 
                "the fade out time.",
                Ogre::PT_REAL),&msFadeOutTimeCmd);

            dict->addParameter(Ogre::ParameterDef("DestColour", 
                "the dest colour of light.",
                Ogre::PT_COLOURVALUE),&msDestColourCmd);
        }
    }
	//---------------------------------------------------------------------
	bool EffectElement::initDefaults(const String &mType)
	{		
		if (createParamDictionary(mType + "EffectElement"))
		{
			Ogre::ParamDictionary* dict = getParamDictionary();

			dict->addParameter(Ogre::ParameterDef("StartTime", 
				"the start time of this element.",
				Ogre::PT_REAL),&msStartTimeCmd);

			dict->addParameter(Ogre::ParameterDef("LifeTime", 
				"the life time of this element.",
				Ogre::PT_REAL),&msLifeTimeCmd);

			dict->addParameter(Ogre::ParameterDef("Position", 
				"the relative pos from parent.",
				Ogre::PT_VECTOR3),&msRelPosCmd);

            dict->addParameter(Ogre::ParameterDef("Orientation", 
                "the relative orientation from parent.",
                Ogre::PT_QUATERNION),&msRelOrientationCmd);

			return true;

		}
		return false;
	}
示例#17
0
ModelDefinition::ModelDefinition(Ogre::ResourceManager* creator, const Ogre::String& name, Ogre::ResourceHandle handle, const Ogre::String& group, bool isManual, Ogre::ManualResourceLoader* loader) :
    Resource(creator, name, handle, group, isManual, loader), mRenderingDistance(0.0f), mUseScaleOf(MODEL_ALL), mScale(0), mRotation(Ogre::Quaternion::IDENTITY), mContentOffset(Ogre::Vector3::ZERO), mShowContained(true), mTranslate(0, 0, 0), mIsValid(false), mRenderingDef(0)
{
    if (createParamDictionary("ModelDefinition")) {
        // no custom params
    }
}
    //-----------------------------------------------------------------------
    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);
        }
    }
示例#19
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);

        }

    }
示例#20
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";
}
	//-----------------------------------------------------------------------
	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?");
	}
示例#22
0
    //-----------------------------------------------------------------------
	Material::Material(ResourceManager* creator, const String& name, ResourceHandle handle,
		const String& group, bool isManual, ManualResourceLoader* loader)
		:Resource(creator, name, handle, group, isManual, loader),
         mReceiveShadows(true),
         mTransparencyCastsShadows(false),
         mCompilationRequired(true)
    {
		// Override isManual, not applicable for Material (we always want to call loadImpl)
		if(isManual)
		{
			mIsManual = false;
			LogManager::getSingleton().logMessage("Material " + name + 
				" was requested with isManual=true, but this is not applicable " 
				"for materials; the flag has been reset to false");
		}

		// Initialise to default strategy
		mLodStrategy = LodStrategyManager::getSingleton().getDefaultStrategy();

		mLodValues.push_back(0.0f);

		applyDefaults();

		/* For consistency with StringInterface, but we don't add any parameters here
		That's because the Resource implementation of StringInterface is to
		list all the options that need to be set before loading, of which 
		we have none as such. Full details can be set through scripts.
		*/ 
		createParamDictionary("Material");
    }
示例#23
0
    /** Default constructor. */
    GravityAffector(Ogre::ParticleSystem *psys)
      : ParticleAffector(psys)
      , mForce(0.0f)
      , mForceType(Type_Wind)
      , mPosition(0.0f)
      , mDirection(0.0f)
    {
        std::vector<Ogre::Bone*> bones = Ogre::any_cast<NiNodeHolder>(psys->getUserObjectBindings().getUserAny()).mBones;
        assert (!bones.empty());
        mEmitterBone = bones[0];
        Ogre::TagPoint* tag = static_cast<Ogre::TagPoint*>(mParent->getParentNode());
        mParticleBone = static_cast<Ogre::Bone*>(tag->getParent());

        mType = "Gravity";

        // Init parameters
        if(createParamDictionary("GravityAffector"))
        {
            Ogre::ParamDictionary *dict = getParamDictionary();

            Ogre::String force_title("force");
            Ogre::String force_descr("Amount of force applied to particles.");
            Ogre::String force_type_title("force_type");
            Ogre::String force_type_descr("Type of force applied to particles (point or wind).");
            Ogre::String direction_title("direction");
            Ogre::String direction_descr("Direction of wind forces.");
            Ogre::String position_title("position");
            Ogre::String position_descr("Position of point forces.");

            dict->addParameter(Ogre::ParameterDef(force_title, force_descr, Ogre::PT_REAL), &msForceCmd);
            dict->addParameter(Ogre::ParameterDef(force_type_title, force_type_descr, Ogre::PT_STRING), &msForceTypeCmd);
            dict->addParameter(Ogre::ParameterDef(direction_title, direction_descr, Ogre::PT_VECTOR3), &msDirectionCmd);
            dict->addParameter(Ogre::ParameterDef(position_title, position_descr, Ogre::PT_VECTOR3), &msPositionCmd);
        }
    }
示例#24
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);
		}

	}
示例#25
0
	//-----------------------------------------------------------------------
	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);
		}
		
	}
示例#26
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);


        }
    }
示例#27
0
 //---------------------------------------------------------------------
 PFile::PFile( Ogre::ResourceManager *creator
              ,const String &name, Ogre::ResourceHandle handle
              ,const String &group, bool isManual
              ,Ogre::ManualResourceLoader *loader ) :
     Ogre::Resource( creator, name, handle, group, isManual, loader )
 {
     createParamDictionary( RESOURCE_TYPE );
 }
示例#28
0
GLGpuProgram::GLGpuProgram(ResourceManager* creator, const String& name, 
    ResourceHandle handle, const String& group, bool isManual, 
    ManualResourceLoader* loader) 
    : GpuProgram(creator, name, handle, group, isManual, loader)
{
    if (createParamDictionary("GLGpuProgram"))
    {
        setupBaseParamDictionary();
    }
}
示例#29
0
 //--------------------------------------------------------------------------
 FLevelFile::FLevelFile( Ogre::ResourceManager *creator
              ,const String &name, Ogre::ResourceHandle handle
              ,const String &group, bool isManual
              ,Ogre::ManualResourceLoader *loader ) :
     Resource( creator, name, handle, group, isManual, loader )
    ,m_background_texture_loader( NULL )
    ,m_background_2d_loader( NULL )
 {
     createParamDictionary( getResourceType() );
 }
示例#30
0
 //-----------------------------------------------------------------------------
 D3D11GpuProgram::D3D11GpuProgram(ResourceManager* creator, const String& name, ResourceHandle handle,
     const String& group, bool isManual, ManualResourceLoader* loader, D3D11Device & device) 
     : GpuProgram(creator, name, handle, group, isManual, loader), 
     mDevice(device)
 {
     if (createParamDictionary("D3D11GpuProgram"))
     {
         setupBaseParamDictionary();
     }
 }