MockCarStream

MockCarStream

new MockCarStream(args)

Description:
  • 模拟车流
Source:
  • objects/other/MockCarStream.js, line4
Parameters:
Name Type Description
args object 构造函数参数对象
Properties
Name Type Attributes Default Description
runOnTheGround string <optional>
false 车辆是否在地面运行,默认false
lanesNumber number <optional>
1 车流车道数,默认1
forwardInterval number <optional>
1000 最小车距,单位厘米
forwardSpeed number <optional>
200 车流速度
splineLoop number <optional>
false 是否闭环,默认false
randomBool number <optional>
false 是否随机生成,默认false
randomForwardOffset number <optional>
0 随机最大便宜0范围
laneWidth number <optional>
300 车流车道宽度,默认300cm
rotationOffset number <optional>
0 旋转角度偏移,度
scaleOffset object <optional>
{x: 1, y: 1, z: 1} 缩放大小
carType Array.<number> <optional>
[3,4,5,6,13,14,15,16] 车流中所包含的汽车的车型,支持所有实时车流车型类型映射
enableTrigger boolean <optional>
false 是否开启盒体触发器,用于设置是否支持收费站抬杆,默认false,
renderNum number <optional>
20 每帧渲染的shape数量,默认10,代表每一帧会渲染10个点位,如果点位太多,会导致渲染性能问题,如果超过20个,则自动启用分帧渲染

Extends

Members

(readonly) animateNeedsUpdate

Source:
  • objects/Shape/Shape.js, line814
Inherited From:
Properties:
Name Type Description
animateNeedsUpdate Boolean 动画是否变化

depthTest

Source:
  • objects/Shape/Shape.js, line398
Inherited From:
Default Value:
  • true
Properties:
Name Type Description
depthTest boolean 是否开启深度测试

map

Description:
  • 获取贴图
Source:
  • objects/Shape/Shape.js, line134
Overrides:
获取贴图

(readonly) materialNeedsUpdate

Source:
  • objects/Shape/Shape.js, line802
Inherited From:
Properties:
Name Type Description
materialNeedsUpdate Boolean 记录材质是否变化

(readonly) matrixNeedsUpdate

Source:
  • objects/Shape/Shape.js, line796
Inherited From:
Properties:
Name Type Description
matrixNeedsUpdate Boolean 记录空间是否变化

transparent

Source:
  • objects/Shape/Shape.js, line393
Inherited From:
Default Value:
  • opacity < 1.0
Properties:
Name Type Description
transparent boolean 是否透明

visible

Description:
  • 获取可见性状态
Source:
  • objects/Shape/Shape.js, line113
Overrides:
获取可见性状态

(readonly) visibleNeedsUpdate

Source:
  • objects/Shape/Shape.js, line808
Inherited From:
Properties:
Name Type Description
visibleNeedsUpdate Boolean 记录显隐是否变化

Methods

animate(options) → {TWEEN.Tween}

Description:
  • 动画函数,to中的animateOffset表示位置偏移单位cm
Source:
  • objects/Shape/Shape.js, line828
Inherited From:
Parameters:
Name Type Description
options object {from, to, duration, easing, loop}
Properties
Name Type Description
from object 起始值{position:null,rotation:null,scale:null} 可不设置,不设置就是当前状态
to object 结束值{position:{x,y,z},rotation:{roll,pitch,yaw},scale:{x,y,z},animateOffset:{x,y,z}}
duration number 动画持续时间,默认3000豪秒,单位豪秒
easing string 缓动函数 默认Linear,可选 Quadratic,Cubic,Sinusoidal,Exponential
loop boolean 是否循环,默认false
stayEnd boolean 动画结束后是否停留在最后一帧的位置,默认true
Returns:
返回Tween对象,可以调用stop()方法停止动画,onUpdate的时候会返回一个0-1的渐变值
Type
TWEEN.Tween

setData(geoJsonData)

Description:
  • 数据赋值与预处理
Source:
  • objects/Shape/Shape.js, line905
Inherited From:
Parameters:
Name Type Description
geoJsonData object geojson格式的几何信息

stopAnimate(delayTime)

Description:
  • 停止动画
Source:
  • objects/Shape/Shape.js, line891
Inherited From:
Parameters:
Name Type Default Description
delayTime 1000 延迟时间,默认为1000毫秒