Classes:DynamicLight
Jump to navigation
Jump to search
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
|
Dynamic light | |||
---|---|---|---|
Actor type | Internal | Game | (OpenGL) |
DoomEd Number | None | Class Name | DynamicLight |
Classes: DynamicLight
→PointLight
→PointLightAdditive
→PointLightFlicker
→PointLightFlickerRandom
→PointLightPulse
→PointLightSubtractive
→SectorPointLight
→VavoomLight
→VavoomLightColor
→VavoomLightWhite
The base class for all dynamic lights. Lights can be toggled on and off with Thing_Activate and Thing_Deactivate.
New lights can be created in ZScript to modify their behavior and properties dynamically.
Note, it's not possible to define or modify the actor considered the source of the light in ZScript. As such, some of the features listed below are not dynamically accessible or modifiable.
DynamicLight properties
- DynamicLight.SpotInnerAngle value
- The inner angle of the light. Used only for spotlights.
- DynamicLight.SpotOuterAngle value
- The outer angle of the light. Used only for spotlights.
- DynamicLight.Type "value"
- The type of the dynamic light as a string. Possible values:
- "Point" — PointLight
- "Pulse" — PulseLight
- "Flicker" — FlickerLight
- "Sector" — SectorLight
- "RandomFlicker" — RandomFlighterLight
DynamicLight flags
- DynamicLight.SUBTRACTIVE
- Makes the light subtractive. Subtractive lights are "inverted", thus darkening the surrounding area instead of illuminating it.
- Related GLDEFS keyword:
subtractive 1
- DynamicLight.ADDITIVE
- Makes the light additive.
- Related GLDEFS keyword: (Need more info)
- DynamicLight.DONTLIGHTSELF
- Prevents the light from illuminating the actor it's attached to.
- Related GLDEFS keyword:
dontlightself 1
- DynamicLight.ATTENUATE
- Makes the light attenuated. Attenuated lights can interact with materials.
- Related GLDEFS keyword:
attenuate 1
- DynamicLight.NOSHADOWMAP
- The dynamic light will not emit any shadowmaps on the level, which are shadows that are emitted by lights when they hit void surfaces.
- Related GLDEFS keyword:
noshadowmap 1
- DynamicLight.DONTLIGHTACTORS
- Stops the light from illuminating actors.
- DynamicLight.SPOT
- Related GLDEFS keyword:
dontlightactors 1
- DynamicLight.DONTLIGHTOTHERS
- The light will only illuminate the actor it's attached to (effectively, the inverse of DONTLIGHTSELF).
- Related GLDEFS keyword:
dontlightothers 1
- DynamicLight.DONTLIGHTMAP
- The light will only illuminate actors, not geometry.
- Related GLDEFS keyword:
dontlightmap 1
Fields
Public
- double SpotInnerAngle
- The inner angle of the light. Used only for spotlights.
- double SpotOuterAngle
- The outer angle of the light. Used only for spotlights.
Private
- private int lighttype
- The type of the light. Not modifiable directly, can only be set through the DynamicLight.Type property in the Default block.
- private int lightflags
- The flags used by the light. Not modifiable directly, can only be set through flags in the Default block.
Methods
Public
- native void SetOffset(Vector3 offset)
- Sets the light's offset from its source. (Note, the source itself cannot be set from ZScript, only via GLDEFS (Verification needed))
Private
These methods cannot be called from ZScript directly.
- private native void AttachLight()
- Attaches the light to its source.
- private native void ActivateLight()
- Activates the light. This can be called indirectly by calling Activate on the light.
- private native void DeactivateLight()
- Deactivates the light. This can be called indirectly by calling Deactivate on the light.