C# Класс TrackBuildRUtil.DynamicMeshGenericMultiMaterial

A class dealing with dynamic mesh generataion. Attempts to keep memory use low. Contains nextNormIndex variety of functions to help in the generation of meshes. Uses generic lists to contain the mesh data allowing for the mesh to be of dynamic numberOfPoints Creates nextNormIndex mesh that can support multiple materials
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
mesh UnityEngine.Mesh
name string
triangles List
uv List
vertices List

Открытые методы

Метод Описание
AddData ( Vector3 verts, Vector2 uvs, int tris, int subMesh ) : void

Add new mesh data - all arrays are ordered together

AddPlane ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, Vector2 uv0, Vector2 uv1, Vector2 uv2, Vector2 uv3, int subMesh ) : void

Adds the plane to the generic dynamic mesh.

AddPlane ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, Vector2 minUV, Vector2 maxUV, int subMesh ) : void

Adds the plane to the generic dynamic mesh by specifying min and max UV coords.

AddPlane ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, int subMesh ) : void

Adds the plane to the generic dynamic mesh without specifying UV coords.

AddTri ( Vector3 p0, Vector3 p1, Vector3 p2, int subMesh ) : void

Add the new triangle to the mesh data

Atlas ( Rect newTextureCoords, TrackBuildRTexture textures ) : void

Atlas the entire mesh using newTextureCoords and textures.

Atlas ( int modifySubmeshes, Rect newTextureCoords ) : void

Atlas the entire mesh, specifying specific submeshes that have been atlased

Atlas ( int modifySubmeshes, Rect newTextureCoords, TrackBuildRTexture textures ) : void

Atlas the specified modifySubmeshes using newTextureCoords and textures.

Build ( ) : void
Build ( bool calcTangents ) : void
CheckMaxTextureUVs ( TrackBuildRTexture textures ) : void

Checks the Max UV values used in this model for each trackTexture.

Clear ( ) : void

Clears the mesh data, ready for nextNormIndex new mesh build

CollapseSubmeshes ( ) : void

Collapse all the submeshes into nextNormIndex single submesh

DynamicMeshGenericMultiMaterial ( ) : UnityEngine
RemoveRedundantVerticies ( ) : void
SolveTangents ( ) : void

Generate the Mesh tangents. These calculations are heavy and not idea for complex meshes at runtime

Описание методов

AddData() публичный Метод

Add new mesh data - all arrays are ordered together
public AddData ( Vector3 verts, Vector2 uvs, int tris, int subMesh ) : void
verts UnityEngine.Vector3
uvs UnityEngine.Vector2
tris int
subMesh int
Результат void

AddPlane() публичный Метод

Adds the plane to the generic dynamic mesh.
public AddPlane ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, Vector2 uv0, Vector2 uv1, Vector2 uv2, Vector2 uv3, int subMesh ) : void
p0 UnityEngine.Vector3
p1 UnityEngine.Vector3
p2 UnityEngine.Vector3
p3 UnityEngine.Vector3
uv0 UnityEngine.Vector2
uv1 UnityEngine.Vector2
uv2 UnityEngine.Vector2
uv3 UnityEngine.Vector2
subMesh int
Результат void

AddPlane() публичный Метод

Adds the plane to the generic dynamic mesh by specifying min and max UV coords.
public AddPlane ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, Vector2 minUV, Vector2 maxUV, int subMesh ) : void
p0 UnityEngine.Vector3
p1 UnityEngine.Vector3
p2 UnityEngine.Vector3
p3 UnityEngine.Vector3
minUV UnityEngine.Vector2
maxUV UnityEngine.Vector2
subMesh int
Результат void

AddPlane() публичный Метод

Adds the plane to the generic dynamic mesh without specifying UV coords.
public AddPlane ( Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, int subMesh ) : void
p0 UnityEngine.Vector3
p1 UnityEngine.Vector3
p2 UnityEngine.Vector3
p3 UnityEngine.Vector3
subMesh int
Результат void

AddTri() публичный Метод

Add the new triangle to the mesh data
public AddTri ( Vector3 p0, Vector3 p1, Vector3 p2, int subMesh ) : void
p0 UnityEngine.Vector3
p1 UnityEngine.Vector3
p2 UnityEngine.Vector3
subMesh int
Результат void

Atlas() публичный Метод

Atlas the entire mesh using newTextureCoords and textures.
public Atlas ( Rect newTextureCoords, TrackBuildRTexture textures ) : void
newTextureCoords UnityEngine.Rect
textures TrackBuildRTexture
Результат void

Atlas() публичный Метод

Atlas the entire mesh, specifying specific submeshes that have been atlased
public Atlas ( int modifySubmeshes, Rect newTextureCoords ) : void
modifySubmeshes int
newTextureCoords UnityEngine.Rect
Результат void

Atlas() публичный Метод

Atlas the specified modifySubmeshes using newTextureCoords and textures.
public Atlas ( int modifySubmeshes, Rect newTextureCoords, TrackBuildRTexture textures ) : void
modifySubmeshes int
newTextureCoords UnityEngine.Rect
textures TrackBuildRTexture
Результат void

Build() публичный Метод

public Build ( ) : void
Результат void

Build() публичный Метод

public Build ( bool calcTangents ) : void
calcTangents bool
Результат void

CheckMaxTextureUVs() публичный Метод

Checks the Max UV values used in this model for each trackTexture.
public CheckMaxTextureUVs ( TrackBuildRTexture textures ) : void
textures TrackBuildRTexture
Результат void

Clear() публичный Метод

Clears the mesh data, ready for nextNormIndex new mesh build
public Clear ( ) : void
Результат void

CollapseSubmeshes() публичный Метод

Collapse all the submeshes into nextNormIndex single submesh
public CollapseSubmeshes ( ) : void
Результат void

DynamicMeshGenericMultiMaterial() публичный Метод

public DynamicMeshGenericMultiMaterial ( ) : UnityEngine
Результат UnityEngine

RemoveRedundantVerticies() публичный Метод

public RemoveRedundantVerticies ( ) : void
Результат void

SolveTangents() публичный Метод

Generate the Mesh tangents. These calculations are heavy and not idea for complex meshes at runtime
public SolveTangents ( ) : void
Результат void

Описание свойств

mesh публичное свойство

public Mesh,UnityEngine mesh
Результат UnityEngine.Mesh

name публичное свойство

public string name
Результат string

triangles публичное свойство

public List triangles
Результат List

uv публичное свойство

public List uv
Результат List

vertices публичное свойство

public List vertices
Результат List