C# Class UnityEngine.Geometry

ファイルを表示 Open project: Naphier/NGTools Class Usage Examples

Public Methods

Method Description
Circumference ( float radius ) : float
Create9SlicedMesh ( float border = 1f, float width = 3f, float height = 3f, float marginUV = 1f ) : Mesh
GetFibonacciSphereVertices ( int vertexCount = 1, bool randomize = true ) : List
GetSubdividedIcosahedronVertices ( int subdivisions ) : List

Creates a smoothly subdivided icosahedron.

Vertex count is 2 + 10 * 4 ^ subdivisions (i.e. 12, 42, 162, 642, 2562, 10242...) Subdivision is slow above 3. Times: 0,1,2 = 0ms 3 = 43ms 4 = 605ms 5 = 9531ms 6 = ????

Icosahedron ( List vertices, List indices ) : void

create a regular icosahedron (20-sided polyhedron)

You can create this programmatically instead of using the given vertex and index list, but it's kind of a pain and rather pointless beyond a learning exercise.

PointOnCircle ( float radius, float angleInDegrees, Vector2 origin ) : Vector2
Radius ( float circumference ) : float
Subdivide ( List vectors, List indices, bool removeSourceTriangles ) : void i0 / \ m02-m01 / \ / \ i2---m12---i1

Private Methods

Method Description
GetMidpointIndex ( int>.Dictionary midpointIndices, List vertices, int i0, int i1 ) : int

Method Details

Circumference() public static method

public static Circumference ( float radius ) : float
radius float
return float

Create9SlicedMesh() public static method

public static Create9SlicedMesh ( float border = 1f, float width = 3f, float height = 3f, float marginUV = 1f ) : Mesh
border float
width float
height float
marginUV float
return Mesh

GetFibonacciSphereVertices() public static method

public static GetFibonacciSphereVertices ( int vertexCount = 1, bool randomize = true ) : List
vertexCount int
randomize bool
return List

GetSubdividedIcosahedronVertices() public static method

Creates a smoothly subdivided icosahedron.
Vertex count is 2 + 10 * 4 ^ subdivisions (i.e. 12, 42, 162, 642, 2562, 10242...) Subdivision is slow above 3. Times: 0,1,2 = 0ms 3 = 43ms 4 = 605ms 5 = 9531ms 6 = ????
public static GetSubdividedIcosahedronVertices ( int subdivisions ) : List
subdivisions int
return List

Icosahedron() public static method

create a regular icosahedron (20-sided polyhedron)
You can create this programmatically instead of using the given vertex and index list, but it's kind of a pain and rather pointless beyond a learning exercise.
public static Icosahedron ( List vertices, List indices ) : void
vertices List
indices List
return void

PointOnCircle() public static method

public static PointOnCircle ( float radius, float angleInDegrees, Vector2 origin ) : Vector2
radius float
angleInDegrees float
origin Vector2
return Vector2

Radius() public static method

public static Radius ( float circumference ) : float
circumference float
return float

Subdivide() public static method

i0 / \ m02-m01 / \ / \ i2---m12---i1
public static Subdivide ( List vectors, List indices, bool removeSourceTriangles ) : void
vectors List
indices List
removeSourceTriangles bool
return void