Class: Style

THING.Style(modifier)

Style The style resource of objects.

Constructor

new Style(modifier)

The object style, it can change object's color, outlineColor etc.
Parameters:
Name Type Description
modifier Object The modifier.
Source:

Members

alphaMap :THING.ImageTexture

Get/Set the image resource of alpha map.
Type:
Source:

aoMap :THING.ImageTexture

Get/Set the image resource of ao map.
Type:
Source:

blendingType :BlendingType

Get/Set the blending type.
Type:
Source:

clippingPlanes :Array.<THING.ClippingPlanes>

Get/Set the clipping planes.
Type:
Source:
Example
let clippingPlanes = [
	{ direction: [0, -1, 0], height: 10 }, // top
	{ direction: [0, 1, 0], height: 10 }, // bottom
	{ direction: [-1, 0, 0], height: 10 }, // right
	{ direction: [1, 0, 0], height: 10 }, // left
	{ direction: [0, 0, -1], height: 10 }, // front
	{ direction: [0, 0, 1], height: 10 } // back
];

let clippingPlanesObject = new THING.ClippingPlanes({
	parent: object,
	planes: clippingPlanes,
});

object.query('*', { includeSelf: true }).style.clippingPlanes = clippingPlanesObject;

color :Number|String|Array.<Number>|StyleColorOperationCallback

Get/Set the color.
Type:
Source:

colorMapping :THING.ImageTexture

Get/Set the image resource of color mapping.
Type:
Source:

depthTest :Boolean

Enable/Disable depth test.
Type:
  • Boolean
Source:

depthWrite :Boolean

Enable/Disable depth write.
Type:
  • Boolean
Source:

edge :StyleEdgeResult

Get/Set the edge.
Type:
Source:

effect :StyleEffectResult

Get/Set the effect.
Type:
Source:

emissive :Number|String|Array.<Number>|StyleColorOperationCallback

Get/Set the emissive.
Type:
Source:

emissiveMap :THING.ImageTexture

Get/Set the image resource of emissive map.
Type:
Source:

envMap :THING.ImageTexture

Get/Set the image resource of env map.
Type:
Source:

envMapping :Boolean

Enable/Disable the env mapping.
Type:
  • Boolean
Source:

image :*

Get/Set the (canvas/image/url) image resource.
Type:
  • *
Source:

imageSlotType :ImageSlotType

Get/Set the current image slot type.
Type:
Source:

map :THING.ImageTexture

Get/Set the image resource of map.
Type:
Source:

metalness :Number|StyleValueOperationCallback

Get/Set the metalness.
Type:
Source:

normalMap :THING.ImageTexture

Get/Set the image resource of normal map.
Type:
Source:

opacity :Number|StyleValueOperationCallback

Get/Set the opacity.
Type:
Source:

outlineColor :Number|String|Array.<Number>

Get/Set the outline color.
Type:
  • Number | String | Array.<Number>
Source:

roughness :Number|StyleValueOperationCallback

Get/Set the roughness.
Type:
Source:

sideType :SideType

Get/Set the side type.
Type:
Source:

transparent :Boolean

Enable/Disable transparent mode.
Type:
  • Boolean
Source:

uv :StyleUVMatrixResult

Get/Set the uv(matrix).
Type:
Source:

wireframe :Boolean

Enable/Disable wireframe.
Type:
  • Boolean
Source:

Methods

beginDefaultValues()

Begin to set default values.
Source:

endDefaultValues()

End to set default values.
Source: