API Docs for: 0.5.5
Show:

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);

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]
)

Inherited from kick.scene.Component but overwritten in kick/scene/Skybox.js:96

Render skybox

Parameters:

toJSON

() JSON

Inherited from kick.scene.Component but overwritten in kick/scene/Skybox.js:114

Returns:

JSON:

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

Inherited from kick.scene.Component but overwritten in kick/scene/Skybox.js:70

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

Inherited from kick.scene.Component but overwritten in kick/scene/Skybox.js:43

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: