123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- Namespace mojo3d
- #rem monkeydoc The LightType enumeration.
- Note: Only directional lights are currently fully supported.
- | LightType | Description
- |:--------------|:-----------
- | `Directional` | Light at infinity.
- | `Point` | Point light.
- | `Spot` | Spot light.
- #end
- Enum LightType
- Directional=1
- Point=2
- Spot=3
- End
- #rem monkeydoc The Light class.
- #end
- Class Light Extends Entity
- #rem monkeydoc Creates a new light.
- #end
- Method New( parent:Entity=Null )
-
- Super.New( parent )
-
- Name="Light"
- Type=LightType.Directional
- CastsShadow=False
- Range=10
-
- AddInstance()
-
- Visible=True
- End
-
- #rem monkeydoc Copies the light.
- #end
- Method Copy:Light( parent:Entity=Null ) Override
-
- Local copy:=OnCopy( parent )
-
- CopyTo( copy )
-
- Return copy
- End
-
- #rem monkeydoc The light type.
- #end
- Property Type:LightType()
-
- Return _type
-
- Setter( type:LightType )
-
- _type=type
- End
-
- #rem monkeydoc Light shadows enabled flag.
- #end
- [jsonify=1]
- Property CastsShadow:Bool()
-
- Return _castsShadow
-
- Setter( shadows:Bool )
-
- _castsShadow=shadows
- End
-
- #rem monkeydoc The light range.
- #end
- [jsonify=1]
- Property Range:Float()
-
- Return _range
-
- Setter( range:Float )
-
- _range=range
- End
-
- Protected
- Method New( light:Light,parent:Entity )
-
- Super.New( light,parent )
-
- Type=light.Type
- Color=light.Color
- Range=light.Range
-
- AddInstance( light )
- End
-
- Method OnCopy:Light( parent:Entity ) Override
-
- Return New Light( Self,parent )
- End
-
- Method OnShow() Override
-
- Scene.Lights.Add( Self )
- End
-
- Method OnHide() Override
-
- Scene.Lights.Remove( Self )
- End
- Private
-
- Field _type:LightType
-
- Field _color:Color
-
- Field _range:Float
-
- Field _castsShadow:bool
-
- Field _dynamic:Bool
- End
|