跳至主要內容

Fence

小于 1 分钟

Fence

Fence主要用于创建围栏类对象,继承自ThingGeometry对象,拥有一切ThingGeometry属性及方法。

构造器

new VT.Fence({
    // 点位数组 [[x, y, z], [x, y, z]...]
    points: [], 
    // 几何参数
    geometry: {
        // 高度
        height: 1.0,
    },
    // 材质类型:THREE.MeshStandardMaterial
    material: {
        side: 2,
        transparent: true,
    },
})

属性成员

type

  • 类型:{String} 物体类型Fence, 不可改

needPoints

  • 类型:{Boolean} 是否需要控制点,不可更改,默认为true

isFence

  • 类型:{Boolean} 是否为Fence对象,不可更改

length

  • 类型:{Number} 线长度,自动计算,不可更改

points

  • 类型:{Array} 所有点位置

方法

getPoints

获取所有点位置

  • getPoints()
  • 类型:{Function}
  • 参数:无
  • 返回:{Array}

updatePoints

更新点位置

  • updatePoints(points)
  • 类型:{Function}
  • 参数:
    • points {Array} 点位置 [[x, y, z], [x, y, z]...]
  • 返回:无
上次编辑于:
贡献者: dashun