C# Class 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
Mostra file Open project: Alx666/ProjectPhoenix Class Usage Examples

Public Properties

Property Type Description
mesh UnityEngine.Mesh
name string
triangles List
uv List
vertices List

Public Methods

Method Description
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

Method Details

AddData() public method

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
return void

AddPlane() public method

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
return void

AddPlane() public method

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
return void

AddPlane() public method

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
return void

AddTri() public method

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
return void

Atlas() public method

Atlas the entire mesh using newTextureCoords and textures.
public Atlas ( Rect newTextureCoords, TrackBuildRTexture textures ) : void
newTextureCoords UnityEngine.Rect
textures TrackBuildRTexture
return void

Atlas() public method

Atlas the entire mesh, specifying specific submeshes that have been atlased
public Atlas ( int modifySubmeshes, Rect newTextureCoords ) : void
modifySubmeshes int
newTextureCoords UnityEngine.Rect
return void

Atlas() public method

Atlas the specified modifySubmeshes using newTextureCoords and textures.
public Atlas ( int modifySubmeshes, Rect newTextureCoords, TrackBuildRTexture textures ) : void
modifySubmeshes int
newTextureCoords UnityEngine.Rect
textures TrackBuildRTexture
return void

Build() public method

public Build ( ) : void
return void

Build() public method

public Build ( bool calcTangents ) : void
calcTangents bool
return void

CheckMaxTextureUVs() public method

Checks the Max UV values used in this model for each trackTexture.
public CheckMaxTextureUVs ( TrackBuildRTexture textures ) : void
textures TrackBuildRTexture
return void

Clear() public method

Clears the mesh data, ready for nextNormIndex new mesh build
public Clear ( ) : void
return void

CollapseSubmeshes() public method

Collapse all the submeshes into nextNormIndex single submesh
public CollapseSubmeshes ( ) : void
return void

DynamicMeshGenericMultiMaterial() public method

public DynamicMeshGenericMultiMaterial ( ) : UnityEngine
return UnityEngine

RemoveRedundantVerticies() public method

public RemoveRedundantVerticies ( ) : void
return void

SolveTangents() public method

Generate the Mesh tangents. These calculations are heavy and not idea for complex meshes at runtime
public SolveTangents ( ) : void
return void

Property Details

mesh public_oe property

public Mesh,UnityEngine mesh
return UnityEngine.Mesh

name public_oe property

public string name
return string

triangles public_oe property

public List triangles
return List

uv public_oe property

public List uv
return List

vertices public_oe property

public List vertices
return List