Skip to content

Commit

Permalink
曾对curve提供半径配置
Browse files Browse the repository at this point in the history
  • Loading branch information
john-keith committed Apr 11, 2019
1 parent efc1014 commit d3e0435
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion FlyLine.js
Expand Up @@ -5,13 +5,15 @@ class FlyLine extends THREE.Object3D{
* color 颜色
* segFlag 设置分段标记 (周期)
* alphaTest 启用透明测试
* radius 半径只有首参数为curve可用
*/
constructor(curveOrObject, options){
super()

let color = options && options.color || 0xffffff
let segFlag = options && options.segFlag || false
let alphaTest = options && options.alphaTest || true
let radius = options && options.radius || 1

this.mesh = null
let v_shader = `
Expand Down Expand Up @@ -53,7 +55,7 @@ class FlyLine extends THREE.Object3D{
let geo

if(curveOrObject instanceof THREE.Curve){
geo = new THREE.TubeBufferGeometry(curveOrObject, 10, 0.15, 4)
geo = new THREE.TubeBufferGeometry(curveOrObject, 10, 0.15 * radius, 4)
}else if(curveOrObject instanceof THREE.Geometry || curveOrObject instanceof THREE.BufferGeometry ){
geo = curveOrObject
}else {
Expand Down

0 comments on commit d3e0435

Please sign in to comment.