Constructor
new FencePlugin()
Methods
addPolygonFence(options)
添加一个多边形结构的电子围栏
Parameters:
Name | Type | Description |
---|---|---|
options |
* | id:Number/String 围栏ID points:Array 围栏底座的一组Vector3,注意首尾要重合形成闭环 height:Number 围栏高度 color1:String 围栏底部颜色 color2:String 围栏顶部颜色 opacity:Numher 围栏不透明度 |
removeAll()
清除所有
removeFence(id)
移除一个围栏
Parameters:
Name | Type | Description |
---|---|---|
id |
* |
validateBox(meshs, includeHeight)
判断一组mesh是否和围栏相交,注意为了性能考虑采用了box判断,如果是凸性或凹性过大的异形围栏或mesh,判断的准确性有影响
Parameters:
Name | Type | Default | Description |
---|---|---|---|
meshs |
Array | mesh数组 | |
includeHeight |
boolean | true | 判断的时候,是否需要考虑围栏的高度,默认true |
Returns:
Map,key是mesh,value是相交的电子围栏对象