Browse Source

collide: get_wrt_mat() et al should return a copy

Fixes #1725
rdb 4 months ago
parent
commit
a70d7c8012
2 changed files with 6 additions and 6 deletions
  1. 3 3
      panda/src/collide/collisionEntry.I
  2. 3 3
      panda/src/collide/collisionEntry.h

+ 3 - 3
panda/src/collide/collisionEntry.I

@@ -291,7 +291,7 @@ get_wrt_prev_space() const {
 /**
  * Returns the relative transform of the from node as seen from the into node.
  */
-INLINE const LMatrix4 &CollisionEntry::
+INLINE LMatrix4 CollisionEntry::
 get_wrt_mat() const {
   return get_wrt_space()->get_mat();
 }
@@ -299,7 +299,7 @@ get_wrt_mat() const {
 /**
  * Returns the relative transform of the into node as seen from the from node.
  */
-INLINE const LMatrix4 &CollisionEntry::
+INLINE LMatrix4 CollisionEntry::
 get_inv_wrt_mat() const {
   return get_inv_wrt_space()->get_mat();
 }
@@ -309,7 +309,7 @@ get_inv_wrt_mat() const {
  * as of the previous frame (according to set_prev_transform(),
  * set_fluid_pos(), etc.)
  */
-INLINE const LMatrix4 &CollisionEntry::
+INLINE LMatrix4 CollisionEntry::
 get_wrt_prev_mat() const {
   return get_wrt_prev_space()->get_mat();
 }

+ 3 - 3
panda/src/collide/collisionEntry.h

@@ -109,9 +109,9 @@ public:
   INLINE CPT(TransformState) get_inv_wrt_space() const;
   INLINE CPT(TransformState) get_wrt_prev_space() const;
 
-  INLINE const LMatrix4 &get_wrt_mat() const;
-  INLINE const LMatrix4 &get_inv_wrt_mat() const;
-  INLINE const LMatrix4 &get_wrt_prev_mat() const;
+  INLINE LMatrix4 get_wrt_mat() const;
+  INLINE LMatrix4 get_inv_wrt_mat() const;
+  INLINE LMatrix4 get_wrt_prev_mat() const;
 
   INLINE const ClipPlaneAttrib *get_into_clip_planes() const;