From 9cf428352d7d9e980398ff7c7a2734894ad1c099 Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 9 Sep 2005 14:39:48 +0000 Subject: [PATCH] add TransformState::get_inverse() --- panda/src/pgraph/transformState.I | 13 +++++++++++++ panda/src/pgraph/transformState.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/panda/src/pgraph/transformState.I b/panda/src/pgraph/transformState.I index 1d985950c4..1343b9a260 100644 --- a/panda/src/pgraph/transformState.I +++ b/panda/src/pgraph/transformState.I @@ -624,6 +624,19 @@ get_mat3() const { _mat(3, 0), _mat(3, 1), _mat(3, 3)); } +//////////////////////////////////////////////////////////////////// +// Function: TransformState::get_inverse +// Access: Published +// Description: Returns the inverse of this transform. If you are +// going to immediately compose this result with another +// TransformState, it is faster to do it in one +// operation with invert_compose(). +//////////////////////////////////////////////////////////////////// +INLINE CPT(TransformState) TransformState:: +get_inverse() const { + return invert_compose(TransformState::make_identity()); +} + //////////////////////////////////////////////////////////////////// // Function: TransformState::get_geom_rendering // Access: Published diff --git a/panda/src/pgraph/transformState.h b/panda/src/pgraph/transformState.h index d8b43ddda4..10b34c11e7 100644 --- a/panda/src/pgraph/transformState.h +++ b/panda/src/pgraph/transformState.h @@ -161,6 +161,8 @@ PUBLISHED: CPT(TransformState) compose(const TransformState *other) const; CPT(TransformState) invert_compose(const TransformState *other) const; + INLINE CPT(TransformState) get_inverse() const; + INLINE int get_geom_rendering(int geom_rendering) const; int unref() const;