CutPolygonCollection

new YS.CutPolygonCollection(i3d, options)

裁剪集合,可以对i3d的实例进行多区域裁剪
Name Type Description
i3d I3d 需要应用shader的模型实例
options Object optional 对象有下面这些属性
Name Type Default Description
polygons Array.<CutPolygon> [] optional 区域数组
enabled Boolean true optional 是否启用shader
unionCutPolygonRegions Boolean false optional 裁剪区域还是保留区域,false裁剪区域,true保留区域
Implements:

Members

enabled : Boolean

获取或设置该shader是否启用

length : Number

获取区域的数量

unionCutPolygonRegions : Boolean

获取或设置是裁剪区域还是保留区域

Methods

add(cutPlygon)Boolean

添加一个区域
Name Type Description
cutPlygon CutPolygon 区域
Returns:
添加成功返回true, 添加失败返回false

clean()

清空所有区域
Implements:

destroy()

销毁该shader
Implements:

remove(cutPlygon)Boolean

删除一个区域
Name Type Description
cutPlygon CutPolygon 区域
Returns:
删除返回true, 删除失败返回false