Space Engineers
Public Types | Public Member Functions | Static Public Member Functions | Properties | List of all members
Sandbox.Game.Lights.MyLight Class Reference

Public Types

enum  LightTypeEnum { LightTypeEnum.None = 0, LightTypeEnum.PointLight = 1 << 0, LightTypeEnum.Spotlight = 1 << 1, LightTypeEnum.Hemisphere = 1 << 2 }
 Light type, flags, could be combined More...
 
enum  LightOwnerEnum { LightOwnerEnum.None, LightOwnerEnum.SmallShip, LightOwnerEnum.LargeShip, LightOwnerEnum.Missile }
 

Public Member Functions

 MyLight ()
 IMPORTANT: This class isn't realy inicialized by constructor, but by Start() So don't initialize members here, do it in Start() More...
 
void Start (LightTypeEnum lightType, Vector3 position, Vector4 color, float falloff, float range)
 
void Start (LightTypeEnum lightType, Vector4 color, float falloff, float range)
 
void Start (LightTypeEnum lightType, float falloff)
 
void UpdateLight ()
 
void Clear ()
 Can be called only from MyLights.RemoveLight. More...
 
void MarkPositionDirty ()
 
void MarkPropertiesDirty ()
 
bool IsPointLightInFrustum ()
 
bool IsSpotLightInFrustum ()
 
bool SpotlightNotTooLarge (float reflectorConeMaxAngleCos, float reflectorRange)
 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) More...
 
void UpdateReflectorRangeAndAngle (float reflectorConeMaxAngleCos, float reflectorRange)
 Use when setting both values and previous state of both value is undefined More...
 

Static Public Member Functions

static float ConeRadiansToConeMaxAngleCos (float value)
 
static float ConeDegreesToConeMaxAngleCos (float value)
 
static float ConeMaxAngleCosToRadians (float reflectorConeMaxAngleCos)
 
static float ConeMaxAngleCosToDegrees (float reflectorConeMaxAngleCos)
 

Properties

LightTypeEnum LightType [get, set]
 
Vector3D Position [get, set]
 
int ParentID [get, set]
 
float PointLightOffset [get, set]
 Value from 0 to 1 indication light offset in direction of reflector 0 means zero offset, 1 means radius offset More...
 
Color Color [get, set]
 
Color SpecularColor [get, set]
 
float Falloff [get, set]
 Exponential falloff (1 = linear, 2 = quadratic, etc) More...
 
float GlossFactor [get, set]
 
float DiffuseFactor [get, set]
 
float Range [get, set]
 
float Intensity [get, set]
 
bool LightOn [get, set]
 If true, we use the light in lighting calculation. Otherwise it's like turned off, but still in the buffer. More...
 
bool UseInForwardRender [get, set]
 
float ReflectorIntensity [get, set]
 Reflector parameters are also parameters for spot light More...
 
bool ReflectorOn [get, set]
 
Vector3 ReflectorDirection [get, set]
 
Vector3 ReflectorUp [get, set]
 
float ReflectorConeMaxAngleCos [get, set]
 
Color ReflectorColor [get, set]
 
float ReflectorRange [get, set]
 
float ReflectorFalloff [get, set]
 
float ReflectorGlossFactor [get, set]
 
float ReflectorDiffuseFactor [get, set]
 
string ReflectorTexture [get, set]
 
float ShadowDistance [get, set]
 
bool CastShadows [get, set]
 
bool GlareOn [get, set]
 
MyGlareTypeEnum GlareType [get, set]
 
float GlareSize [get, set]
 
float GlareQuerySize [get, set]
 
float GlareQueryFreqMinMs [get, set]
 
float GlareQueryFreqRndMs [get, set]
 
float GlareIntensity [get, set]
 
string GlareMaterial [get, set]
 
float GlareMaxDistance [get, set]
 
Vector3D PositionWithOffset [get]
 
BoundingSphereD PointBoundingSphere [get]
 
BoundingBoxD SpotBoundingBox [get]
 
MatrixD SpotWorld [get]
 
float ReflectorConeRadians [get, set]
 Sets reflector cone angle in degrees, minimum is 0, teoretical maximum is PI More...
 
float ReflectorConeDegrees [get, set]
 Sets reflector cone angle in degrees, minimum is 0, teoretical maximum is 180 More...
 
bool IsTypePoint [get]
 
bool IsTypeHemisphere [get]
 
bool IsTypeSpot [get]
 
LightOwnerEnum LightOwner [get, set]
 
uint RenderObjectID [get]
 

Detailed Description

Definition at line 16 of file MyLight.cs.

Member Enumeration Documentation

Enumerator
None 
SmallShip 
LargeShip 
Missile 

Definition at line 33 of file MyLight.cs.

Light type, flags, could be combined

Enumerator
None 
PointLight 
Spotlight 
Hemisphere 

Definition at line 25 of file MyLight.cs.

Constructor & Destructor Documentation

Sandbox.Game.Lights.MyLight.MyLight ( )
inline

IMPORTANT: This class isn't realy inicialized by constructor, but by Start() So don't initialize members here, do it in Start()

Definition at line 721 of file MyLight.cs.

Member Function Documentation

void Sandbox.Game.Lights.MyLight.Clear ( )
inline

Can be called only from MyLights.RemoveLight.

Definition at line 847 of file MyLight.cs.

static float Sandbox.Game.Lights.MyLight.ConeDegreesToConeMaxAngleCos ( float  value)
inlinestatic

Definition at line 48 of file MyLight.cs.

static float Sandbox.Game.Lights.MyLight.ConeMaxAngleCosToDegrees ( float  reflectorConeMaxAngleCos)
inlinestatic

Definition at line 58 of file MyLight.cs.

static float Sandbox.Game.Lights.MyLight.ConeMaxAngleCosToRadians ( float  reflectorConeMaxAngleCos)
inlinestatic

Definition at line 53 of file MyLight.cs.

static float Sandbox.Game.Lights.MyLight.ConeRadiansToConeMaxAngleCos ( float  value)
inlinestatic

Definition at line 43 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.IsPointLightInFrustum ( )
inline

Definition at line 863 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.IsSpotLightInFrustum ( )
inline

Definition at line 868 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.MarkPositionDirty ( )
inline

Definition at line 853 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.MarkPropertiesDirty ( )
inline

Definition at line 858 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.SpotlightNotTooLarge ( float  reflectorConeMaxAngleCos,
float  reflectorRange 
)
inline

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)

Returns

Definition at line 879 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.Start ( LightTypeEnum  lightType,
Vector3  position,
Vector4  color,
float  falloff,
float  range 
)
inline

Definition at line 725 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.Start ( LightTypeEnum  lightType,
Vector4  color,
float  falloff,
float  range 
)
inline

Definition at line 731 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.Start ( LightTypeEnum  lightType,
float  falloff 
)
inline

Definition at line 739 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.UpdateLight ( )
inline

Definition at line 766 of file MyLight.cs.

void Sandbox.Game.Lights.MyLight.UpdateReflectorRangeAndAngle ( float  reflectorConeMaxAngleCos,
float  reflectorRange 
)
inline

Use when setting both values and previous state of both value is undefined

Parameters
reflectorConeMaxAngleCos
range

Definition at line 900 of file MyLight.cs.

Property Documentation

bool Sandbox.Game.Lights.MyLight.CastShadows
getset

Definition at line 496 of file MyLight.cs.

Color Sandbox.Game.Lights.MyLight.Color
getset

Definition at line 186 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.DiffuseFactor
getset

Definition at line 239 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.Falloff
getset

Exponential falloff (1 = linear, 2 = quadratic, etc)

Definition at line 215 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlareIntensity
getset

Definition at line 587 of file MyLight.cs.

string Sandbox.Game.Lights.MyLight.GlareMaterial
getset

Definition at line 600 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlareMaxDistance
getset

Definition at line 613 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.GlareOn
getset

Definition at line 509 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlareQueryFreqMinMs
getset

Definition at line 561 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlareQueryFreqRndMs
getset

Definition at line 574 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlareQuerySize
getset

Definition at line 548 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlareSize
getset

Definition at line 535 of file MyLight.cs.

MyGlareTypeEnum Sandbox.Game.Lights.MyLight.GlareType
getset

Definition at line 522 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.GlossFactor
getset

Definition at line 227 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.Intensity
getset

Definition at line 274 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.IsTypeHemisphere
get

Definition at line 687 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.IsTypePoint
get

Definition at line 679 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.IsTypeSpot
get

Definition at line 695 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.LightOn
getset

If true, we use the light in lighting calculation. Otherwise it's like turned off, but still in the buffer.

Definition at line 290 of file MyLight.cs.

LightOwnerEnum Sandbox.Game.Lights.MyLight.LightOwner
getset

Definition at line 703 of file MyLight.cs.

LightTypeEnum Sandbox.Game.Lights.MyLight.LightType
getset

Definition at line 123 of file MyLight.cs.

int Sandbox.Game.Lights.MyLight.ParentID
getset

Definition at line 154 of file MyLight.cs.

BoundingSphereD Sandbox.Game.Lights.MyLight.PointBoundingSphere
get

Definition at line 628 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.PointLightOffset
getset

Value from 0 to 1 indication light offset in direction of reflector 0 means zero offset, 1 means radius offset

Definition at line 171 of file MyLight.cs.

Vector3D Sandbox.Game.Lights.MyLight.Position
getset

Definition at line 136 of file MyLight.cs.

Vector3D Sandbox.Game.Lights.MyLight.PositionWithOffset
get

Definition at line 625 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.Range
getset

Definition at line 252 of file MyLight.cs.

Color Sandbox.Game.Lights.MyLight.ReflectorColor
getset

Definition at line 388 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorConeDegrees
getset

Sets reflector cone angle in degrees, minimum is 0, teoretical maximum is 180

Definition at line 667 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorConeMaxAngleCos
getset

Definition at line 373 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorConeRadians
getset

Sets reflector cone angle in degrees, minimum is 0, teoretical maximum is PI

Definition at line 652 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorDiffuseFactor
getset

Definition at line 454 of file MyLight.cs.

Vector3 Sandbox.Game.Lights.MyLight.ReflectorDirection
getset

Definition at line 345 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorFalloff
getset

Definition at line 422 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorGlossFactor
getset

Definition at line 438 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorIntensity
getset

Reflector parameters are also parameters for spot light

Definition at line 319 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.ReflectorOn
getset

Definition at line 332 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ReflectorRange
getset

Definition at line 401 of file MyLight.cs.

string Sandbox.Game.Lights.MyLight.ReflectorTexture
getset

Definition at line 470 of file MyLight.cs.

Vector3 Sandbox.Game.Lights.MyLight.ReflectorUp
getset

Definition at line 359 of file MyLight.cs.

uint Sandbox.Game.Lights.MyLight.RenderObjectID
get

Definition at line 709 of file MyLight.cs.

float Sandbox.Game.Lights.MyLight.ShadowDistance
getset

Definition at line 483 of file MyLight.cs.

Color Sandbox.Game.Lights.MyLight.SpecularColor
getset

Definition at line 199 of file MyLight.cs.

BoundingBoxD Sandbox.Game.Lights.MyLight.SpotBoundingBox
get

Definition at line 631 of file MyLight.cs.

MatrixD Sandbox.Game.Lights.MyLight.SpotWorld
get

Definition at line 640 of file MyLight.cs.

bool Sandbox.Game.Lights.MyLight.UseInForwardRender
getset

Definition at line 303 of file MyLight.cs.


The documentation for this class was generated from the following file: