C# 클래스 SSTUTools.MeshBuilder

Generic mesh-building class; input each vert and triangle as created, it will take care of creating the actual mesh and calculating tangents
파일 보기 프로젝트 열기: shadowmage45/SSTULabs 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
subdivision int

공개 메소드들

메소드 설명
addTriangle ( int a, int b, int c ) : void
addVertex ( Vector3 vert, Vector3 norm, Vector2 uv ) : Vertex
buildMesh ( ) : Mesh
clear ( ) : void
generateCuboid ( Vector3 size, Vector3 center, Vector2 uvStart, Vector2 uvEnd ) : void

Creates an axis-aligned cube mesh at the given center point, with the given size dimensions, from the input UV coordinates.

generateCylinderCap ( Vector3 offset, int faces, float outerRadius, float innerRadius, float height, float startAngle, float endAngle, UVArea area, bool bottomCap ) : void
generatePanelCollider ( Vector3 center, float startAngle, float endAngle, float startY, float height, float bottomRadius, float topRadius, float thickness ) : void
generateQuads ( List verts1, List verts2, bool invertFaces ) : void
generateRadialVerticesCylinderUVs ( Vector3 offset, int faces, float radius, float height, float startAngle, float endAngle, UVArea area, float uvRadius, float yCos, float ySin ) : List

Generates a ring of vertices using circular UV mapping, where the center of the ring is the center of the UV area. This would be used to generate a partial ring, such as the procedural decoupler Input radius is the radius of the actual ring, uvRadius is the radius to be used for maximal UV bounds (e.g. they will only be different on an inner-ring; where radius=ring radius, and uvRadius = outerRingRadius)

generateRadialVerticesFlatUVs ( Vector3 offset, int faces, float radius, float height, float startAngle, float endAngle, float v, UVArea area, float yCos, float ySin ) : List

Used to generate a ring of vertices with the uvMapping appropriate for a cylinder wall (increments in +x)

generateTriangle ( Vertex a, Vertex b, Vertex c, bool invertFace ) : void
generateTriangleFan ( List circ, List centers, bool invertFaces ) : void
generateTriangleFan ( List circ, Vertex cent, bool invertFaces ) : void

비공개 메소드들

메소드 설명
calculateTangents ( ) : Vector4[]
getNorms ( ) : Vector3[]
getTriangles ( ) : int[]
getUVs ( ) : Vector2[]
getVerts ( ) : Vector3[]

메소드 상세

addTriangle() 공개 메소드

public addTriangle ( int a, int b, int c ) : void
a int
b int
c int
리턴 void

addVertex() 공개 메소드

public addVertex ( Vector3 vert, Vector3 norm, Vector2 uv ) : Vertex
vert Vector3
norm Vector3
uv Vector2
리턴 Vertex

buildMesh() 공개 메소드

public buildMesh ( ) : Mesh
리턴 UnityEngine.Mesh

clear() 공개 메소드

public clear ( ) : void
리턴 void

generateCuboid() 공개 메소드

Creates an axis-aligned cube mesh at the given center point, with the given size dimensions, from the input UV coordinates.
public generateCuboid ( Vector3 size, Vector3 center, Vector2 uvStart, Vector2 uvEnd ) : void
size Vector3
center Vector3
uvStart Vector2
uvEnd Vector2
리턴 void

generateCylinderCap() 공개 메소드

public generateCylinderCap ( Vector3 offset, int faces, float outerRadius, float innerRadius, float height, float startAngle, float endAngle, UVArea area, bool bottomCap ) : void
offset Vector3
faces int
outerRadius float
innerRadius float
height float
startAngle float
endAngle float
area UVArea
bottomCap bool
리턴 void

generatePanelCollider() 공개 메소드

public generatePanelCollider ( Vector3 center, float startAngle, float endAngle, float startY, float height, float bottomRadius, float topRadius, float thickness ) : void
center Vector3
startAngle float
endAngle float
startY float
height float
bottomRadius float
topRadius float
thickness float
리턴 void

generateQuads() 공개 메소드

public generateQuads ( List verts1, List verts2, bool invertFaces ) : void
verts1 List
verts2 List
invertFaces bool
리턴 void

generateRadialVerticesCylinderUVs() 공개 메소드

Generates a ring of vertices using circular UV mapping, where the center of the ring is the center of the UV area. This would be used to generate a partial ring, such as the procedural decoupler Input radius is the radius of the actual ring, uvRadius is the radius to be used for maximal UV bounds (e.g. they will only be different on an inner-ring; where radius=ring radius, and uvRadius = outerRingRadius)
public generateRadialVerticesCylinderUVs ( Vector3 offset, int faces, float radius, float height, float startAngle, float endAngle, UVArea area, float uvRadius, float yCos, float ySin ) : List
offset Vector3
faces int
radius float
height float
startAngle float
endAngle float
area UVArea The UV area to map the UV vertex to.
uvRadius float The radius to be used for the UV area, in case it differs from the radius in use (basically scales the UV area)
yCos float Determines the x/z normal component
ySin float Used directly as the y normal component
리턴 List

generateRadialVerticesFlatUVs() 공개 메소드

Used to generate a ring of vertices with the uvMapping appropriate for a cylinder wall (increments in +x)
public generateRadialVerticesFlatUVs ( Vector3 offset, int faces, float radius, float height, float startAngle, float endAngle, float v, UVArea area, float yCos, float ySin ) : List
offset Vector3
faces int
radius float
height float
startAngle float
endAngle float
v float
area UVArea
yCos float
ySin float
리턴 List

generateTriangle() 공개 메소드

public generateTriangle ( Vertex a, Vertex b, Vertex c, bool invertFace ) : void
a Vertex
b Vertex
c Vertex
invertFace bool
리턴 void

generateTriangleFan() 공개 메소드

public generateTriangleFan ( List circ, List centers, bool invertFaces ) : void
circ List
centers List
invertFaces bool
리턴 void

generateTriangleFan() 공개 메소드

public generateTriangleFan ( List circ, Vertex cent, bool invertFaces ) : void
circ List
cent Vertex
invertFaces bool
리턴 void

프로퍼티 상세

subdivision 공개적으로 프로퍼티

public int subdivision
리턴 int