LightDescription¶
A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual “LightBase” objects.
- Inherit:
- SimDataBlock
Description¶
A helper datablock used by classes (such as shapebase) that submit lights to the scene but do not use actual “LightBase” objects.
This datablock stores the properties of that light as fields that can be initialized from script.
Example:
// Declare a light description to be used on a rocket launcher projectile
datablock LightDescription(RocketLauncherLightDesc)
{
range = 4.0;
color = "1 1 0";
brightness = 5.0;
animationType = PulseLightAnim;
animationPeriod = 0.25;
};
// Declare a ProjectileDatablock which uses the light description
datablock ProjectileData(RocketLauncherProjectile)
{
lightDesc = RocketLauncherLightDesc;
projectileShapeName = "art/shapes/weapons/SwarmGun/rocket.dts";
directDamage = 30;
radiusDamage = 30;
damageRadius = 5;
areaImpulse = 2500;
// ... remaining ProjectileData fields not listed for this example
};
Methods¶
-
void
LightDescription::
apply
()¶ Force an inspectPostApply call for the benefit of tweaking via the console. Normally this functionality is only exposed to objects via the World Editor, once changes have been made. Exposing apply to script allows you to make changes to it on the fly without the World Editor.
Example:
// Change a property of the light description RocketLauncherLightDesc.brightness = 10; // Make it so RocketLauncherLightDesc.apply();
Fields¶
-
float
LightDescription::
animationPeriod
¶ The length of time in seconds for a single playback of the light animation.
-
float
LightDescription::
animationPhase
¶ The phase used to offset the animation start time to vary the animation of nearby lights.
-
LightAnimData
LightDescription::
animationType
¶ Datablock containing light animation information ( LightAnimData ).
-
Point3F
LightDescription::
attenuationRatio
¶ The proportions of constant, linear, and quadratic attenuation to use for the falloff for point and spot lights.
-
float
LightDescription::
brightness
¶ Adjusts the lights power, 0 being off completely.
-
bool
LightDescription::
castShadows
¶ Enables/disabled shadow casts by this light.
-
ColorF
LightDescription::
color
¶ Changes the base color hue of the light.
A custom pattern texture which is projected from the light.
-
float
LightDescription::
fadeStartDistance
¶ Start fading shadows out at this distance. 0 = auto calculate this distance.
-
float
LightDescription::
flareScale
¶ Globally scales all features of the light flare.
-
LightFlareData
LightDescription::
flareType
¶ Datablock containing light flare information ( LightFlareData ).
-
bool
LightDescription::
includeLightmappedGeometryInShadow
¶ This light should render lightmapped geometry during its shadow-map update (ignored if ‘representedInLightmap’ is false).
-
bool
LightDescription::
lastSplitTerrainOnly
¶ This toggles only terrain being rendered to the last split of a PSSM shadow map.
-
float
LightDescription::
logWeight
¶ The logrithmic PSSM split distance factor.
-
int
LightDescription::
numSplits
¶ The logrithmic PSSM split distance factor.
-
Point4F
LightDescription::
overDarkFactor
¶ The ESM shadow darkening factor.
-
float
LightDescription::
range
¶ Controls the size (radius) of the light.
-
bool
LightDescription::
representedInLightmap
¶ This light is represented in lightmaps (static light, default: false).
-
ColorF
LightDescription::
shadowDarkenColor
¶ The color that should be used to multiply-blend dynamic shadows onto lightmapped geometry (ignored if ‘representedInLightmap’ is false).
-
float
LightDescription::
shadowDistance
¶ The distance from the camera to extend the PSSM shadow.
-
float
LightDescription::
shadowSoftness
¶
-
ShadowType
LightDescription::
shadowType
¶ The type of shadow to use on this light.
-
int
LightDescription::
texSize
¶ The texture size of the shadow map.