diff --git a/panda/src/mathutil/plane_src.cxx b/panda/src/mathutil/plane_src.cxx index 7ba18701c6..4463d57756 100644 --- a/panda/src/mathutil/plane_src.cxx +++ b/panda/src/mathutil/plane_src.cxx @@ -158,3 +158,17 @@ void FLOATNAME(LPlane):: write(std::ostream &out, int indent_level) const { indent(out, indent_level) << *this << "\n"; } + +/** + * Returns a string representation of this LPlane. + */ +std::string FLOATNAME(LPlane):: +__repr__() const { + std::ostringstream out; + out << "LPlane" << FLOATTOKEN << "(" + << MAYBE_ZERO(_v(0)) << ", " + << MAYBE_ZERO(_v(1)) << ", " + << MAYBE_ZERO(_v(2)) << ", " + << MAYBE_ZERO(_v(3)) << ")"; + return out.str(); +} diff --git a/panda/src/mathutil/plane_src.h b/panda/src/mathutil/plane_src.h index c1dffc4d5d..c1d7ef0252 100644 --- a/panda/src/mathutil/plane_src.h +++ b/panda/src/mathutil/plane_src.h @@ -61,6 +61,7 @@ PUBLISHED: void output(std::ostream &out) const; void write(std::ostream &out, int indent_level = 0) const; + std::string __repr__() const; }; INLINE_MATHUTIL std::ostream &