Add comment explaining why visualPickResult is a copy

This commit is contained in:
sabrina-shanman 2018-09-24 17:36:24 -07:00
parent 7f189e4d10
commit 5dbebd4aae

View file

@ -68,6 +68,7 @@ void Pointer::update(unsigned int pointerID) {
// This only needs to be a read lock because update won't change any of the properties that can be modified from scripts
withReadLock([&] {
auto pickResult = getPrevPickResult();
// Pointer needs its own PickResult object so it doesn't modify the cached pick result
auto visualPickResult = getVisualPickResult(std::make_shared<PickResult>(*pickResult.get()));
updateVisuals(visualPickResult);
generatePointerEvents(pointerID, visualPickResult);