From 0a2b4a8d1da305bc7160d766947dcde5b444009d Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 3 Apr 2018 18:26:43 -0700 Subject: [PATCH] add comment about returning smart pointer by ref --- libraries/physics/src/EntityMotionState.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/physics/src/EntityMotionState.h b/libraries/physics/src/EntityMotionState.h index e94b84572c..807acbfe80 100644 --- a/libraries/physics/src/EntityMotionState.h +++ b/libraries/physics/src/EntityMotionState.h @@ -75,6 +75,8 @@ public: virtual QUuid getSimulatorID() const override; virtual void bump(uint8_t priority) override; + // getEntity() returns a smart-pointer by reference because it is only ever used + // to insert into lists of smart pointers, and the lists will make their own copies const EntityItemPointer& getEntity() const { return _entity; } void resetMeasuredBodyAcceleration();