Skip to content

Commit 2d4c4b3

Browse files
ngokevindmarcos
authored andcommitted
add warning to define raycaster.objects (aframevr#3839)
1 parent 80b5763 commit 2d4c4b3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/components/raycaster.js‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,14 @@ module.exports.Component = registerComponent('raycaster', {
109109
}
110110

111111
if (data.objects !== oldData.objects && !OBSERVER_SELECTOR_RE.test(data.objects)) {
112-
warn('Selector "' + data.objects + '" may not update automatically with DOM changes.');
112+
warn('[raycaster] Selector "' + data.objects +
113+
'" may not update automatically with DOM changes.');
114+
}
115+
116+
if (!data.objects) {
117+
warn('[raycaster] For performance, please define raycaster.objects when using ' +
118+
'raycaster or cursor components to whitelist which entities to intersect with. ' +
119+
'e.g., raycaster="objects: [data-raycastable]".');
113120
}
114121

115122
if (data.autoRefresh !== oldData.autoRefresh && el.isPlaying) {

0 commit comments

Comments
 (0)