Documentation
¶
Overview ¶
Represents a light as defined by the KHR_lights_punctual glTF extension.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AsGLTFLight() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) Color() Color.RGBA
- func (self Instance) GetAdditionalData(extension_name string) any
- func (self Instance) ID() ID
- func (self Instance) InnerConeAngle() Angle.Radians
- func (self Instance) Intensity() Float.X
- func (self Instance) LightType() string
- func (self Instance) OuterConeAngle() Angle.Radians
- func (self Instance) Range() Float.X
- func (self Instance) SetAdditionalData(extension_name string, additional_data any)
- func (self Instance) SetColor(value Color.RGBA)
- func (self Instance) SetInnerConeAngle(value Angle.Radians)
- func (self Instance) SetIntensity(value Float.X)
- func (self Instance) SetLightType(value string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOuterConeAngle(value Angle.Radians)
- func (self Instance) SetRange(value Float.X)
- func (self Instance) ToDictionary() Structure
- func (self Instance) ToNode() Light3D.Instance
- func (self Instance) Virtual(name string) reflect.Value
- type Structure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsGLTFLight ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func FromDictionary ¶
Creates a new GLTFLight instance by parsing the given data structure.
func (Instance) AsGLTFLight ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) Color ¶
The Color.RGBA of the light in linear space. Defaults to white. A black color causes the light to have no effect.
This value is linear to match glTF, but will be converted to nonlinear sRGB when creating a Godot Light3D node upon import, or converted to linear when exporting a Godot Light3D to glTF.
func (Instance) GetAdditionalData ¶
func (Instance) InnerConeAngle ¶
The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle.
Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot SpotLight3D, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light.
func (Instance) Intensity ¶
The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier.
func (Instance) LightType ¶
The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's OmniLight3D, SpotLight3D, and DirectionalLight3D respectively.
func (Instance) OuterConeAngle ¶
The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle.
At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot SpotLight3D, the outer cone angle is used as the angle of the spotlight.
func (Instance) Range ¶
The range of the light, beyond which the light has no effect. glTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096.0.
func (Instance) SetAdditionalData ¶
func (Instance) SetInnerConeAngle ¶
SetInnerConeAngle sets the property returned by [GetInnerConeAngle].
func (Instance) SetIntensity ¶
SetIntensity sets the property returned by [GetIntensity].
func (Instance) SetLightType ¶
SetLightType sets the property returned by [GetLightType].
func (Instance) SetOuterConeAngle ¶
SetOuterConeAngle sets the property returned by [GetOuterConeAngle].
func (Instance) ToDictionary ¶
Serializes this GLTFLight instance into a data structure.