# new EnvironmentMap()
- Source:
Pass rendering scene to a environment cube map
Example
// Example of car reflection
    var envMap = new clay.TextureCube({
        width: 256,
        height: 256
    });
    var envPass = new clay.prePass.EnvironmentMap({
        position: car.position,
        texture: envMap
    });
    var carBody = car.getChildByName('body');
    carBody.material.enableTexture('environmentMap');
    carBody.material.set('environmentMap', envMap);
    ...
    animation.on('frame', function(frameTime) {
        envPass.render(renderer, scene);
        renderer.render(scene, camera);
    });Extends
Members
# __uid__ :number
- Source:
- Inherited From:
Type:
- number
# far :number
- Source:
Camera far plane
Type:
- number
# near :number
- Source:
Camera near plane
Type:
- number
# position :clay.Vector3
- Source:
Camera position
Type:
# shadowMapPass :clay.prePass.ShadowMap
- Source:
Used if you wan't have shadow in environment map
Type:
# texture :clay.TextureCube
- Source:
Environment cube map
Type:
Methods
# after(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('after' + name)
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| name | string | ||
| action | function | ||
| context | Object | <optional> | 
# before(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of once('before' + name)
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| name | string | ||
| action | function | ||
| context | Object | <optional> | 
# dispose(renderer)
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| renderer | clay.Renderer | 
# error(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('error')
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| action | function | ||
| context | Object | <optional> | 
# getCamera(target) → {clay.Camera}
- Source:
Parameters:
| Name | Type | Description | 
|---|---|---|
| target | string | 
Returns:
- Type
- clay.Camera
# has(name, action) → {boolean}
- Source:
- Inherited From:
- Mixes In:
If registered the event handler
Parameters:
| Name | Type | Description | 
|---|---|---|
| name | string | |
| action | function | 
Returns:
- Type
- boolean
# off(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Remove event listener
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| action | function | ||
| context | Object | <optional> | 
# on(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event handler
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| name | string | ||
| action | function | ||
| context | Object | <optional> | 
# once(name, action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Register event, event will only be triggered once and then removed
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| name | string | ||
| action | function | ||
| context | Object | <optional> | 
# render(renderer, scene, notUpdateSceneopt)
- Source:
Parameters:
| Name | Type | Attributes | Default | Description | 
|---|---|---|---|---|
| renderer | clay.Renderer | |||
| scene | clay.Scene | |||
| notUpdateScene | boolean | <optional> | false | 
# success(action, contextopt)
- Source:
- Inherited From:
- Mixes In:
Alias of on('success')
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| action | function | ||
| context | Object | <optional> | 
# trigger(name)
- Source:
- Inherited From:
- Mixes In:
Trigger event
Parameters:
| Name | Type | Description | 
|---|---|---|
| name | string |