|
|
|
|
|
|
public partial class DebugShapes |
|
|
|
{ |
|
|
|
// Singleton
|
|
|
|
private static DebugShapes s_Instance = null; |
|
|
|
static DebugShapes s_Instance = null; |
|
|
|
|
|
|
|
static public DebugShapes instance |
|
|
|
{ |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private Mesh m_sphereMesh = null; |
|
|
|
private Mesh m_boxMesh = null; |
|
|
|
private Mesh m_coneMesh = null; |
|
|
|
private Mesh m_pyramidMesh = null; |
|
|
|
Mesh m_sphereMesh = null; |
|
|
|
Mesh m_boxMesh = null; |
|
|
|
Mesh m_coneMesh = null; |
|
|
|
Mesh m_pyramidMesh = null; |
|
|
|
private void BuildSphere(ref Mesh outputMesh, float radius, uint longSubdiv, uint latSubdiv) |
|
|
|
void BuildSphere(ref Mesh outputMesh, float radius, uint longSubdiv, uint latSubdiv) |
|
|
|
{ |
|
|
|
// Make sure it is empty before pushing anything to it
|
|
|
|
outputMesh.Clear(); |
|
|
|
|
|
|
outputMesh.RecalculateBounds(); |
|
|
|
} |
|
|
|
|
|
|
|
private void BuildBox(ref Mesh outputMesh, float length, float width, float height) |
|
|
|
void BuildBox(ref Mesh outputMesh, float length, float width, float height) |
|
|
|
{ |
|
|
|
outputMesh.Clear(); |
|
|
|
|
|
|
|
|
|
|
outputMesh.RecalculateBounds(); |
|
|
|
} |
|
|
|
|
|
|
|
private void BuildCone(ref Mesh outputMesh, float height, float topRadius, float bottomRadius, int nbSides) |
|
|
|
void BuildCone(ref Mesh outputMesh, float height, float topRadius, float bottomRadius, int nbSides) |
|
|
|
{ |
|
|
|
outputMesh.Clear(); |
|
|
|
|
|
|
|
|
|
|
outputMesh.RecalculateBounds(); |
|
|
|
} |
|
|
|
|
|
|
|
private void BuildPyramid(ref Mesh outputMesh, float width, float height, float depth) |
|
|
|
void BuildPyramid(ref Mesh outputMesh, float width, float height, float depth) |
|
|
|
{ |
|
|
|
outputMesh.Clear(); |
|
|
|
|
|
|
|
|
|
|
outputMesh.RecalculateBounds(); |
|
|
|
} |
|
|
|
|
|
|
|
private void BuildShapes() |
|
|
|
void BuildShapes() |
|
|
|
{ |
|
|
|
m_sphereMesh = new Mesh(); |
|
|
|
BuildSphere(ref m_sphereMesh, 1.0f, 24, 16); |
|
|
|