kopia lustrzana https://github.com/robhawkes/vizicities
Added mesh customisation methods
rodzic
1075a0a144
commit
18648f2c25
|
@ -16850,7 +16850,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
var material;
|
||||
if (this._options.polygonMaterial && this._options.polygonMaterial instanceof THREE.Material) {
|
||||
material = this._options.material;
|
||||
material = this._options.polygonMaterial;
|
||||
} else if (!this._world._environment._skybox) {
|
||||
material = new THREE.MeshPhongMaterial({
|
||||
vertexColors: THREE.VertexColors,
|
||||
|
@ -16867,10 +16867,17 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolygonMesh === 'function') {
|
||||
mesh = this._options.onPolygonMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (flat) {
|
||||
material.depthWrite = false;
|
||||
|
@ -16885,11 +16892,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolygonMesh === 'function') {
|
||||
this._options.onPolygonMesh(mesh);
|
||||
}
|
||||
|
||||
this._polygonMesh = mesh;
|
||||
}
|
||||
}, {
|
||||
|
@ -16899,6 +16901,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
// itemSize = 3 because there are 3 values (components) per vertex
|
||||
geometry.addAttribute('position', new THREE.BufferAttribute(attributes.vertices, 3));
|
||||
|
||||
if (attributes.normals) {
|
||||
geometry.addAttribute('normal', new THREE.BufferAttribute(attributes.normals, 3));
|
||||
}
|
||||
|
||||
geometry.addAttribute('color', new THREE.BufferAttribute(attributes.colours, 3));
|
||||
|
||||
if (attributes.pickingIds) {
|
||||
|
@ -16913,7 +16920,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
var material;
|
||||
if (this._options.polylineMaterial && this._options.polylineMaterial instanceof THREE.Material) {
|
||||
material = this._options.material;
|
||||
material = this._options.polylineMaterial;
|
||||
} else {
|
||||
material = new THREE.LineBasicMaterial({
|
||||
vertexColors: THREE.VertexColors,
|
||||
|
@ -16924,16 +16931,25 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
});
|
||||
}
|
||||
|
||||
var mesh = new THREE.LineSegments(geometry, material);
|
||||
var mesh;
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolylineMesh === 'function') {
|
||||
mesh = this._options.onPolylineMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.LineSegments(geometry, material);
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
|
||||
// TODO: Allow this to be overridden, or copy mesh instead of creating a new
|
||||
// one just for picking
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new _enginePickingMaterial2['default']();
|
||||
// material.side = THREE.BackSide;
|
||||
|
@ -16945,11 +16961,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolylineMesh === 'function') {
|
||||
this._options.onPolylineMesh(mesh);
|
||||
}
|
||||
|
||||
this._polylineMesh = mesh;
|
||||
}
|
||||
}, {
|
||||
|
@ -16970,7 +16981,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
var material;
|
||||
if (this._options.pointMaterial && this._options.pointMaterial instanceof THREE.Material) {
|
||||
material = this._options.material;
|
||||
material = this._options.pointMaterial;
|
||||
} else if (!this._world._environment._skybox) {
|
||||
material = new THREE.MeshPhongMaterial({
|
||||
vertexColors: THREE.VertexColors
|
||||
|
@ -16987,10 +16998,17 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
// Pass mesh callback, if defined
|
||||
if (typeof this._options.onPointMesh === 'function') {
|
||||
mesh = this._options.onPointMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new _enginePickingMaterial2['default']();
|
||||
|
@ -17000,11 +17018,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh callback, if defined
|
||||
if (typeof this._options.onPointMesh === 'function') {
|
||||
this._options.onPointMesh(mesh);
|
||||
}
|
||||
|
||||
this._pointMesh = mesh;
|
||||
}
|
||||
|
||||
|
@ -17530,10 +17543,17 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
var mesh = new _three2['default'].Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
mesh = this._options.onMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new _three2['default'].Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (this.isFlat()) {
|
||||
material.depthWrite = false;
|
||||
|
@ -17548,11 +17568,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
this._options.onMesh(mesh);
|
||||
}
|
||||
|
||||
this._mesh = mesh;
|
||||
}
|
||||
|
||||
|
@ -18082,6 +18097,11 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
|
||||
// itemSize = 3 because there are 3 values (components) per vertex
|
||||
geometry.addAttribute('position', new _three2['default'].BufferAttribute(attributes.vertices, 3));
|
||||
|
||||
if (attributes.normals) {
|
||||
geometry.addAttribute('normal', new _three2['default'].BufferAttribute(attributes.normals, 3));
|
||||
}
|
||||
|
||||
geometry.addAttribute('color', new _three2['default'].BufferAttribute(attributes.colours, 3));
|
||||
|
||||
if (attributes.pickingIds) {
|
||||
|
@ -18105,16 +18125,25 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
});
|
||||
}
|
||||
|
||||
var mesh = new _three2['default'].LineSegments(geometry, material);
|
||||
var mesh;
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
mesh = this._options.onMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new _three2['default'].LineSegments(geometry, material);
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
|
||||
// TODO: Allow this to be overridden, or copy mesh instead of creating a new
|
||||
// one just for picking
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new _enginePickingMaterial2['default']();
|
||||
// material.side = THREE.BackSide;
|
||||
|
@ -18126,11 +18155,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
this._options.onMesh(mesh);
|
||||
}
|
||||
|
||||
this._mesh = mesh;
|
||||
}
|
||||
|
||||
|
@ -18211,6 +18235,13 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var _vertices = line.vertices;
|
||||
var _colour = line.colours;
|
||||
|
||||
var normals;
|
||||
var _normals;
|
||||
if (line.normals) {
|
||||
normals = new Float32Array(line.verticesCount * 3);
|
||||
_normals = line.normals;
|
||||
}
|
||||
|
||||
var _pickingId;
|
||||
if (pickingIds) {
|
||||
_pickingId = line.pickingId;
|
||||
|
@ -18223,12 +18254,27 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
var ay = _vertices[i][1];
|
||||
var az = _vertices[i][2];
|
||||
|
||||
var nx;
|
||||
var ny;
|
||||
var nz;
|
||||
if (_normals) {
|
||||
nx = _normals[i][0];
|
||||
ny = _normals[i][1];
|
||||
nz = _normals[i][2];
|
||||
}
|
||||
|
||||
var c1 = _colour[i];
|
||||
|
||||
vertices[lastIndex * 3 + 0] = ax;
|
||||
vertices[lastIndex * 3 + 1] = ay;
|
||||
vertices[lastIndex * 3 + 2] = az;
|
||||
|
||||
if (normals) {
|
||||
normals[lastIndex * 3 + 0] = nx;
|
||||
normals[lastIndex * 3 + 1] = ny;
|
||||
normals[lastIndex * 3 + 2] = nz;
|
||||
}
|
||||
|
||||
colours[lastIndex * 3 + 0] = c1[0];
|
||||
colours[lastIndex * 3 + 1] = c1[1];
|
||||
colours[lastIndex * 3 + 2] = c1[2];
|
||||
|
@ -18245,6 +18291,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
colours: colours
|
||||
};
|
||||
|
||||
if (normals) {
|
||||
attributes.normals = normals;
|
||||
}
|
||||
|
||||
if (pickingIds) {
|
||||
attributes.pickingIds = pickingIds;
|
||||
}
|
||||
|
@ -18592,10 +18642,17 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
var mesh = new _three2['default'].Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
mesh = this._options.onMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new _three2['default'].Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new _enginePickingMaterial2['default']();
|
||||
|
@ -18605,11 +18662,6 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
this._options.onMesh(mesh);
|
||||
}
|
||||
|
||||
this._mesh = mesh;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -207,7 +207,7 @@ class GeoJSONLayer extends LayerGroup {
|
|||
|
||||
var material;
|
||||
if (this._options.polygonMaterial && this._options.polygonMaterial instanceof THREE.Material) {
|
||||
material = this._options.material;
|
||||
material = this._options.polygonMaterial;
|
||||
} else if (!this._world._environment._skybox) {
|
||||
material = new THREE.MeshPhongMaterial({
|
||||
vertexColors: THREE.VertexColors,
|
||||
|
@ -224,10 +224,17 @@ class GeoJSONLayer extends LayerGroup {
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolygonMesh === 'function') {
|
||||
mesh = this._options.onPolygonMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (flat) {
|
||||
material.depthWrite = false;
|
||||
|
@ -242,11 +249,6 @@ class GeoJSONLayer extends LayerGroup {
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolygonMesh === 'function') {
|
||||
this._options.onPolygonMesh(mesh);
|
||||
}
|
||||
|
||||
this._polygonMesh = mesh;
|
||||
}
|
||||
|
||||
|
@ -255,6 +257,11 @@ class GeoJSONLayer extends LayerGroup {
|
|||
|
||||
// itemSize = 3 because there are 3 values (components) per vertex
|
||||
geometry.addAttribute('position', new THREE.BufferAttribute(attributes.vertices, 3));
|
||||
|
||||
if (attributes.normals) {
|
||||
geometry.addAttribute('normal', new THREE.BufferAttribute(attributes.normals, 3));
|
||||
}
|
||||
|
||||
geometry.addAttribute('color', new THREE.BufferAttribute(attributes.colours, 3));
|
||||
|
||||
if (attributes.pickingIds) {
|
||||
|
@ -269,7 +276,7 @@ class GeoJSONLayer extends LayerGroup {
|
|||
|
||||
var material;
|
||||
if (this._options.polylineMaterial && this._options.polylineMaterial instanceof THREE.Material) {
|
||||
material = this._options.material;
|
||||
material = this._options.polylineMaterial;
|
||||
} else {
|
||||
material = new THREE.LineBasicMaterial({
|
||||
vertexColors: THREE.VertexColors,
|
||||
|
@ -280,16 +287,25 @@ class GeoJSONLayer extends LayerGroup {
|
|||
});
|
||||
}
|
||||
|
||||
var mesh = new THREE.LineSegments(geometry, material);
|
||||
var mesh;
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolylineMesh === 'function') {
|
||||
mesh = this._options.onPolylineMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.LineSegments(geometry, material);
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
|
||||
// TODO: Allow this to be overridden, or copy mesh instead of creating a new
|
||||
// one just for picking
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new PickingMaterial();
|
||||
// material.side = THREE.BackSide;
|
||||
|
@ -301,11 +317,6 @@ class GeoJSONLayer extends LayerGroup {
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onPolylineMesh === 'function') {
|
||||
this._options.onPolylineMesh(mesh);
|
||||
}
|
||||
|
||||
this._polylineMesh = mesh;
|
||||
}
|
||||
|
||||
|
@ -325,7 +336,7 @@ class GeoJSONLayer extends LayerGroup {
|
|||
|
||||
var material;
|
||||
if (this._options.pointMaterial && this._options.pointMaterial instanceof THREE.Material) {
|
||||
material = this._options.material;
|
||||
material = this._options.pointMaterial;
|
||||
} else if (!this._world._environment._skybox) {
|
||||
material = new THREE.MeshPhongMaterial({
|
||||
vertexColors: THREE.VertexColors
|
||||
|
@ -342,10 +353,17 @@ class GeoJSONLayer extends LayerGroup {
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
// Pass mesh callback, if defined
|
||||
if (typeof this._options.onPointMesh === 'function') {
|
||||
mesh = this._options.onPointMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new PickingMaterial();
|
||||
|
@ -355,11 +373,6 @@ class GeoJSONLayer extends LayerGroup {
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh callback, if defined
|
||||
if (typeof this._options.onPointMesh === 'function') {
|
||||
this._options.onPointMesh(mesh);
|
||||
}
|
||||
|
||||
this._pointMesh = mesh;
|
||||
}
|
||||
|
||||
|
|
|
@ -242,10 +242,17 @@ class PointLayer extends Layer {
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
var mesh = new THREE.Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
mesh = this._options.onMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new PickingMaterial();
|
||||
|
@ -255,11 +262,6 @@ class PointLayer extends Layer {
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
this._options.onMesh(mesh);
|
||||
}
|
||||
|
||||
this._mesh = mesh;
|
||||
}
|
||||
|
||||
|
|
|
@ -261,10 +261,17 @@ class PolygonLayer extends Layer {
|
|||
material.envMap = this._world._environment._skybox.getRenderTarget();
|
||||
}
|
||||
|
||||
var mesh = new THREE.Mesh(geometry, material);
|
||||
var mesh;
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
mesh = this._options.onMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.castShadow = true;
|
||||
mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
if (this.isFlat()) {
|
||||
material.depthWrite = false;
|
||||
|
@ -279,11 +286,6 @@ class PolygonLayer extends Layer {
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
this._options.onMesh(mesh);
|
||||
}
|
||||
|
||||
this._mesh = mesh;
|
||||
}
|
||||
|
||||
|
|
|
@ -187,6 +187,11 @@ class PolylineLayer extends Layer {
|
|||
|
||||
// itemSize = 3 because there are 3 values (components) per vertex
|
||||
geometry.addAttribute('position', new THREE.BufferAttribute(attributes.vertices, 3));
|
||||
|
||||
if (attributes.normals) {
|
||||
geometry.addAttribute('normal', new THREE.BufferAttribute(attributes.normals, 3));
|
||||
}
|
||||
|
||||
geometry.addAttribute('color', new THREE.BufferAttribute(attributes.colours, 3));
|
||||
|
||||
if (attributes.pickingIds) {
|
||||
|
@ -210,16 +215,25 @@ class PolylineLayer extends Layer {
|
|||
});
|
||||
}
|
||||
|
||||
var mesh = new THREE.LineSegments(geometry, material);
|
||||
var mesh;
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
mesh = this._options.onMesh(geometry, material);
|
||||
} else {
|
||||
mesh = new THREE.LineSegments(geometry, material);
|
||||
|
||||
if (style.lineRenderOrder !== undefined) {
|
||||
material.depthWrite = false;
|
||||
mesh.renderOrder = style.lineRenderOrder;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
}
|
||||
|
||||
mesh.castShadow = true;
|
||||
// mesh.receiveShadow = true;
|
||||
|
||||
// TODO: Allow this to be overridden, or copy mesh instead of creating a new
|
||||
// one just for picking
|
||||
if (this._options.interactive && this._pickingMesh) {
|
||||
material = new PickingMaterial();
|
||||
// material.side = THREE.BackSide;
|
||||
|
@ -231,11 +245,6 @@ class PolylineLayer extends Layer {
|
|||
this._pickingMesh.add(pickingMesh);
|
||||
}
|
||||
|
||||
// Pass mesh through callback, if defined
|
||||
if (typeof this._options.onMesh === 'function') {
|
||||
this._options.onMesh(mesh);
|
||||
}
|
||||
|
||||
this._mesh = mesh;
|
||||
}
|
||||
|
||||
|
@ -306,6 +315,13 @@ class PolylineLayer extends Layer {
|
|||
var _vertices = line.vertices;
|
||||
var _colour = line.colours;
|
||||
|
||||
var normals;
|
||||
var _normals;
|
||||
if (line.normals) {
|
||||
normals = new Float32Array(line.verticesCount * 3);
|
||||
_normals = line.normals;
|
||||
}
|
||||
|
||||
var _pickingId;
|
||||
if (pickingIds) {
|
||||
_pickingId = line.pickingId;
|
||||
|
@ -318,12 +334,27 @@ class PolylineLayer extends Layer {
|
|||
var ay = _vertices[i][1];
|
||||
var az = _vertices[i][2];
|
||||
|
||||
var nx;
|
||||
var ny;
|
||||
var nz;
|
||||
if (_normals) {
|
||||
nx = _normals[i][0];
|
||||
ny = _normals[i][1];
|
||||
nz = _normals[i][2];
|
||||
}
|
||||
|
||||
var c1 = _colour[i];
|
||||
|
||||
vertices[lastIndex * 3 + 0] = ax;
|
||||
vertices[lastIndex * 3 + 1] = ay;
|
||||
vertices[lastIndex * 3 + 2] = az;
|
||||
|
||||
if (normals) {
|
||||
normals[lastIndex * 3 + 0] = nx;
|
||||
normals[lastIndex * 3 + 1] = ny;
|
||||
normals[lastIndex * 3 + 2] = nz;
|
||||
}
|
||||
|
||||
colours[lastIndex * 3 + 0] = c1[0];
|
||||
colours[lastIndex * 3 + 1] = c1[1];
|
||||
colours[lastIndex * 3 + 2] = c1[2];
|
||||
|
@ -340,6 +371,10 @@ class PolylineLayer extends Layer {
|
|||
colours: colours
|
||||
};
|
||||
|
||||
if (normals) {
|
||||
attributes.normals = normals;
|
||||
}
|
||||
|
||||
if (pickingIds) {
|
||||
attributes.pickingIds = pickingIds;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue