import Material from '@mobilizing/library/js/Mobilizing/renderer/3D/three/scene/Material.js'
Material
A material will give color and some effect to the surface of the 3D object. Mobilizing.js 3D renderer is based on the one of Three.js https://threejs.org/docs/index.html#api/en/materials/Material and its variations
Constructor Summary
Public Constructor | ||
public | constructor(params: Object) |
Member Summary
Public Members | ||
public | color: * | |
public | customParams: * | |
public | shading: * | |
public | texture: * | |
public | type: * |
Private Members | ||
private | _material: * |
Method Summary
Public Methods | ||
public | erase() erase this material (calling dispose and clearing texture map) | |
public | ||
public | ||
public | ||
public | ||
public | ||
public | getNativeObject(): * | |
public | getOpacity(): float | |
public | ||
public | getProperty(name: String): Object | |
public | ||
public | ||
public | Gets the current texture | |
public | ||
public | ||
public | setAlphaTest(val: Number) | |
public | setBlending(name: String) | |
public | ||
public | setDepthTest(bool: boolean) Sets the depth test. | |
public | setDepthWrite(bool: boolean) Sets the depth write. | |
public | setDoubleSided(sided: Boolean) | |
public | setEmissiveColor(color: Color) | |
public | setLineWidth(val: Number) | |
public | setOpacity(op: float) | |
public | setPointSize(val: Number) | |
public | setProperty(name: String, value: Object) | |
public | setShading(shading: String) | |
public | setShininess(color: Number) | |
public | setSpecularColor(color: Color) | |
public | setTexture(texture: Texture) set this material texture | |
public | setTransparent(trans: Boolean) | |
public | setUniform(name: String, value: Object) | |
public | setWireframe(wireframe: Boolean) |
Public Constructors
public constructor(params: Object) source
Params:
Name | Type | Attribute | Description |
params | Object | The parameters object | |
params.type | String | THREE.Material |
| the type of the matrial, one of "basic", "projectionmapping", "phong", "line", "sprite", or directly a Three.js Material. |
params.color | Color |
| |
params.shading | String |
| |
params.customParams | Object |
| the parameters to use for custom type. |
Example:
//this is how to use a parameters object in order to instanciate a Mobilizing.js object
var mobilizingObject = new Mobilizing.Class({paramName1: value, paramName2: value});
Public Members
public color: * source
public customParams: * source
public shading: * source
public texture: * source
public type: * source
Private Members
private _material: * source
Public Methods
public erase() source
erase this material (calling dispose and clearing texture map)
public getNativeObject(): * source
Return:
* | the Three.js native object used in this class |
public getOpacity(): float source
Return:
float |
public getProperty(name: String): Object source
Params:
Name | Type | Attribute | Description |
name | String |
Return:
Object | value (depending on the property) |
public setDepthTest(bool: boolean) source
Sets the depth test.
Params:
Name | Type | Attribute | Description |
bool | boolean | The depthTest value |
public setDepthWrite(bool: boolean) source
Sets the depth write.
Params:
Name | Type | Attribute | Description |
bool | boolean | The depthWrite value |
public setOpacity(op: float) source
Params:
Name | Type | Attribute | Description |
op | float | between 0 and 1 |
public setShading(shading: String) source
Params:
Name | Type | Attribute | Description |
shading | String | one of "smooth", "flat" |
public setTexture(texture: Texture) source
set this material texture
Params:
Name | Type | Attribute | Description |
texture | Texture |