Beispiel #1
0
void LightBase::initPersistFields()
{
   // We only add the basic lighting options that all lighting
   // systems would use... the specific lighting system options
   // are injected at runtime by the lighting system itself.

   addGroup( "Light" );
      
      addField( "isEnabled", TypeBool, Offset( mIsEnabled, LightBase ), "Enables/Disables the object rendering and functionality in the scene." );
      addField( "color", TypeColorF, Offset( mColor, LightBase ), "Changes the base color hue of the light." );
      addField( "brightness", TypeF32, Offset( mBrightness, LightBase ), "Adjusts the lights power, 0 being off completely." );      
      addField( "castShadows", TypeBool, Offset( mCastShadows, LightBase ), "Enables/disabled shadow casts by this light." );
      addField( "staticRefreshFreq", TypeS32, Offset( mStaticRefreshFreq, LightBase ), "static shadow refresh rate (milliseconds)" );
      addField( "dynamicRefreshFreq", TypeS32, Offset( mDynamicRefreshFreq, LightBase ), "dynamic shadow refresh rate (milliseconds)" );
      addField( "priority", TypeF32, Offset( mPriority, LightBase ), "Used for sorting of lights by the light manager. "
		  "Priority determines if a light has a stronger effect than, those with a lower value" );

   endGroup( "Light" );

   addGroup( "Light Animation" );

      addField( "animate", TypeBool, Offset( mAnimState.active, LightBase ), "Toggles animation for the light on and off" );
      addField( "animationType", TYPEID< LightAnimData >(), Offset( mAnimationData, LightBase ), "Datablock containing light animation information (LightAnimData)" );
      addFieldV( "animationPeriod", TypeF32, Offset( mAnimState.animationPeriod, LightBase ), &CommonValidators::PositiveNonZeroFloat, "The length of time in seconds for a single playback of the light animation (must be > 0)" );
      addField( "animationPhase", TypeF32, Offset( mAnimState.animationPhase, LightBase ), "The phase used to offset the animation start time to vary the animation of nearby lights." );      

   endGroup( "Light Animation" );

   addGroup( "Misc" );

      addField( "flareType", TYPEID< LightFlareData >(), Offset( mFlareData, LightBase ), "Datablock containing light flare information (LightFlareData)" );
      addField( "flareScale", TypeF32, Offset( mFlareScale, LightBase ), "Globally scales all features of the light flare" );

   endGroup( "Misc" );

   // Now inject any light manager specific fields.
   LightManager::initLightFields();

   // We do the parent fields at the end so that
   // they show up that way in the inspector.
   Parent::initPersistFields();

   Con::addVariable( "$Light::renderViz", TypeBool, &smRenderViz,
      "Toggles visualization of light object's radius or cone.\n"
	   "@ingroup Lighting");

   Con::addVariable( "$Light::renderLightFrustums", TypeBool, &LightShadowMap::smDebugRenderFrustums,
      "Toggles rendering of light frustums when the light is selected in the editor.\n\n"
      "@note Only works for shadow mapped lights.\n\n"
      "@ingroup Lighting" );
}
//-----------------------------------------------------------------------------
// initPersistFields
//-----------------------------------------------------------------------------
void ParticleData::initPersistFields()
{
   addFieldV( "dragCoefficient", TYPEID< F32 >(), Offset(dragCoefficient, ParticleData), &dragCoefFValidator,
      "Particle physics drag amount." );
   addField( "windCoefficient", TYPEID< F32 >(), Offset(windCoefficient, ParticleData),
      "Strength of wind on the particles." );
   addFieldV( "gravityCoefficient", TYPEID< F32 >(), Offset(gravityCoefficient, ParticleData), &gravCoefFValidator,
      "Strength of gravity on the particles." );
   addFieldV( "inheritedVelFactor", TYPEID< F32 >(), Offset(inheritedVelFactor, ParticleData), &CommonValidators::NormalizedFloat,
      "Amount of emitter velocity to add to particle initial velocity." );
   addField( "constantAcceleration", TYPEID< F32 >(), Offset(constantAcceleration, ParticleData),
      "Constant acceleration to apply to this particle." );
   addField( "lifetimeMS", TYPEID< S32 >(), Offset(lifetimeMS, ParticleData),
      "Time in milliseconds before this particle is destroyed." );
   addField( "lifetimeVarianceMS", TYPEID< S32 >(), Offset(lifetimeVarianceMS, ParticleData),
      "Variance in lifetime of particle, from 0 - lifetimeMS." );
   addField( "spinSpeed", TYPEID< F32 >(), Offset(spinSpeed, ParticleData),
      "Speed at which to spin the particle." );
   addFieldV( "spinRandomMin", TYPEID< F32 >(), Offset(spinRandomMin, ParticleData), &spinRandFValidator,
      "Minimum allowed spin speed of this particle, between -1000 and spinRandomMax." );
   addFieldV( "spinRandomMax", TYPEID< F32 >(), Offset(spinRandomMax, ParticleData), &spinRandFValidator,
      "Maximum allowed spin speed of this particle, between spinRandomMin and 1000." );
   addField( "useInvAlpha", TYPEID< bool >(), Offset(useInvAlpha, ParticleData),
      "@brief Controls how particles blend with the scene.\n\n"
      "If true, particles blend like ParticleBlendStyle NORMAL, if false, "
      "blend like ParticleBlendStyle ADDITIVE.\n"
      "@note If ParticleEmitterData::blendStyle is set, it will override this value." );
   addField( "animateTexture", TYPEID< bool >(), Offset(animateTexture, ParticleData),
      "If true, allow the particle texture to be an animated sprite." );
   addField( "framesPerSec", TYPEID< S32 >(), Offset(framesPerSec, ParticleData),
      "If animateTexture is true, this defines the frames per second of the "
      "sprite animation." );

   addField( "textureCoords", TYPEID< Point2F >(), Offset(texCoords, ParticleData),  4,
      "@brief 4 element array defining the UV coords into textureName to use "
      "for this particle.\n\n"
      "Coords should be set for the first tile only when using animTexTiling; "
      "coordinates for other tiles will be calculated automatically. \"0 0\" is "
      "top left and \"1 1\" is bottom right." );
   addField( "animTexTiling", TYPEID< Point2I >(), Offset(animTexTiling, ParticleData),
      "@brief The number of frames, in rows and columns stored in textureName "
      "(when animateTexture is true).\n\n"
      "A maximum of 256 frames can be stored in a single texture when using "
      "animTexTiling. Value should be \"NumColumns NumRows\", for example \"4 4\"." );
   addField( "animTexFrames", TYPEID< StringTableEntry >(), Offset(animTexFramesString,ParticleData),
      "@brief A list of frames and/or frame ranges to use for particle "
      "animation if animateTexture is true.\n\n"
      "Each frame token must be separated by whitespace. A frame token must be "
      "a positive integer frame number or a range of frame numbers separated "
      "with a '-'. The range separator, '-', cannot have any whitspace around "
      "it.\n\n"
      "Ranges can be specified to move through the frames in reverse as well "
      "as forward (eg. 19-14). Frame numbers exceeding the number of tiles will "
      "wrap.\n"
      "@tsexample\n"
      "animTexFrames = \"0-16 20 19 18 17 31-21\";\n"
      "@endtsexample\n" );

   addField( "textureName", TYPEID< StringTableEntry >(), Offset(textureName, ParticleData),
      "Texture file to use for this particle." );
   addField( "animTexName", TYPEID< StringTableEntry >(), Offset(textureName, ParticleData),
      "@brief Texture file to use for this particle if animateTexture is true.\n\n"
      "Deprecated. Use textureName instead." );

   // Interpolation variables
   addField( "colors", TYPEID< ColorF >(), Offset(colors, ParticleData), PDC_NUM_KEYS,
      "@brief Particle RGBA color keyframe values.\n\n"
      "The particle color will linearly interpolate between the color/time keys "
      "over the lifetime of the particle." );
   addProtectedField( "sizes", TYPEID< F32 >(), Offset(sizes, ParticleData), &protectedSetSizes, 
      &defaultProtectedGetFn, PDC_NUM_KEYS,
      "@brief Particle size keyframe values.\n\n"
      "The particle size will linearly interpolate between the size/time keys "
      "over the lifetime of the particle." );
   addProtectedField( "times", TYPEID< F32 >(), Offset(times, ParticleData), &protectedSetTimes, 
      &defaultProtectedGetFn, PDC_NUM_KEYS,
      "@brief Time keys used with the colors and sizes keyframes.\n\n"
      "Values are from 0.0 (particle creation) to 1.0 (end of lifespace)." );

   Parent::initPersistFields();
}
Beispiel #3
0
   void NavMesh::initPersistFields()
   {
      addGroup("NavMesh Build");

      addField("saveIntermediates", TypeBool, Offset(mSaveIntermediates, NavMesh),
         "Store intermediate results for debug rendering.");

      addField("buildThreaded", TypeBool, Offset(mBuildThreaded, NavMesh),
         "Does this NavMesh build in a separate thread?");

      addProtectedField("build", TypeBool, NULL,
         &editorBuildFlag, &getBuild,
         "Check this box to build the NavMesh.");

      endGroup("NavMesh Build");

      addGroup("NavMesh Options");

      addField("fileName", TypeString, Offset(mFileName, NavMesh),
         "Name of the data file to store this navmesh in (relative to engine executable).");

      addFieldV("borderSize", TypeS32, Offset(mBorderSize, NavMesh), &PositiveInt,
         "Size of the non-walkable border around the navigation mesh (in voxels).");

      addFieldV("cellSize", TypeF32, Offset(mCellSize, NavMesh), &ValidCellSize,
         "Length/width of a voxel.");
      addFieldV("cellHeight", TypeF32, Offset(mCellHeight, NavMesh), &ValidCellSize,
         "Height of a voxel.");

      addFieldV("actorHeight", TypeF32, Offset(mWalkableHeight, NavMesh), &CommonValidators::PositiveFloat,
         "Height of an actor.");
      addFieldV("actorClimb", TypeF32, Offset(mWalkableClimb, NavMesh), &CommonValidators::PositiveFloat,
         "Maximum climbing height of an actor.");
      addFieldV("actorRadius", TypeF32, Offset(mWalkableRadius, NavMesh), &CommonValidators::PositiveFloat,
         "Radius of an actor.");
      addFieldV("walkableSlope", TypeF32, Offset(mWalkableSlope, NavMesh), &ValidSlopeAngle,
         "Maximum walkable slope in degrees.");

      endGroup("NavMesh Options");

      addGroup("NavMesh Advanced Options");

      addProtectedField("detailSampleDist", TypeF32, Offset(mDetailSampleDist, NavMesh),
         &setProtectedDetailSampleDist, &defaultProtectedGetFn,
         "Sets the sampling distance to use when generating the detail mesh.");
      addFieldV("detailSampleError", TypeF32, Offset(mDetailSampleMaxError, NavMesh), &CommonValidators::PositiveFloat,
         "The maximum distance the detail mesh surface should deviate from heightfield data.");
      addFieldV("maxEdgeLen", TypeS32, Offset(mDetailSampleDist, NavMesh), &PositiveInt,
         "The maximum allowed length for contour edges along the border of the mesh.");
      addFieldV("simplificationError", TypeF32, Offset(mMaxSimplificationError, NavMesh), &CommonValidators::PositiveFloat,
         "The maximum distance a simplfied contour's border edges should deviate from the original raw contour.");
      addFieldV("minRegionArea", TypeS32, Offset(mMinRegionArea, NavMesh), &PositiveInt,
         "The minimum number of cells allowed to form isolated island areas.");
      addFieldV("mergeRegionArea", TypeS32, Offset(mMergeRegionArea, NavMesh), &PositiveInt,
         "Any regions with a span count smaller than this value will, if possible, be merged with larger regions.");
      addFieldV("tileSize", TypeS32, Offset(mTileSize, NavMesh), &PositiveInt,
         "The horizontal size of tiles.");

      endGroup("NavMesh Advanced Options");

      addGroup("NavMesh Rendering");

      addField("renderMode", TYPEID<RenderMode>(), Offset(mRenderMode, NavMesh),
         "Sets the rendering mode of this navmesh.");
      addField("renderInput", TypeBool, Offset(mRenderInput, NavMesh),
         "Render the input geometry used to create the mesh.");
      addField("renderConnections", TypeBool, Offset(mRenderConnections, NavMesh),
         "Render the connections between regions in the mesh.");

      endGroup("NavMesh Rendering");

      Parent::initPersistFields();
   }
Beispiel #4
0
void NavPath::initPersistFields()
{
   addGroup("NavPath");

   addProtectedField("from", TypePoint3F, Offset(mFrom, NavPath),
      &setProtectedFrom, &getProtectedFrom,
      "World location this path starts at.");
   addProtectedField("to", TypePoint3F, Offset(mTo, NavPath),
      &setProtectedTo, &getProtectedTo,
      "World location this path should end at.");

   addProtectedField("mesh", TypeRealString, Offset(mMeshName, NavPath),
      &setProtectedMesh, &defaultProtectedGetFn,
      "Name of the NavMesh object this path travels within.");
   addProtectedField("waypoints", TYPEID<SimPath::Path>(), Offset(mWaypoints, NavPath),
      &setProtectedWaypoints, &defaultProtectedGetFn,
      "Path containing waypoints for this NavPath to visit.");

   addField("isLooping", TypeBool, Offset(mIsLooping, NavPath),
      "Does this path loop?");
   addField("isSliced", TypeBool, Offset(mIsSliced, NavPath),
      "Plan this path over multiple updates instead of all at once.");
   addFieldV("maxIterations", TypeS32, Offset(mMaxIterations, NavPath), &ValidIterations,
      "Maximum iterations of path planning this path does per tick.");
   addProtectedField("autoUpdate", TypeBool, Offset(mAutoUpdate, NavPath),
      &setProtectedAutoUpdate, &defaultProtectedGetFn,
      "If set, this path will automatically replan when its navigation mesh changes.");

   endGroup("NavPath");

   addGroup("Flags");

   addField("allowWalk", TypeBool, Offset(mLinkTypes.walk, NavPath),
      "Allow the path to use dry land.");
   addField("allowJump", TypeBool, Offset(mLinkTypes.jump, NavPath),
      "Allow the path to use jump links.");
   addField("allowDrop", TypeBool, Offset(mLinkTypes.drop, NavPath),
      "Allow the path to use drop links.");
   addField("allowSwim", TypeBool, Offset(mLinkTypes.swim, NavPath),
      "Allow the path tomove in water.");
   addField("allowLedge", TypeBool, Offset(mLinkTypes.ledge, NavPath),
      "Allow the path to jump ledges.");
   addField("allowClimb", TypeBool, Offset(mLinkTypes.climb, NavPath),
      "Allow the path to use climb links.");
   addField("allowTeleport", TypeBool, Offset(mLinkTypes.teleport, NavPath),
      "Allow the path to use teleporters.");

   endGroup("Flags");

   addGroup("NavPath Render");

   addField("alwaysRender", TypeBool, Offset(mAlwaysRender, NavPath),
      "Render this NavPath even when not selected.");
   addField("xray", TypeBool, Offset(mXray, NavPath),
      "Render this NavPath through other objects.");
   addField("renderSearch", TypeBool, Offset(mRenderSearch, NavPath),
      "Render the closed list of this NavPath's search.");

   endGroup("NavPath Render");

   Parent::initPersistFields();
}