Procházet zdrojové kódy

Make ImageTracker.resolution readonly

customisations
alemart před 9 měsíci
rodič
revize
661e37daaa

+ 3
- 1
docs/api/image-tracker.md Zobrazit soubor

@@ -63,10 +63,12 @@ A [database](reference-image-database.md) of [reference images](reference-image.
63 63
 
64 64
 ### resolution
65 65
 
66
-`tracker.resolution: Resolution`
66
+`tracker.resolution: Resolution, read-only`
67 67
 
68 68
 The [resolution](resolution.md) adopted by the computer vision algorithms implemented in the tracker. Higher resolutions improve the tracking quality, but are computationally more expensive. Note that this resolution is different from, and should not be larger than, the [resolution of the camera](camera-source.md#resolution)!
69 69
 
70
+*Note:* this property is read-only since 0.4.0. Set the resolution when instantiating the tracker.
71
+
70 72
 ## Events
71 73
 
72 74
 An ImageTracker is an [AREventTarget](ar-event-target.md). You can listen to the following events:

+ 5
- 3
src/trackers/image-tracker/image-tracker.ts Zobrazit soubor

@@ -203,7 +203,7 @@ export class ImageTracker extends AREventTarget<ImageTrackerEventType> implement
203 203
     }
204 204
 
205 205
     /**
206
-     * Resolution of the AR screen space
206
+     * Resolution of the tracker
207 207
      */
208 208
     get resolution(): Resolution
209 209
     {
@@ -211,11 +211,13 @@ export class ImageTracker extends AREventTarget<ImageTrackerEventType> implement
211 211
     }
212 212
 
213 213
     /**
214
-     * Resolution of the AR screen space
214
+     * Resolution of the tracker
215
+     * @readonly
215 216
      */
216 217
     set resolution(resolution: Resolution)
217 218
     {
218
-        this._resolution = resolution;
219
+        // this property is readonly, but this setter has been kept because
220
+        // it wasn't readonly in previous versions of the engine. FIXME
219 221
     }
220 222
 
221 223
     /**

Načítá se…
Zrušit
Uložit