From bfe1c95d298b5a0f8adbf1e690ec5b7a335f94ba Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 12 Mar 2024 15:29:21 +0100 Subject: [PATCH] pgraph: Python wrappers for TransformState getters no longer return reference to temporary Fixes #1625 --- panda/src/pgraph/transformState.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index 59a47daec7..d6342e9aa5 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -132,6 +132,17 @@ PUBLISHED: INLINE bool has_nonzero_shear() const; INLINE bool has_mat() const; +#ifdef CPPPARSER + // Force interrogate to make a copy as a temporary solution for #1625. + LPoint3 get_pos() const; + LVecBase3 get_hpr() const; + LQuaternion get_quat() const; + LQuaternion get_norm_quat() const; + LVecBase3 get_scale() const; + PN_stdfloat get_uniform_scale() const; + LVecBase3 get_shear() const; + LMatrix4 get_mat() const; +#else INLINE const LPoint3 &get_pos() const; INLINE const LVecBase3 &get_hpr() const; INLINE const LQuaternion &get_quat() const; @@ -140,6 +151,7 @@ PUBLISHED: INLINE PN_stdfloat get_uniform_scale() const; INLINE const LVecBase3 &get_shear() const; INLINE const LMatrix4 &get_mat() const; +#endif INLINE LVecBase2 get_pos2d() const; INLINE PN_stdfloat get_rotate2d() const;