diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index 88ef88d29760649bb2627e5b306835f3481cdc0d..8e487484fd4d1d2fd886ed6e92bc316fab3c1fa7 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -3416,7 +3416,7 @@ BOOL LLModelPreview::render()
                 {
                     getPreviewAvatar()->renderBones();
                 }
-                getPreviewAvatar()->renderGroundPlane(mPelvisZOffset);
+                renderGroundPlane(mPelvisZOffset);
                 if (shader)
                 {
                     shader->bind();
@@ -3441,6 +3441,39 @@ BOOL LLModelPreview::render()
     return TRUE;
 }
 
+void LLModelPreview::renderGroundPlane(float z_offset)
+{   // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render
+	const LLVOAvatar* avatarp = getPreviewAvatar();
+	const LLVector3 root_pos = avatarp->mRoot->getPosition();
+	const LLVector4a* ext = avatarp->mDrawable->getSpatialExtents();
+	const LLVector4a min = ext[0], max = ext[1];
+	const F32 center = (max[2] - min[2]) * 0.5f;
+	const F32 ground = root_pos[2] - center - z_offset;
+
+	const LLVector3 vA{min[0], min[1], ground};
+	const LLVector3 vB{max[0], min[1], ground};
+	const LLVector3 vC{max[0], max[1], ground};
+	const LLVector3 vD{min[0], max[1], ground};
+
+	gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f );
+
+	gGL.begin(LLRender::LINES);
+	gGL.vertex3fv(vA.mV);
+	gGL.vertex3fv(vB.mV);
+
+	gGL.vertex3fv(vB.mV);
+	gGL.vertex3fv(vC.mV);
+
+	gGL.vertex3fv(vC.mV);
+	gGL.vertex3fv(vD.mV);
+
+	gGL.vertex3fv(vD.mV);
+	gGL.vertex3fv(vA.mV);
+
+	gGL.end();
+}
+
+
 //-----------------------------------------------------------------------------
 // refresh()
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h
index 3664a27a72487d8c5faae31fd8ac7854fe9dd559..60b510e415565997418ea2d043c49b558ac6c47c 100644
--- a/indra/newview/llmodelpreview.h
+++ b/indra/newview/llmodelpreview.h
@@ -217,6 +217,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
     LLVOAvatar* getPreviewAvatar(void) { return mPreviewAvatar; }
     // Count amount of original models, excluding sub-models
     static U32 countRootModels(LLModelLoader::model_list models);
+	void		renderGroundPlane(float z_offset = 0.0f);
 
 protected:
     friend class LLModelLoader;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 7123c0e3ddda49f7051b3660261c29741736c038..7746af5a5862611cc957324a8b653696ca897cce 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1673,36 +1673,6 @@ void LLVOAvatar::renderBones(const std::string &selected_joint)
 	}
 }
 
-void LLVOAvatar::renderGroundPlane(float z_offset)
-{   // Not necesarilly general - beware - but it seems to meet the needs of LLModelPreview::render
-	const LLVector3 root_pos = mRoot->getPosition();
-	const LLVector4a* ext = mDrawable->getSpatialExtents();
-	const LLVector4a min = ext[0], max = ext[1];
-	const F32 center = (max[2] - min[2]) * 0.5f;
-	const F32 ground = root_pos[2] - center - z_offset;
-
-	const LLVector3 vA{min[0], min[1], ground};
-	const LLVector3 vB{max[0], min[1], ground};
-	const LLVector3 vC{max[0], max[1], ground};
-	const LLVector3 vD{min[0], max[1], ground};
-
-	gGL.diffuseColor3f( 1.0f, 0.0f, 1.0f );
-
-	gGL.begin(LLRender::LINES);
-	gGL.vertex3fv(vA.mV);
-	gGL.vertex3fv(vB.mV);
-
-	gGL.vertex3fv(vB.mV);
-	gGL.vertex3fv(vC.mV);
-
-	gGL.vertex3fv(vC.mV);
-	gGL.vertex3fv(vD.mV);
-
-	gGL.vertex3fv(vD.mV);
-	gGL.vertex3fv(vA.mV);
-
-	gGL.end();
-}
 
 void LLVOAvatar::renderJoints()
 {
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index b4d27baf2076dbe744dadaca6e21c22842ebb504..74ef589ca47a9532e7fc242c9d9e67fbf2acdf36 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -486,7 +486,6 @@ class LLVOAvatar :
 	void 		renderCollisionVolumes();
 	void		renderBones(const std::string &selected_joint = std::string());
 	void		renderJoints();
-	void		renderGroundPlane(float z_offset = 0.0f);
 	static void	deleteCachedImages(bool clearAll=true);
 	static void	destroyGL();
 	static void	restoreGL();