Class MyLight
Inheritance
System.Object
MyLight
Assembly: Sandbox.Game.dll
Syntax
public class MyLight : Object
Constructors
MyLight()
Declaration
Properties
CastShadows
Declaration
public bool CastShadows { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Color
Declaration
public Color Color { get; set; }
Property Value
DiffuseFactor
Declaration
public float DiffuseFactor { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
Falloff
Exponential falloff (1 = linear, 2 = quadratic, etc)
Declaration
public float Falloff { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareIntensity
Declaration
public float GlareIntensity { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareMaxDistance
Declaration
public float GlareMaxDistance { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareOn
Declaration
public bool GlareOn { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
GlareQueryFreqMinMs
Declaration
public float GlareQueryFreqMinMs { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareQueryFreqRndMs
Declaration
public float GlareQueryFreqRndMs { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareQueryShift
Declaration
public float GlareQueryShift { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareQuerySize
Declaration
public float GlareQuerySize { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
GlareSize
Declaration
public Vector2 GlareSize { get; set; }
Property Value
GlareType
Declaration
public MyGlareTypeEnum GlareType { get; set; }
Property Value
| Type |
Description |
| VRageRender.Lights.MyGlareTypeEnum |
|
GlossFactor
Declaration
public float GlossFactor { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
Intensity
Declaration
public float Intensity { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
LightOn
If true, we use the light in lighting calculation. Otherwise it's like turned off, but still in the buffer.
Declaration
public bool LightOn { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
LightSourceType
Declaration
public MyLightSourceType LightSourceType { get; set; }
Property Value
LightType
Declaration
public MyLightType LightType { get; set; }
Property Value
ParentID
Declaration
public uint ParentID { get; set; }
Property Value
| Type |
Description |
| System.UInt32 |
|
PointLightOffset
Declaration
public float PointLightOffset { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
Position
Declaration
public Vector3D Position { get; set; }
Property Value
Range
Declaration
public float Range { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorColor
Declaration
public Color ReflectorColor { get; set; }
Property Value
ReflectorConeDegrees
Sets reflector cone angle in degrees, minimum is 0, teoretical maximum is 180
Declaration
public float ReflectorConeDegrees { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorConeMaxAngleCos
Declaration
public float ReflectorConeMaxAngleCos { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorConeRadians
Sets reflector cone angle in degrees, minimum is 0, teoretical maximum is PI
Declaration
public float ReflectorConeRadians { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorDiffuseFactor
Declaration
public float ReflectorDiffuseFactor { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorDirection
Declaration
public Vector3 ReflectorDirection { get; set; }
Property Value
ReflectorFalloff
Declaration
public float ReflectorFalloff { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorGlossFactor
Declaration
public float ReflectorGlossFactor { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorIntensity
Reflector parameters are also parameters for spot light
Declaration
public float ReflectorIntensity { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorOn
Declaration
public bool ReflectorOn { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
ReflectorRange
Declaration
public float ReflectorRange { get; set; }
Property Value
| Type |
Description |
| System.Single |
|
ReflectorTexture
Declaration
public string ReflectorTexture { get; set; }
Property Value
| Type |
Description |
| System.String |
|
ReflectorUp
Declaration
public Vector3 ReflectorUp { get; set; }
Property Value
RenderObjectID
Declaration
public uint RenderObjectID { get; }
Property Value
| Type |
Description |
| System.UInt32 |
|
SubGlares
Declaration
public MySubGlare[] SubGlares { get; set; }
Property Value
| Type |
Description |
| VRageRender.Messages.MySubGlare[] |
|
Methods
Clear()
Can be called only from MyLights.RemoveLight.
Declaration
MarkPositionDirty()
Declaration
public void MarkPositionDirty()
When setting Reflector properties, use this function to test whether properties are in bounds and light AABB is not too large.
Properties which affects calculations are ReflectorRange and ReflectorConeMaxAngleCos (ReflectorConeDegrees, ReflectorConeRadians)
Declaration
public bool SpotlightNotTooLarge(float reflectorConeMaxAngleCos, float reflectorRange)
Parameters
| Type |
Name |
Description |
| System.Single |
reflectorConeMaxAngleCos |
|
| System.Single |
reflectorRange |
|
Returns
| Type |
Description |
| System.Boolean |
|
Start(String)
IMPORTANT: This class isn't realy inicialized by constructor, but by Start()
Declaration
public void Start(string debugName)
Parameters
| Type |
Name |
Description |
| System.String |
debugName |
|
Start(Vector3D, Vector4, Single, String)
Declaration
public void Start(Vector3D position, Vector4 color, float range, string debugName)
Parameters
| Type |
Name |
Description |
| Vector3D |
position |
|
| Vector4 |
color |
|
| System.Single |
range |
|
| System.String |
debugName |
|
Start(Vector4, Single, String)
Declaration
public void Start(Vector4 color, float range, string debugName)
Parameters
| Type |
Name |
Description |
| Vector4 |
color |
|
| System.Single |
range |
|
| System.String |
debugName |
|
UpdateLight()
Declaration
public void UpdateLight()
UpdateReflectorRangeAndAngle(Single, Single)
Use when setting both values and previous state of both value is undefined
Declaration
public void UpdateReflectorRangeAndAngle(float reflectorConeMaxAngleCos, float reflectorRange)
Parameters
| Type |
Name |
Description |
| System.Single |
reflectorConeMaxAngleCos |
|
| System.Single |
reflectorRange |
|