Show / Hide Table of Contents

Class MyLight

Inheritance
System.Object
MyLight
Namespace: Sandbox.Game.Lights
Assembly: Sandbox.Game.dll
Syntax
public class MyLight : Object

Constructors

MyLight()

Declaration
public MyLight()

Properties

CastShadows

Declaration
public bool CastShadows { get; set; }
Property Value
Type Description
System.Boolean

Color

Declaration
public Color Color { get; set; }
Property Value
Type Description
Color

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
Type Description
Vector2

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
Type Description
MyLightSourceType

LightType

Declaration
public MyLightType LightType { get; set; }
Property Value
Type Description
MyLightType

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
Type Description
Vector3D

Range

Declaration
public float Range { get; set; }
Property Value
Type Description
System.Single

ReflectorColor

Declaration
public Color ReflectorColor { get; set; }
Property Value
Type Description
Color

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
Type Description
Vector3

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
Type Description
Vector3

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
public void Clear()

MarkPositionDirty()

Declaration
public void MarkPositionDirty()

SpotlightNotTooLarge(Single, Single)

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
☀
☾
In This Article
  • Constructors
    • MyLight()
  • Properties
    • CastShadows
    • Color
    • DiffuseFactor
    • Falloff
    • GlareIntensity
    • GlareMaxDistance
    • GlareOn
    • GlareQueryFreqMinMs
    • GlareQueryFreqRndMs
    • GlareQueryShift
    • GlareQuerySize
    • GlareSize
    • GlareType
    • GlossFactor
    • Intensity
    • LightOn
    • LightSourceType
    • LightType
    • ParentID
    • PointLightOffset
    • Position
    • Range
    • ReflectorColor
    • ReflectorConeDegrees
    • ReflectorConeMaxAngleCos
    • ReflectorConeRadians
    • ReflectorDiffuseFactor
    • ReflectorDirection
    • ReflectorFalloff
    • ReflectorGlossFactor
    • ReflectorIntensity
    • ReflectorOn
    • ReflectorRange
    • ReflectorTexture
    • ReflectorUp
    • RenderObjectID
    • SubGlares
  • Methods
    • Clear()
    • MarkPositionDirty()
    • SpotlightNotTooLarge(Single, Single)
    • Start(String)
    • Start(Vector3D, Vector4, Single, String)
    • Start(Vector4, Single, String)
    • UpdateLight()
    • UpdateReflectorRangeAndAngle(Single, Single)
Back to top
Generated by DocFX
☀
☾