跳至主要內容

NavigationRoute

小于 1 分钟

NavigationRoute

路线,继承自RouteLine对象,拥有一切RouteLineLineBaseThing属性及方法。

构造器

new VT.NavigationRoute({
    // 点位数组 [[x, y, z], [x, y, z]...]
    points: [],

    // 几何造型
    geometry: {
        // 线宽
        width: 0.5,
    },
    // 材质
    material: {
        // 面
        "side": 2,
        // 是否采用世界单位,世界单位1代表1米
        "worldUnits": true,
        // 贴图
        "map": {
            "image": "sdk:/resources/texture/arrow.png",
            "repeat": [0.2, 1]
        },
        // 透明
        "transparent": true,
        // 颜色
        "color": "#04F8A6",
        // 宽度
        "width": 0.05
    },
    // 动画配置
    animate: {
        // 开启动画
        enable: true,
        // 速度
        speed: 0.01,
    }
})

属性成员

type

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

isNavigationRoute

  • 类型:{Boolean} 是否为isNavigationRoute,不可更改,默认为true

needPoints

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

line

  • 类型:{THREE.Line} 线对象

length

  • 类型:{Number} 线长度

points

  • 类型:{Array} 点位数组

方法

updatePoints

更新点位置

  • updatePoints(points)
  • 类型:{Function}
  • 参数:
    • points {Array} 点位置 [[x, y, z], [x, y, z]...]
  • 返回:无

updateAnimate

更新动画配置

  • updateAnimate(option)
  • 类型:{Function}
  • 参数:
    • option {Object} {speed, enable}
  • 返回:无

startAnimate

开启动画

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

stopAnimate

停止动画

  • stopAnimate()
  • 类型:{Function}
  • 参数:无
  • 返回:无
上次编辑于:
贡献者: dashun