@openglobus/og 0.13.3 → 0.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -193,6 +193,10 @@ class GeoObject {
193
193
  this._handler && this._handler.setScaleArr(this._handlerIndex, scale);
194
194
  }
195
195
 
196
+ getScale() {
197
+ return this.scale;
198
+ }
199
+
196
200
  /**
197
201
  * Removes geo object from handler.
198
202
  * @public
@@ -90,8 +90,7 @@ class GeoObjectHandler {
90
90
  const h = this._renderer.handler;
91
91
  for (let i = 0, len = this._vertexArr.length; i < len; i++) {
92
92
  this._vertexBuffer && h.gl.deleteBuffer(this._vertexBuffer[i]);
93
- this._vertexArr[i] = makeArrayTyped(this._vertexArr[i]);
94
- this._vertexBuffer[i] = h.createArrayBuffer(this._vertexArr[i], 3, this._vertexArr[i].length / 3);
93
+ this._vertexBuffer[i] = h.createArrayBuffer(new Float32Array(this._vertexArr[i]), 3, this._vertexArr[i].length / 3);
95
94
  }
96
95
  }
97
96
 
@@ -99,8 +98,7 @@ class GeoObjectHandler {
99
98
  const h = this._renderer.handler;
100
99
  for (let i = 0, len = this._pitchRollArr.length; i < len; i++) {
101
100
  this._pitchRollBuffer && h.gl.deleteBuffer(this._pitchRollBuffer[i]);
102
- this._pitchRollArr[i] = makeArrayTyped(this._pitchRollArr[i]);
103
- this._pitchRollBuffer[i] = h.createArrayBuffer(this._pitchRollArr[i], 2, this._pitchRollArr[i].length / 2);
101
+ this._pitchRollBuffer[i] = h.createArrayBuffer(new Float32Array(this._pitchRollArr[i]), 2, this._pitchRollArr[i].length / 2);
104
102
  }
105
103
  }
106
104
 
@@ -108,8 +106,7 @@ class GeoObjectHandler {
108
106
  const h = this._renderer.handler;
109
107
  for (let i = 0, len = this._vehicleVisibleArr.length; i < len; i++) {
110
108
  this._vehicleVisibleBuffer && h.gl.deleteBuffer(this._vehicleVisibleBuffer[i]);
111
- this._vehicleVisibleArr[i] = makeArrayTyped(this._vehicleVisibleArr[i]);
112
- this._vehicleVisibleBuffer[i] = h.createArrayBuffer(this._vehicleVisibleArr[i], 1, this._vehicleVisibleArr[i].length);
109
+ this._vehicleVisibleBuffer[i] = h.createArrayBuffer(new Float32Array(this._vehicleVisibleArr[i]), 1, this._vehicleVisibleArr[i].length);
113
110
  }
114
111
  }
115
112
 
@@ -117,8 +114,7 @@ class GeoObjectHandler {
117
114
  const h = this._renderer.handler;
118
115
  for (let i = 0, len = this._sizeArr.length; i < len; i++) {
119
116
  this._sizeBuffer && h.gl.deleteBuffer(this._sizeBuffer[i]);
120
- this._sizeArr[i] = makeArrayTyped(this._sizeArr[i]);
121
- this._sizeBuffer[i] = h.createArrayBuffer(this._sizeArr[i], 1, this._sizeArr[i].length);
117
+ this._sizeBuffer[i] = h.createArrayBuffer(new Float32Array(this._sizeArr[i]), 1, this._sizeArr[i].length);
122
118
  }
123
119
  }
124
120
 
@@ -126,11 +122,9 @@ class GeoObjectHandler {
126
122
  let h = this._renderer.handler;
127
123
  for (let i = 0, len = this._positionHighArr.length; i < len; i++) {
128
124
  this._positionHighBuffer && h.gl.deleteBuffer(this._positionHighBuffer[i]);
129
- this._positionHighArr[i] = makeArrayTyped(this._positionHighArr[i]);
130
- this._positionHighBuffer[i] = h.createArrayBuffer(this._positionHighArr[i], 3, this._positionHighArr[i].length / 3);
125
+ this._positionHighBuffer[i] = h.createArrayBuffer(new Float32Array(this._positionHighArr[i]), 3, this._positionHighArr[i].length / 3);
131
126
  this._positionLowBuffer && h.gl.deleteBuffer(this._positionLowBuffer[i]);
132
- this._positionLowArr[i] = makeArrayTyped(this._positionLowArr[i]);
133
- this._positionLowBuffer[i] = h.createArrayBuffer(this._positionLowArr[i], 3, this._positionLowArr[i].length / 3);
127
+ this._positionLowBuffer[i] = h.createArrayBuffer(new Float32Array(this._positionLowArr[i]), 3, this._positionLowArr[i].length / 3);
134
128
  }
135
129
  }
136
130
 
@@ -138,8 +132,7 @@ class GeoObjectHandler {
138
132
  const h = this._renderer.handler;
139
133
  for (let i = 0, len = this._rgbaArr.length; i < len; i++) {
140
134
  this._rgbaBuffer && h.gl.deleteBuffer(this._rgbaBuffer[i]);
141
- this._rgbaArr[i] = makeArrayTyped(this._rgbaArr[i]);
142
- this._rgbaBuffer[i] = h.createArrayBuffer(this._rgbaArr[i], 4, this._rgbaArr[i].length / 4);
135
+ this._rgbaBuffer[i] = h.createArrayBuffer(new Float32Array(this._rgbaArr[i]), 4, this._rgbaArr[i].length / 4);
143
136
  }
144
137
  }
145
138
 
@@ -147,8 +140,7 @@ class GeoObjectHandler {
147
140
  const h = this._renderer.handler;
148
141
  for (let i = 0, len = this._directionArr.length; i < len; i++) {
149
142
  this._directionBuffer && h.gl.deleteBuffer(this._directionBuffer[i]);
150
- this._directionArr[i] = makeArrayTyped(this._directionArr[i]);
151
- this._directionBuffer[i] = h.createArrayBuffer(this._directionArr[i], 3, this._directionArr[i].length / 3);
143
+ this._directionBuffer[i] = h.createArrayBuffer(new Float32Array(this._directionArr[i]), 3, this._directionArr[i].length / 3);
152
144
  }
153
145
  }
154
146
 
@@ -156,8 +148,7 @@ class GeoObjectHandler {
156
148
  const h = this._renderer.handler;
157
149
  for (let i = 0, len = this._normalsArr.length; i < len; i++) {
158
150
  this._normalsBuffer && h.gl.deleteBuffer(this._normalsBuffer[i]);
159
- this._normalsArr[i] = makeArrayTyped(this._normalsArr[i]);
160
- this._normalsBuffer[i] = h.createArrayBuffer(this._normalsArr[i], 3, this._normalsArr[i].length / 3);
151
+ this._normalsBuffer[i] = h.createArrayBuffer(new Float32Array(this._normalsArr[i]), 3, this._normalsArr[i].length / 3);
161
152
  }
162
153
  }
163
154
 
@@ -165,8 +156,7 @@ class GeoObjectHandler {
165
156
  const h = this._renderer.handler;
166
157
  for (let i = 0, len = this._indicesArr.length; i < len; i++) {
167
158
  this._indicesBuffer && h.gl.deleteBuffer(this._indicesBuffer[i]);
168
- this._indicesArr[i] = makeArrayTyped(this._indicesArr[i], Uint16Array);
169
- this._indicesBuffer[i] = h.createElementArrayBuffer(this._indicesArr[i], 1, this._indicesArr[i].length);
159
+ this._indicesBuffer[i] = h.createElementArrayBuffer(new Uint16Array(this._indicesArr[i]), 1, this._indicesArr[i].length);
170
160
  }
171
161
  }
172
162
 
@@ -174,8 +164,7 @@ class GeoObjectHandler {
174
164
  const h = this._renderer.handler;
175
165
  for (let i = 0, len = this._pickingColorArr.length; i < len; i++) {
176
166
  this._pickingColorBuffer && h.gl.deleteBuffer(this._pickingColorBuffer[i]);
177
- this._pickingColorArr[i] = makeArrayTyped(this._pickingColorArr[i]);
178
- this._pickingColorBuffer[i] = h.createArrayBuffer(this._pickingColorArr[i], 3, this._pickingColorArr[i].length / 3);
167
+ this._pickingColorBuffer[i] = h.createArrayBuffer(new Float32Array(this._pickingColorArr[i]), 3, this._pickingColorArr[i].length / 3);
179
168
  }
180
169
  }
181
170
 
@@ -771,17 +760,17 @@ class GeoObjectHandler {
771
760
  this._pickingColorArr = null;
772
761
  this._vehicleVisibleArr = null;
773
762
 
774
- this._pitchRollArr = [new Float32Array()];
775
- this._sizeArr = [new Float32Array()];
776
- this._vertexArr = [new Float32Array()];
777
- this._positionHighArr = [new Float32Array()];
778
- this._positionLowArr = [new Float32Array()];
779
- this._rgbaArr = [new Float32Array()];
780
- this._directionArr = [new Float32Array()];
781
- this._normalsArr = [new Float32Array()];
782
- this._indicesArr = [new Uint16Array()];
783
- this._pickingColorArr = [new Float32Array()];
784
- this._vehicleVisibleArr = [new Int8Array()];
763
+ this._pitchRollArr = [];
764
+ this._sizeArr = [];
765
+ this._vertexArr = [];
766
+ this._positionHighArr = [];
767
+ this._positionLowArr = [];
768
+ this._rgbaArr = [];
769
+ this._directionArr = [];
770
+ this._normalsArr = [];
771
+ this._indicesArr = [];
772
+ this._pickingColorArr = [];
773
+ this._vehicleVisibleArr = [];
785
774
 
786
775
  this._removeGeoObjects();
787
776
  this._deleteBuffers();