From 16d5c27a57aa34fa07b764d2ab5323b5611ebbfa Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 4 Feb 2019 23:37:47 +0100 Subject: [PATCH] collide: remove unused legacy_to_3d method --- panda/src/collide/collisionBox.h | 1 - panda/src/collide/collisionPolygon.cxx | 31 -------------------------- panda/src/collide/collisionPolygon.h | 1 - 3 files changed, 33 deletions(-) diff --git a/panda/src/collide/collisionBox.h b/panda/src/collide/collisionBox.h index db9d2c2aa9..3baa77d152 100644 --- a/panda/src/collide/collisionBox.h +++ b/panda/src/collide/collisionBox.h @@ -139,7 +139,6 @@ public: INLINE void calc_to_3d_mat(LMatrix4 &to_3d_mat, int plane) const; INLINE void rederive_to_3d_mat(LMatrix4 &to_3d_mat, int plane) const; INLINE static LPoint3 to_3d(const LVecBase2 &point2d, const LMatrix4 &to_3d_mat); - LPoint3 legacy_to_3d(const LVecBase2 &point2d, int axis) const; bool clip_polygon(Points &new_points, const Points &source_points, const LPlane &plane,int plane_no) const; bool apply_clip_plane(Points &new_points, const ClipPlaneAttrib *cpa, diff --git a/panda/src/collide/collisionPolygon.cxx b/panda/src/collide/collisionPolygon.cxx index 24c8230d2f..59914c25e1 100644 --- a/panda/src/collide/collisionPolygon.cxx +++ b/panda/src/collide/collisionPolygon.cxx @@ -1335,37 +1335,6 @@ setup_points(const LPoint3 *begin, const LPoint3 *end) { compute_vectors(_points); } -/** - * Converts the indicated point to 3-d space according to the way - * CollisionPolygons used to be stored in bam files prior to 4.9. - */ -LPoint3 CollisionPolygon:: -legacy_to_3d(const LVecBase2 &point2d, int axis) const { - nassertr(!point2d.is_nan(), LPoint3(0.0f, 0.0f, 0.0f)); - - LVector3 normal = get_normal(); - PN_stdfloat D = get_plane()[3]; - - nassertr(!normal.is_nan(), LPoint3(0.0f, 0.0f, 0.0f)); - nassertr(!cnan(D), LPoint3(0.0f, 0.0f, 0.0f)); - - switch (axis) { - case 0: // AT_x: - return LPoint3(-(normal[1]*point2d[0] + normal[2]*point2d[1] + D)/normal[0], point2d[0], point2d[1]); - - case 1: // AT_y: - return LPoint3(point2d[0], - -(normal[0]*point2d[0] + normal[2]*point2d[1] + D)/normal[1], point2d[1]); - - case 2: // AT_z: - return LPoint3(point2d[0], point2d[1], - -(normal[0]*point2d[0] + normal[1]*point2d[1] + D)/normal[2]); - } - - nassertr(false, LPoint3(0.0f, 0.0f, 0.0f)); - return LPoint3(0.0f, 0.0f, 0.0f); -} - /** * Clips the source_points of the polygon by the indicated clipping plane, and * modifies new_points to reflect the new set of clipped points (but does not diff --git a/panda/src/collide/collisionPolygon.h b/panda/src/collide/collisionPolygon.h index f7fa771bfa..81dd37fdc7 100644 --- a/panda/src/collide/collisionPolygon.h +++ b/panda/src/collide/collisionPolygon.h @@ -131,7 +131,6 @@ private: INLINE void calc_to_3d_mat(LMatrix4 &to_3d_mat) const; INLINE void rederive_to_3d_mat(LMatrix4 &to_3d_mat) const; INLINE static LPoint3 to_3d(const LVecBase2 &point2d, const LMatrix4 &to_3d_mat); - LPoint3 legacy_to_3d(const LVecBase2 &point2d, int axis) const; bool clip_polygon(Points &new_points, const Points &source_points, const LPlane &plane) const;