void Settings::Save(const QString& prefix, const QString& key, const QVariant& value)
{
	beginGroup(prefix);
	setValue(key, value);
	endGroup();
}
void GFXSamplerStateData::initPersistFields()
{
   Parent::initPersistFields();

   addGroup( "Color Op" );

      addField("textureColorOp", TypeGFXTextureOp, Offset(mState.textureColorOp, GFXSamplerStateData),
         "The texture color blending operation.  The default value is GFXTOPDisable which disables the sampler." );

      addField("colorArg1", TYPEID< GFXTextureArgument >(), Offset(mState.colorArg1, GFXSamplerStateData),
         "The first color argument for the texture stage.  The default value is GFXTACurrent." );

      addField("colorArg2", TYPEID< GFXTextureArgument >(), Offset(mState.colorArg2, GFXSamplerStateData),
         "The second color argument for the texture stage.  The default value is GFXTATexture." );

      addField("colorArg3", TYPEID< GFXTextureArgument >(), Offset(mState.colorArg3, GFXSamplerStateData),
         "The third color argument for triadic operations (multiply, add, and linearly interpolate).  The default value is GFXTACurrent." );

   endGroup( "Color Op" );

   addGroup( "Alpha Op" );

      addField("alphaOp", TypeGFXTextureOp, Offset(mState.alphaOp, GFXSamplerStateData),
         "The texture alpha blending operation.  The default value is GFXTOPModulate." );

      addField("alphaArg1", TYPEID< GFXTextureArgument >(), Offset(mState.alphaArg1, GFXSamplerStateData),
         "The first alpha argument for the texture stage.  The default value is GFXTATexture." );

      addField("alphaArg2", TYPEID< GFXTextureArgument >(), Offset(mState.alphaArg2, GFXSamplerStateData),
         "The second alpha argument for the texture stage.  The default value is GFXTADiffuse." );

      addField("alphaArg3", TYPEID< GFXTextureArgument >(), Offset(mState.alphaArg3, GFXSamplerStateData),
         "The third alpha channel selector operand for triadic operations (multiply, add, and linearly interpolate).  The default value is GFXTACurrent." );

   endGroup( "Alpha Op" );

   addGroup( "Address Mode" );

      addField("addressModeU", TypeGFXTextureAddressMode, Offset(mState.addressModeU, GFXSamplerStateData),
         "The texture address mode for the u coordinate.  The default is GFXAddressWrap." );

      addField("addressModeV", TypeGFXTextureAddressMode, Offset(mState.addressModeV, GFXSamplerStateData),
         "The texture address mode for the v coordinate.  The default is GFXAddressWrap." );

      addField("addressModeW", TypeGFXTextureAddressMode, Offset(mState.addressModeW, GFXSamplerStateData),
         "The texture address mode for the w coordinate.  The default is GFXAddressWrap." );

   endGroup( "Address Mode" );

   addGroup( "Filter State" );

      addField("magFilter", TypeGFXTextureFilterType, Offset(mState.magFilter, GFXSamplerStateData),
         "The texture magnification filter.  The default is GFXTextureFilterLinear." );

      addField("minFilter", TypeGFXTextureFilterType, Offset(mState.minFilter, GFXSamplerStateData),
         "The texture minification filter.  The default is GFXTextureFilterLinear." );

      addField("mipFilter", TypeGFXTextureFilterType, Offset(mState.mipFilter, GFXSamplerStateData),
         "The texture mipmap filter used during minification.  The default is GFXTextureFilterLinear." );

      addField("mipLODBias", TypeF32, Offset(mState.mipLODBias, GFXSamplerStateData),
         "The mipmap level of detail bias.  The default value is zero." );

      addField("maxAnisotropy", TypeS32, Offset(mState.maxAnisotropy, GFXSamplerStateData),
         "The maximum texture anisotropy.  The default value is 1." );

   endGroup( "Filter State" );

   addField("textureTransform", TypeGFXTextureTransformFlags, Offset(mState.textureTransform, GFXSamplerStateData),
      "Sets the texture transform state.  The default is GFXTTFFDisable." );

   addField("resultArg", TypeGFXTextureArgument, Offset(mState.resultArg, GFXSamplerStateData),
      "The selection of the destination register for the result of this stage.  The default is GFXTACurrent." );
}
Exemple #3
0
Config::Config(QObject* parent)
    : QSettings(ORGNAME, PROGNAME, parent)
{
    keywordsSorted = keywords.keywords.values();
    keywordsSorted.sort();

    languages.insert("English", "en_EN");
    languages.insert("Russian", "ru_RU");

    maxRecentFiles = 9;
    maxHistory 	   = 10;

    beginGroup("General");
    language    	   = value("language", "English").toString();
    recentFiles 	   = value("recentFiles").toStringList();
    openFiles   	   = value("openFiles").toStringList();
    lastFile  		   = value("lastFile").toString();
    mainWindowGeometry = value("mainWindowGeometry").toByteArray();
    mainWindowState    = value("mainWindowState").toByteArray();
    helpWindowGeometry = value("helpWindowGeometry").toByteArray();
    endGroup();

    beginGroup("Editor");
    fontFamily   = value("fontFamily", "Courier New").toString();
    fontSize     = value("fontSize", 12).toInt();
    tabIndents   = value("tabIndents").toBool();
    autoIndent   = value("autoIndent").toBool();
    backUnindent = value("backUnindent").toBool();
    spaceTabs    = value("spaceTabs", true).toBool();
    indentSize   = value("indentSize", 4).toInt();
    tabSize      = value("tabSize", 4).toInt();
    whitespaces  = value("whitespaces").toBool();

    QTextCharFormat fmt; // формат по умолчанию, не изменяется
    fmt.setBackground(QColor(255, 255, 255, 0)) ; // прозрачный белый

    int size = beginReadArray("ColorScheme");

    for (int i = 0; i < size; i++) {
        setArrayIndex(i);

        QString type = value("type").toString();

        colorScheme.insert(type, fmt);
        colorScheme[type].setFontItalic(value("italic").toBool());
        colorScheme[type].setFontWeight(value("weihgt").toInt());
        colorScheme[type].setForeground(value("foreground").value<QColor>());
        colorScheme[type].setBackground(value("background").value<QColor>());
    }

    endArray();

    QHashIterator<QString, QString> it(keywords.keywords);

    while (it.hasNext()) {
        it.next();

        QString keyword = it.value();

        keyword.replace("*", "\\*").replace("$", "\\$");
        patterns.insert(it.key(), QRegExp(tr("\\b%1\\b").arg(keyword)));

        if (!colorScheme.contains(it.key())) // для всех слов пустая схема при size == 0
            colorScheme.insert(it.key(), fmt);
    }

    // 1. для неключевых слов добавить шаблон
    patterns.insert("Parentheses", 	    QRegExp("[\\(\\)\\[\\]]"));
    patterns.insert("Numbers", 			QRegExp("(^|\\s)[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?"));
    patterns.insert("Local Variables",  QRegExp("\\$?\\?[\\w-]+"));
    patterns.insert("Global Variables", QRegExp("\\?\\*[\\w-]+\\*"));

    // 2. настроить схему по умолчанию
    if (!size) {
        colorScheme.insert("Constructs", fmt);
        colorScheme["Constructs"].setFontWeight(QFont::Bold);
        colorScheme["Constructs"].setForeground(Qt::darkBlue);

        colorScheme.insert("Strings", fmt);
        colorScheme["Strings"].setForeground(Qt::darkRed);

        colorScheme.insert("Comments", fmt);
        colorScheme["Comments"].setFontItalic(true);
        colorScheme["Comments"].setForeground(Qt::darkGreen);

        colorScheme.insert("Parentheses", fmt);
        colorScheme["Parentheses"].setFontWeight(QFont::Bold);

        colorScheme.insert("Numbers", fmt);
        colorScheme["Numbers"].setForeground(Qt::darkYellow);

        colorScheme.insert("Local Variables", fmt);
        colorScheme["Local Variables"].setForeground(Qt::darkYellow);

        colorScheme.insert("Global Variables", fmt);
        colorScheme["Global Variables"].setForeground(Qt::darkYellow);

        colorScheme.insert("Text", fmt);
        colorScheme["Text"].setForeground(Qt::black);
        colorScheme["Text"].setBackground(Qt::white);

        colorScheme.insert("Line Numbers", fmt);
        colorScheme["Line Numbers"].setForeground(Qt::gray);
        colorScheme["Line Numbers"].setBackground(QColor(30, 60, 90));
    }

    endGroup(); // Editor

    beginGroup("Sessions");
    leaveOpen       = value("leaveOpen").toBool();
    sessions 	    = value("sessions").toMap();
    sessionSplitter	= value("sessionSplitter").toByteArray();
    endGroup();

    beginGroup("Snippets");
    snippetPath		= value("snippetPath").toString();
    snippetSplitter = value("snippetSplitter").toByteArray();
    endGroup();

    beginGroup("SearchReplace");
    findHistory     = value("findHistory").toStringList();
    replaceHistory  = value("replaceHistory").toStringList();
    matchCase       = value("matchCase").toBool();
    regExp          = value("regExp").toBool();
    allFiles        = value("allFiles").toBool();
    endGroup();
}
Exemple #4
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();
   }
Configuration::~Configuration()
{
    #ifdef ENABLE_KDE_SUPPORT
    endGroup();
    #endif
}
Exemple #6
0
Config::~Config()
{
    beginGroup("General");
    setValue("language",           language);
    setValue("recentFiles",        recentFiles);
    setValue("openFiles",          openFiles);
    setValue("lastFile",           lastFile);
    setValue("mainWindowGeometry", mainWindowGeometry);
    setValue("mainWindowState",    mainWindowState);
    setValue("helpWindowGeometry", helpWindowGeometry);
    endGroup();

    beginGroup("Editor");
    setValue("fontFamily",   fontFamily);
    setValue("fontSize",     fontSize);
    setValue("tabIndents",   tabIndents);
    setValue("autoIndent",   autoIndent);
    setValue("backUnindent", backUnindent);
    setValue("spaceTabs",    spaceTabs);
    setValue("indentSize",   indentSize);
    setValue("tabSize",      tabSize);
    setValue("whitespaces",  whitespaces);

    QMapIterator<QString, QTextCharFormat> it(colorScheme);

    beginWriteArray("ColorScheme");

    int i = 0;

    while (it.hasNext()) {
        it.next();

        setArrayIndex(i++);
        setValue("type",       it.key());
        setValue("italic",     it.value().font().italic());
        setValue("weihgt",     it.value().font().weight());
        setValue("foreground", it.value().foreground());
        setValue("background", it.value().background());
    }

    endArray();

    endGroup(); // Editor

    beginGroup("Sessions");
    setValue("leaveOpen", 	    leaveOpen);
    setValue("sessions", 		sessions);
    setValue("sessionSplitter", sessionSplitter);
    endGroup();

    beginGroup("Snippets");
    setValue("snippetPath",     snippetPath);
    setValue("snippetSplitter", snippetSplitter);
    endGroup();

    beginGroup("SearchReplace");
    findHistory.sort();
    replaceHistory.sort();
    setValue("findHistory",     findHistory);
    setValue("replaceHistory",  replaceHistory);
    setValue("matchCase", 	    matchCase);
    setValue("regExp",    	    regExp);
    setValue("allFiles",  	    allFiles);
    endGroup();
}
Exemple #7
0
Settings::~Settings()
{ endGroup(); }
void DebrisData::initPersistFields()
{
   addGroup("Display");
   addField("texture",              TypeString,                  Offset(textureName,         DebrisData), 
      "@brief Texture imagemap to use for this debris object.\n\nNot used any more.\n");
   addField("shapeFile",            TypeShapeFilename,           Offset(shapeName,           DebrisData), 
      "@brief Object model to use for this debris object.\n\nThis shape is optional.  You could have Debris made up of only particles.\n");
   endGroup("Display");

   addGroup("Datablocks");
   addField("emitters",             TYPEID< ParticleEmitterData >(),  Offset(emitterList,    DebrisData), DDC_NUM_EMITTERS, 
      "@brief List of particle emitters to spawn along with this debris object.\n\nThese are optional.  You could have Debris made up of only a shape.\n");
   addField("explosion",            TYPEID< ExplosionData >(),   Offset(explosion,           DebrisData), 
      "@brief ExplosionData to spawn along with this debris object.\n\nThis is optional as not all Debris explode.\n");
   endGroup("Datablocks");

   addGroup("Physical Properties");
   addField("elasticity",           TypeF32,                     Offset(elasticity,          DebrisData), 
      "@brief A floating-point value specifying how 'bouncy' this object is.\n\nMust be in the range of -10 to 10.\n");
   addField("friction",             TypeF32,                     Offset(friction,            DebrisData), 
      "@brief A floating-point value specifying how much velocity is lost to impact and sliding friction.\n\nMust be in the range of -10 to 10.\n");
   addField("numBounces",           TypeS32,                     Offset(numBounces,          DebrisData), 
      "@brief How many times to allow this debris object to bounce until it either explodes, becomes static or snaps (defined in explodeOnMaxBounce, staticOnMaxBounce, snapOnMaxBounce).\n\n"
      "Must be within the range of 0 to 10000.\n"
      "@see bounceVariance\n");
   addField("bounceVariance",       TypeS32,                     Offset(bounceVariance,      DebrisData), 
      "@brief Allowed variance in the value of numBounces.\n\nMust be less than numBounces.\n@see numBounces\n");
   addField("minSpinSpeed",         TypeF32,                     Offset(minSpinSpeed,        DebrisData), 
      "@brief Minimum speed that this debris object will rotate.\n\nMust be in the range of -10000 to 1000, and must be less than maxSpinSpeed.\n@see maxSpinSpeed\n");
   addField("maxSpinSpeed",         TypeF32,                     Offset(maxSpinSpeed,        DebrisData), 
      "@brief Maximum speed that this debris object will rotate.\n\nMust be in the range of -10000 to 10000.\n@see minSpinSpeed\n");
   addField("gravModifier",         TypeF32,                     Offset(gravModifier,        DebrisData), "How much gravity affects debris.");
   addField("terminalVelocity",     TypeF32,                     Offset(terminalVelocity,    DebrisData), "Max velocity magnitude.");
   addField("velocity",             TypeF32,                     Offset(velocity,            DebrisData), 
      "@brief Speed at which this debris object will move.\n\n@see velocityVariance\n");
   addField("velocityVariance",     TypeF32,                     Offset(velocityVariance,    DebrisData), 
      "@brief Allowed variance in the value of velocity\n\nMust be less than velocity.\n@see velocity\n");
   addField("lifetime",             TypeF32,                     Offset(lifetime,            DebrisData), 
      "@brief Amount of time until this debris object is destroyed.\n\nMust be in the range of 0 to 1000.\n@see lifetimeVariance");
   addField("lifetimeVariance",     TypeF32,                     Offset(lifetimeVariance,    DebrisData), 
      "@brief Allowed variance in the value of lifetime.\n\nMust be less than lifetime.\n@see lifetime\n");
   addField("useRadiusMass",        TypeBool,                    Offset(useRadiusMass,       DebrisData), 
      "@brief Use mass calculations based on radius.\n\nAllows for the adjustment of elasticity and friction based on the Debris size.\n@see baseRadius\n");
   addField("baseRadius",           TypeF32,                     Offset(baseRadius,          DebrisData), 
      "@brief Radius at which the standard elasticity and friction apply.\n\nOnly used when useRaduisMass is true.\n@see useRadiusMass.\n");
   endGroup("Physical Properties");

   addGroup("Behavior");
   addField("explodeOnMaxBounce",   TypeBool,                    Offset(explodeOnMaxBounce,  DebrisData), 
      "@brief If true, this debris object will explode after it has bounced max times.\n\nBe sure to provide an ExplosionData datablock for this to take effect.\n@see explosion\n");
   addField("staticOnMaxBounce",    TypeBool,                    Offset(staticOnMaxBounce,   DebrisData), "If true, this debris object becomes static after it has bounced max times.");
   addField("snapOnMaxBounce",      TypeBool,                    Offset(snapOnMaxBounce,     DebrisData), "If true, this debris object will snap into a resting position on the last bounce.");
   addField("fade",                 TypeBool,                    Offset(fade,                DebrisData), 
      "@brief If true, this debris object will fade out when destroyed.\n\nThis fade occurs over the last second of the Debris' lifetime.\n");
   addField("ignoreWater",          TypeBool,                    Offset(ignoreWater,         DebrisData), "If true, this debris object will not collide with water, acting as if the water is not there.");
   endGroup("Behavior");

   // AFX CODE BLOCK (substitutions) <<
   // disallow some field substitutions
   onlyKeepClearSubstitutions("emitters"); // subs resolving to "~~", or "~0" are OK
   onlyKeepClearSubstitutions("explosion");
   // AFX CODE BLOCK (substitutions) >>
   
   Parent::initPersistFields();
}
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();
}
Exemple #10
0
void ScatterSky::initPersistFields()
{
   addGroup( "ScatterSky",
      "Only azimuth and elevation are networked fields. To trigger a full update of all other fields use the applyChanges ConsoleMethod." );

      addField( "skyBrightness",       TypeF32,    Offset( mSkyBrightness, ScatterSky ),
         "Global brightness and intensity applied to the sky and objects in the level." );

     addField( "sunSize",       TypeF32,    Offset( mSunSize, ScatterSky ),
         "Affects the size of the sun's disk." );

	 addField( "colorizeAmount",       TypeF32,   Offset( mColorizeAmt, ScatterSky ),
         "Controls how much the the alpha component of colorize brigthens the sky. Setting to 0 returns default behavior." );

	  addField( "colorize",            TypeColorF,    Offset( mColorize, ScatterSky ),
         "Tints the sky the color specified, the alpha controls the brigthness. The brightness is multipled by the value of colorizeAmt." );

      addField( "rayleighScattering",  TypeF32,    Offset( mRayleighScattering, ScatterSky ),
         "Controls how blue the atmosphere is during the day." );

      addField( "sunScale",            TypeColorF, Offset( mSunScale, ScatterSky ),
         "Modulates the directional color of sunlight." );

      addField( "ambientScale",        TypeColorF, Offset( mAmbientScale, ScatterSky ),
         "Modulates the ambient color of sunlight." );

      addField( "fogScale",            TypeColorF, Offset( mFogScale, ScatterSky ),
         "Modulates the fog color. Note that this overrides the LevelInfo.fogColor "
         "property, so you should not use LevelInfo.fogColor if the level contains "
         "a ScatterSky object." );

      addField( "exposure",            TypeF32,    Offset( mExposure, ScatterSky ),
         "Controls the contrast of the sky and sun during daytime." );

   endGroup( "ScatterSky" );

   addGroup( "Orbit" );

      addProtectedField( "azimuth", TypeF32, Offset( mSunAzimuth, ScatterSky ), &ScatterSky::ptSetAzimuth, &defaultProtectedGetFn,
         "The horizontal angle of the sun measured clockwise from the positive Y world axis. This field is networked." );

      addProtectedField( "elevation", TypeF32, Offset( mSunElevation, ScatterSky ), &ScatterSky::ptSetElevation, &defaultProtectedGetFn,
         "The elevation angle of the sun above or below the horizon. This field is networked." );

      addField( "moonAzimuth", TypeF32, Offset( mMoonAzimuth, ScatterSky ),
         "The horizontal angle of the moon measured clockwise from the positive Y world axis. This is not animated by time or networked." );

      addField( "moonElevation", TypeF32, Offset( mMoonElevation, ScatterSky ),
         "The elevation angle of the moon above or below the horizon. This is not animated by time or networked." );

   endGroup( "Orbit" );

   // 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( "Lighting" );

      addField( "castShadows", TypeBool, Offset( mCastShadows, ScatterSky ),
         "Enables/disables shadows cast by objects due to ScatterSky light." );

      addField( "brightness", TypeF32, Offset( mBrightness, ScatterSky ),
         "The brightness of the ScatterSky's light object." );

   endGroup( "Lighting" );

   addGroup( "Misc" );

      addField( "flareType", TYPEID< LightFlareData >(), Offset( mFlareData, ScatterSky ),
         "Datablock for the flare produced by the ScatterSky." );

      addField( "flareScale", TypeF32, Offset( mFlareScale, ScatterSky ),
         "Changes the size and intensity of the flare." );

   endGroup( "Misc" );

   addGroup( "Night" );

      addField( "nightColor", TypeColorF, Offset( mNightColor, ScatterSky ),
         "The ambient color during night. Also used for the sky color if useNightCubemap is false." );

      addField( "nightFogColor", TypeColorF, Offset( mNightFogColor, ScatterSky ),
         "The fog color during night." );

      addField( "moonEnabled", TypeBool, Offset( mMoonEnabled, ScatterSky ),
         "Enable or disable rendering of the moon sprite during night." );

      addField( "moonMat", TypeMaterialName, Offset( mMoonMatName, ScatterSky ),
         "Material for the moon sprite." );

      addField( "moonScale", TypeF32, Offset( mMoonScale, ScatterSky ),
         "Controls size the moon sprite renders, specified as a fractional amount of the screen height." );

      addField( "moonLightColor", TypeColorF, Offset( mMoonTint, ScatterSky ),
         "Color of light cast by the directional light during night." );

      addField( "useNightCubemap", TypeBool, Offset( mUseNightCubemap, ScatterSky ),
         "Transition to the nightCubemap during night. If false we use nightColor." );

      addField( "nightCubemap", TypeCubemapName, Offset( mNightCubemapName, ScatterSky ),
         "Cubemap visible during night." );

   endGroup( "Night" );

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

   Parent::initPersistFields();
}
void Sun::initPersistFields()
{
   addGroup( "Orbit" );

      addField( "azimuth", TypeF32, Offset( mSunAzimuth, Sun ), 
         "The horizontal angle of the sun measured clockwise from the positive Y world axis." );

      addField( "elevation", TypeF32, Offset( mSunElevation, Sun ),
         "The elevation angle of the sun above or below the horizon." );

   endGroup( "Orbit" );	

   // 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( "Lighting" );

      addField( "color", TypeColorF, Offset( mLightColor, Sun ), 
         "Color shading applied to surfaces in direct contact with light source.");

      addField( "ambient", TypeColorF, Offset( mLightAmbient, Sun ), "Color shading applied to surfaces not "
         "in direct contact with light source, such as in the shadows or interiors.");       

      addField( "brightness", TypeF32, Offset( mBrightness, Sun ), 
         "Adjust the Sun's global contrast/intensity");      

      addField( "castShadows", TypeBool, Offset( mCastShadows, Sun ), 
         "Enables/disables shadows cast by objects due to Sun light");      

   endGroup( "Lighting" );

   addGroup( "Corona" );

      addField( "coronaEnabled", TypeBool, Offset( mCoronaEnabled, Sun ), 
         "Enable or disable rendering of the corona sprite." );

      addField( "coronaMaterial", TypeMaterialName, Offset( mCoronaMatName, Sun ),
         "Texture for the corona sprite." );

      addField( "coronaScale", TypeF32, Offset( mCoronaScale, Sun ),
         "Controls size the corona sprite renders, specified as a fractional amount of the screen height." );

      addField( "coronaTint", TypeColorF, Offset( mCoronaTint, Sun ),
         "Modulates the corona sprite color ( if coronaUseLightColor is false )." );

      addField( "coronaUseLightColor", TypeBool, Offset( mCoronaUseLightColor, Sun ),
         "Modulate the corona sprite color by the color of the light ( overrides coronaTint )." );

   endGroup( "Corona" );


   addGroup( "Misc" );

      addField( "flareType", TYPEID< LightFlareData >(), Offset( mFlareData, Sun ), 
         "Datablock for the flare produced by the Sun" );

      addField( "flareScale", TypeF32, Offset( mFlareScale, Sun ), 
         "Changes the size and intensity of the flare." );

   endGroup( "Misc" );

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

   Parent::initPersistFields();
}