kick.scene.Skybox Class
Create a skybox object. Must be attached to a GameObject with camera component - otherwise nothing will be rendered. The camera must have a near clipping plane less than 1.0 and a far clipping plane greater than 1.0, otherwise the skybox will be clipped.
The skybox is rendered with render order 1999, which should be the last rendering of the opaque geometry to avoid overdraw.
Constructor
kick.scene.Skybox
-
config
Parameters:
-
config
Object
Example:
var skyBox = new kick.scene.Skybox();
skyBox.material = new kick.material.Material( {
shader: engine.project.load(engine.project.ENGINE_SHADER_SKYBOX),
uniformData: {
mainTexture: cubemapTexture
}
});
cameraGameObject.addComponent(skyBox);
Item Index
Methods
Properties
Events
Methods
activated
()
Abstract method called when a component is added to scene. May be undefined.
This method method works in many cases like a constructor function, where references to other game objects can
be looked up (this cannot be done when the actual constructor function is called, since the scene may not be
loaded completely).
Note that activated are called just after update methods on all components has been called - this makes it easier
to get references to other components.
deactivated
()
Abstract method called when a component is removed from scene. May be undefined.
render
-
engineUniforms
-
[overwriteMaterial]
Render skybox
Parameters:
-
engineUniforms
kick.scene.EngineUniforms -
[overwriteMaterial]
kick.material.Material optional
toJSON
()
JSON
Returns:
update
()
Abstract method called every update. May be undefined.
Properties
aabb
kick.math.Aabb
Defines the axis aligned bounding box used for view frustum culling May be undefined or null.
componentType
String
final
Name of the component type = "skybox".
Example:
var skybox = gameObject.skybox;
gameObject
kick.scene.GameObject
The gameObject owning the component. Initially undefined. The value is set when the Component object is added to a GameObject
renderOrder
Number
The renderOrder for materials[0]
scriptPriority
Number
Components with largest priority are invoked first. (optional - default 0). Cannot be modified after creation.
Events
componentUpdated
Fire events when components are updated. May be undefined. Must be defined before adding to gameObject.
Event Payload:
-
component
kick.scene.Component