提交 e77dee8c 编写于 作者: T Takahiro

Add GLTFLoader LineMaterial support

上级 8e56415c
......@@ -2106,17 +2106,40 @@ THREE.GLTFLoader = ( function () {
}
} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {
} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ||
primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ||
primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) {
mesh = new THREE.LineSegments( geometry, material );
var cacheKey = 'LineBasicMaterial:' + material.uuid;
} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) {
var lineMaterial = scope.cache.get( cacheKey );
mesh = new THREE.Line( geometry, material );
if ( ! lineMaterial ) {
} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) {
lineMaterial = new THREE.LineBasicMaterial();
THREE.Material.prototype.copy.call( lineMaterial, material );
lineMaterial.color.copy( material.color );
lineMaterial.lights = false; // LineBasicMaterial doesn't support lights yet
mesh = new THREE.LineLoop( geometry, material );
scope.cache.add( cacheKey, lineMaterial );
}
material = lineMaterial;
if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {
mesh = new THREE.LineSegments( geometry, material );
} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) {
mesh = new THREE.Line( geometry, material );
} else {
mesh = new THREE.LineLoop( geometry, material );
}
} else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册