业务咨询
开发咨询
微信沟通

Class: BaseStyle

THING~ BaseStyle

物体样式基类


BaseStyle()

Members


alwaysOnTop :Boolean

设置物体是否始终在最前端渲染显示

Type:
  • Boolean

boundingBox :Boolean

显示/隐藏物体包围盒

Type:
  • Boolean

boundingBoxColor :Number|String

设置包围盒颜色

Type:
  • Number | String

color :String|Number

设置/获取物体颜色 可填写 十六进制颜色值 或 rgb 字符串,取消颜色设置为 null

Type:
  • String | Number
Example
// 使用十六进制颜色
obj.style.color = '#ff0000';
// 使用 rgb 颜色
obj.style.color = 'rgb(255,0,0)';
// 取消颜色
obj.style.color = null;

doubleSide :Boolean

设置双面渲染

Type:
  • Boolean

emissive :String|Number

设置/获取材质自发光颜色

Type:
  • String | Number
Example
obj.style.emissive = '#ffff00';

emissiveScrollImage :String

设置/获取材质自发光滚动贴图。 最终的发光结果会乘以emissive的颜色。如果想让发光贴图生效,需要确认emissive不是黑色。

Type:
  • String
Example
obj.style.emissiveScrollImage = 'https://www.thingjs.com/static/images/avatar.png';

environmentImage :String|Array

设置/获取反射贴图

Type:
  • String | Array
Example
obj.style.environmentImage = 'BlueSky';

highlight :String|Number

设置/获取高亮颜色,默认值为 null。

Type:
  • String | Number
Example
obj.style.highlight = '#ffff00';

highlightIntensity :Number

设置/获取高亮强度,默认为0.5。设置为null,则等效于恢复到0.5。 如果高亮颜色为null,则该属性没有实际效果。

Type:
  • Number
Example
obj.style.highlightIntensity = 0.8;

image :String|Object

设置贴图 填写图片资源路径 或 image 对象

Type:
  • String | Object
Example
// 使用图片路径
obj.style.image = 'https://www.thingjs.com/static/images/avatar.png';

metalness :Number

材质金属度系数

Type:
  • Number

opacity :Number

设置/获取物体不透明度,0 为全透明,1为不透明

Type:
  • Number
Example
obj.style.opacity = 0.8;

outlineColor :Number|String

设置/获取物体勾边颜色 颜色可填写 十六进制颜色值 或 rgb 字符串,取消勾边颜色设置为 null

Type:
  • Number | String
Example
// 使用十六进制颜色
obj.style.outlineColor = '#ff0000';
// 使用 rgb 颜色
obj.style.outlineColor = 'rgb(255,0,0)';
// 取消勾边颜色
obj.style.outlineColor = null;

renderOrder :Number

设置/获取渲染排序值, 数值越小越先渲染,默认值为 0

Type:
  • Number

roughness :Number

设置材质粗糙度系数

Type:
  • Number

skipOutline :Boolean

开启/禁用勾边

Type:
  • Boolean

wireframe :Boolean

开启/关闭线框模式

Type:
  • Boolean