template<> const ClassAccessors& GetAccessors<SceneEngine::VegetationSpawnConfig>()
{
    using Obj = SceneEngine::VegetationSpawnConfig;
    static ClassAccessors props(typeid(Obj).hash_code());
    static bool init = false;
    if (!init) {
        props.Add(u("BaseGridSpacing"), DefaultGet(Obj, _baseGridSpacing),  DefaultSet(Obj, _baseGridSpacing));
        props.Add(u("JitterAmount"),    DefaultGet(Obj, _jitterAmount),     DefaultSet(Obj, _jitterAmount));

        props.AddChildList<Obj::Material>(
            u("Material"),
            DefaultCreate(Obj, _materials),
            DefaultGetCount(Obj, _materials),
            DefaultGetChildByIndex(Obj, _materials),
            DefaultGetChildByKey(Obj, _materials));

        props.AddChildList<Obj::ObjectType>(
            u("ObjectType"),
            DefaultCreate(Obj, _objectTypes),
            DefaultGetCount(Obj, _objectTypes),
            DefaultGetChildByIndex(Obj, _objectTypes),
            DefaultGetChildByKey(Obj, _objectTypes));

        init = true;
    }
    return props;
}
template<> const ClassAccessors& GetAccessors<SceneEngine::VegetationSpawnConfig::ObjectType>()
{
    using Obj = SceneEngine::VegetationSpawnConfig::ObjectType;
    static ClassAccessors props(typeid(Obj).hash_code());
    static bool init = false;
    if (!init) {
        props.Add(u("Model"), DefaultGet(Obj, _modelName), DefaultSet(Obj, _modelName));
        props.Add(u("Material"), DefaultGet(Obj, _materialName), DefaultSet(Obj, _materialName));
        init = true;
    }
    return props;
}
template<> const ClassAccessors& GetAccessors<SceneEngine::VegetationSpawnConfig::Bucket>()
{
    using Obj = SceneEngine::VegetationSpawnConfig::Bucket;
    static ClassAccessors props(typeid(Obj).hash_code());
    static bool init = false;
    if (!init) {
        props.Add(u("ObjectType"), DefaultGet(Obj, _objectType), DefaultSet(Obj, _objectType));
        props.Add(u("MaxDrawDistance"), DefaultGet(Obj, _maxDrawDistance), DefaultSet(Obj, _maxDrawDistance));
        props.Add(u("FrequencyWeight"), DefaultGet(Obj, _frequencyWeight), DefaultSet(Obj, _frequencyWeight));
        init = true;
    }
    return props;
}
template<> const ClassAccessors& GetAccessors<SceneEngine::VegetationSpawnConfig::Material>()
{
    using Obj = SceneEngine::VegetationSpawnConfig::Material;
    static ClassAccessors props(typeid(Obj).hash_code());
    static bool init = false;
    if (!init) {
        props.Add(u("NoSpawnWeight"), DefaultGet(Obj, _noSpawnWeight), DefaultSet(Obj, _noSpawnWeight));
        props.Add(u("SuppressionThreshold"), DefaultGet(Obj, _suppressionThreshold), DefaultSet(Obj, _suppressionThreshold));
        props.Add(u("SuppressionNoise"), DefaultGet(Obj, _suppressionNoise), DefaultSet(Obj, _suppressionNoise));
        props.Add(u("SuppressionGain"), DefaultGet(Obj, _suppressionGain), DefaultSet(Obj, _suppressionGain));
        props.Add(u("SuppressionLacunarity"), DefaultGet(Obj, _suppressionLacunarity), DefaultSet(Obj, _suppressionLacunarity));
        props.Add(u("MaterialId"), DefaultGet(Obj, _materialId), DefaultSet(Obj, _materialId));

        props.AddChildList<SceneEngine::VegetationSpawnConfig::Bucket>(
            u("Bucket"),
            DefaultCreate(Obj, _buckets),
            DefaultGetCount(Obj, _buckets),
            DefaultGetChildByIndex(Obj, _buckets),
            DefaultGetChildByKey(Obj, _buckets));

        init = true;
    }
    return props;
}
Exemple #5
0
template<> const ClassAccessors& GetAccessors<PlatformRig::DefaultShadowFrustumSettings>()
{
    using Obj = PlatformRig::DefaultShadowFrustumSettings;
    static ClassAccessors props(typeid(Obj).hash_code());
    static bool init = false;
    if (!init) {
        props.Add(u("FrustumCount"), DefaultGet(Obj, _frustumCount),  
            [](Obj& obj, unsigned value) { obj._frustumCount = Clamp(value, 1u, SceneEngine::MaxShadowTexturesPerLight); });
        props.Add(u("MaxDistanceFromCamera"),  DefaultGet(Obj, _maxDistanceFromCamera),   DefaultSet(Obj, _maxDistanceFromCamera));
        props.Add(u("FrustumSizeFactor"),   DefaultGet(Obj, _frustumSizeFactor),    DefaultSet(Obj, _frustumSizeFactor));
        props.Add(u("FocusDistance"),   DefaultGet(Obj, _focusDistance),    DefaultSet(Obj, _focusDistance));
        props.Add(u("Flags"),   DefaultGet(Obj, _flags),    DefaultSet(Obj, _flags));
        props.Add(u("TextureSize"),   DefaultGet(Obj, _textureSize),    
            [](Obj& obj, unsigned value) { obj._textureSize = 1<<(IntegerLog2(value-1)+1); });  // ceil to a power of two
        props.Add(u("SingleSidedSlopeScaledBias"),   DefaultGet(Obj, _slopeScaledBias),    DefaultSet(Obj, _slopeScaledBias));
        props.Add(u("SingleSidedDepthBiasClamp"),   DefaultGet(Obj, _depthBiasClamp),    DefaultSet(Obj, _depthBiasClamp));
        props.Add(u("SingleSidedRasterDepthBias"),   DefaultGet(Obj, _rasterDepthBias),    DefaultSet(Obj, _rasterDepthBias));
        props.Add(u("DoubleSidedSlopeScaledBias"),   DefaultGet(Obj, _dsSlopeScaledBias),    DefaultSet(Obj, _dsSlopeScaledBias));
        props.Add(u("DoubleSidedDepthBiasClamp"),   DefaultGet(Obj, _dsDepthBiasClamp),    DefaultSet(Obj, _dsDepthBiasClamp));
        props.Add(u("DoubleSidedRasterDepthBias"),   DefaultGet(Obj, _dsRasterDepthBias),    DefaultSet(Obj, _dsRasterDepthBias));
        props.Add(u("WorldSpaceResolveBias"),   DefaultGet(Obj, _worldSpaceResolveBias),    DefaultSet(Obj, _worldSpaceResolveBias));
        props.Add(u("BlurAngleDegrees"),   
            [](const Obj& obj) { return Rad2Deg(XlATan(obj._tanBlurAngle)); },
            [](Obj& obj, float value) { obj._tanBlurAngle = XlTan(Deg2Rad(value)); } );
        props.Add(u("MinBlurSearch"),   DefaultGet(Obj, _minBlurSearch),    DefaultSet(Obj, _minBlurSearch));
        props.Add(u("MaxBlurSearch"),   DefaultGet(Obj, _maxBlurSearch),    DefaultSet(Obj, _maxBlurSearch));
        init = true;
    }
    return props;
}