1111 lines
35 KiB
C#
1111 lines
35 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using UnityEngine;
|
|
|
|
namespace ProBuilder2.Common
|
|
{
|
|
// Token: 0x0200003D RID: 61
|
|
public class pb_ShapeGenerator
|
|
{
|
|
// Token: 0x060001FC RID: 508 RVA: 0x00019210 File Offset: 0x00017610
|
|
public static pb_Object StairGenerator(Vector3 size, int steps, bool buildSides)
|
|
{
|
|
Vector3[] array = new Vector3[4 * steps * 2];
|
|
pb_Face[] array2 = new pb_Face[steps * 2];
|
|
int num = 0;
|
|
int num2 = 0;
|
|
for (int i = 0; i < steps; i++)
|
|
{
|
|
float num3 = (float)i / (float)steps;
|
|
float num4 = (float)(i + 1) / (float)steps;
|
|
float x = size.x;
|
|
float num5 = 0f;
|
|
float num6 = size.y * num3;
|
|
float num7 = size.y * num4;
|
|
float num8 = size.z * num3;
|
|
float num9 = size.z * num4;
|
|
array[num] = new Vector3(x, num6, num8);
|
|
array[num + 1] = new Vector3(num5, num6, num8);
|
|
array[num + 2] = new Vector3(x, num7, num8);
|
|
array[num + 3] = new Vector3(num5, num7, num8);
|
|
array[num + 4] = new Vector3(x, num7, num8);
|
|
array[num + 5] = new Vector3(num5, num7, num8);
|
|
array[num + 6] = new Vector3(x, num7, num9);
|
|
array[num + 7] = new Vector3(num5, num7, num9);
|
|
array2[num2] = new pb_Face(new int[]
|
|
{
|
|
num,
|
|
num + 1,
|
|
num + 2,
|
|
num + 1,
|
|
num + 3,
|
|
num + 2
|
|
});
|
|
array2[num2 + 1] = new pb_Face(new int[]
|
|
{
|
|
num + 4,
|
|
num + 5,
|
|
num + 6,
|
|
num + 5,
|
|
num + 7,
|
|
num + 6
|
|
});
|
|
num += 8;
|
|
num2 += 2;
|
|
}
|
|
if (buildSides)
|
|
{
|
|
float num10 = 0f;
|
|
for (int j = 0; j < 2; j++)
|
|
{
|
|
Vector3[] array3 = new Vector3[steps * 4 + (steps - 1) * 3];
|
|
pb_Face[] array4 = new pb_Face[steps + steps - 1];
|
|
int num11 = 0;
|
|
int num12 = 0;
|
|
for (int k = 0; k < steps; k++)
|
|
{
|
|
float num13 = (float)Mathf.Max(k, 1) / (float)steps * size.y;
|
|
float num14 = (float)(k + 1) / (float)steps * size.y;
|
|
float num15 = (float)k / (float)steps * size.z;
|
|
float num16 = (float)(k + 1) / (float)steps * size.z;
|
|
array3[num11] = new Vector3(num10, 0f, num15);
|
|
array3[num11 + 1] = new Vector3(num10, 0f, num16);
|
|
array3[num11 + 2] = new Vector3(num10, num13, num15);
|
|
array3[num11 + 3] = new Vector3(num10, num14, num16);
|
|
pb_Face[] array5 = array4;
|
|
int num17 = num12++;
|
|
int[] array7;
|
|
if (j % 2 == 0)
|
|
{
|
|
int[] array6 = new int[6];
|
|
array6[0] = num;
|
|
array6[1] = num + 1;
|
|
array6[2] = num + 2;
|
|
array6[3] = num + 1;
|
|
array6[4] = num + 3;
|
|
array7 = array6;
|
|
array6[5] = num + 2;
|
|
}
|
|
else
|
|
{
|
|
int[] array8 = new int[6];
|
|
array8[0] = num + 2;
|
|
array8[1] = num + 1;
|
|
array8[2] = num;
|
|
array8[3] = num + 2;
|
|
array8[4] = num + 3;
|
|
array7 = array8;
|
|
array8[5] = num + 1;
|
|
}
|
|
array5[num17] = new pb_Face(array7);
|
|
array4[num12 - 1].textureGroup = j + 1;
|
|
num += 4;
|
|
num11 += 4;
|
|
if (k > 0)
|
|
{
|
|
array3[num11] = new Vector3(num10, num13, num15);
|
|
array3[num11 + 1] = new Vector3(num10, num14, num15);
|
|
array3[num11 + 2] = new Vector3(num10, num14, num16);
|
|
pb_Face[] array9 = array4;
|
|
int num18 = num12++;
|
|
int[] array11;
|
|
if (j % 2 == 0)
|
|
{
|
|
int[] array10 = new int[3];
|
|
array10[0] = num + 2;
|
|
array10[1] = num + 1;
|
|
array11 = array10;
|
|
array10[2] = num;
|
|
}
|
|
else
|
|
{
|
|
int[] array12 = new int[3];
|
|
array12[0] = num;
|
|
array12[1] = num + 1;
|
|
array11 = array12;
|
|
array12[2] = num + 2;
|
|
}
|
|
array9[num18] = new pb_Face(array11);
|
|
array4[num12 - 1].textureGroup = j + 1;
|
|
num += 3;
|
|
num11 += 3;
|
|
}
|
|
}
|
|
array = array.Concat(array3);
|
|
array2 = array2.Concat(array4);
|
|
num10 += size.x;
|
|
}
|
|
array = array.Concat(new Vector3[]
|
|
{
|
|
new Vector3(0f, 0f, size.z),
|
|
new Vector3(size.x, 0f, size.z),
|
|
new Vector3(0f, size.y, size.z),
|
|
new Vector3(size.x, size.y, size.z)
|
|
});
|
|
array2 = array2.Add(new pb_Face(new int[]
|
|
{
|
|
num,
|
|
num + 1,
|
|
num + 2,
|
|
num + 1,
|
|
num + 3,
|
|
num + 2
|
|
}));
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array, array2);
|
|
pb_Object.gameObject.name = "Stairs";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x060001FD RID: 509 RVA: 0x00019730 File Offset: 0x00017B30
|
|
public static pb_Object CurvedStairGenerator(float stairWidth, float height, float innerRadius, float circumference, int steps, bool buildSides)
|
|
{
|
|
bool flag = innerRadius < Mathf.Epsilon;
|
|
Vector3[] array = new Vector3[4 * steps + ((!flag) ? 4 : 3) * steps];
|
|
pb_Face[] array2 = new pb_Face[steps * 2];
|
|
int num = 0;
|
|
int num2 = 0;
|
|
float num3 = Mathf.Abs(circumference) * 0.017453292f;
|
|
float num4 = innerRadius + stairWidth;
|
|
for (int i = 0; i < steps; i++)
|
|
{
|
|
float num5 = (float)i / (float)steps * num3;
|
|
float num6 = (float)(i + 1) / (float)steps * num3;
|
|
float num7 = (float)i / (float)steps * height;
|
|
float num8 = (float)(i + 1) / (float)steps * height;
|
|
Vector3 vector = new Vector3(-Mathf.Cos(num5), 0f, Mathf.Sin(num5));
|
|
Vector3 vector2 = new Vector3(-Mathf.Cos(num6), 0f, Mathf.Sin(num6));
|
|
array[num] = vector * innerRadius;
|
|
array[num + 1] = vector * num4;
|
|
array[num + 2] = vector * innerRadius;
|
|
array[num + 3] = vector * num4;
|
|
array[num].y = num7;
|
|
array[num + 1].y = num7;
|
|
array[num + 2].y = num8;
|
|
array[num + 3].y = num8;
|
|
array[num + 4] = array[num + 2];
|
|
array[num + 5] = array[num + 3];
|
|
array[num + 6] = vector2 * num4;
|
|
array[num + 6].y = num8;
|
|
if (!flag)
|
|
{
|
|
array[num + 7] = vector2 * innerRadius;
|
|
array[num + 7].y = num8;
|
|
}
|
|
array2[num2] = new pb_Face(new int[]
|
|
{
|
|
num,
|
|
num + 1,
|
|
num + 2,
|
|
num + 1,
|
|
num + 3,
|
|
num + 2
|
|
});
|
|
if (flag)
|
|
{
|
|
array2[num2 + 1] = new pb_Face(new int[]
|
|
{
|
|
num + 4,
|
|
num + 5,
|
|
num + 6
|
|
});
|
|
}
|
|
else
|
|
{
|
|
array2[num2 + 1] = new pb_Face(new int[]
|
|
{
|
|
num + 4,
|
|
num + 5,
|
|
num + 6,
|
|
num + 4,
|
|
num + 6,
|
|
num + 7
|
|
});
|
|
}
|
|
float num9 = (num6 + num5) * -0.5f * 57.29578f;
|
|
num9 %= 360f;
|
|
if (num9 < 0f)
|
|
{
|
|
num9 = 360f + num9;
|
|
}
|
|
array2[num2 + 1].uv.rotation = num9;
|
|
num += ((!flag) ? 8 : 7);
|
|
num2 += 2;
|
|
}
|
|
if (buildSides)
|
|
{
|
|
float num10 = ((!flag) ? innerRadius : (innerRadius + stairWidth));
|
|
for (int j = ((!flag) ? 0 : 1); j < 2; j++)
|
|
{
|
|
Vector3[] array3 = new Vector3[steps * 4 + (steps - 1) * 3];
|
|
pb_Face[] array4 = new pb_Face[steps + steps - 1];
|
|
int num11 = 0;
|
|
int num12 = 0;
|
|
for (int k = 0; k < steps; k++)
|
|
{
|
|
float num13 = (float)k / (float)steps * num3;
|
|
float num14 = (float)(k + 1) / (float)steps * num3;
|
|
float num15 = (float)Mathf.Max(k, 1) / (float)steps * height;
|
|
float num16 = (float)(k + 1) / (float)steps * height;
|
|
Vector3 vector3 = new Vector3(-Mathf.Cos(num13), 0f, Mathf.Sin(num13)) * num10;
|
|
Vector3 vector4 = new Vector3(-Mathf.Cos(num14), 0f, Mathf.Sin(num14)) * num10;
|
|
array3[num11] = vector3;
|
|
array3[num11 + 1] = vector4;
|
|
array3[num11 + 2] = vector3;
|
|
array3[num11 + 3] = vector4;
|
|
array3[num11].y = 0f;
|
|
array3[num11 + 1].y = 0f;
|
|
array3[num11 + 2].y = num15;
|
|
array3[num11 + 3].y = num16;
|
|
pb_Face[] array5 = array4;
|
|
int num17 = num12++;
|
|
int[] array7;
|
|
if (j % 2 == 0)
|
|
{
|
|
int[] array6 = new int[6];
|
|
array6[0] = num + 2;
|
|
array6[1] = num + 1;
|
|
array6[2] = num;
|
|
array6[3] = num + 2;
|
|
array6[4] = num + 3;
|
|
array7 = array6;
|
|
array6[5] = num + 1;
|
|
}
|
|
else
|
|
{
|
|
int[] array8 = new int[6];
|
|
array8[0] = num;
|
|
array8[1] = num + 1;
|
|
array8[2] = num + 2;
|
|
array8[3] = num + 1;
|
|
array8[4] = num + 3;
|
|
array7 = array8;
|
|
array8[5] = num + 2;
|
|
}
|
|
array5[num17] = new pb_Face(array7);
|
|
array4[num12 - 1].smoothingGroup = j + 1;
|
|
num += 4;
|
|
num11 += 4;
|
|
if (k > 0)
|
|
{
|
|
array4[num12 - 1].textureGroup = j * steps + k;
|
|
array3[num11] = vector3;
|
|
array3[num11 + 1] = vector4;
|
|
array3[num11 + 2] = vector3;
|
|
array3[num11].y = num15;
|
|
array3[num11 + 1].y = num16;
|
|
array3[num11 + 2].y = num16;
|
|
pb_Face[] array9 = array4;
|
|
int num18 = num12++;
|
|
int[] array11;
|
|
if (j % 2 == 0)
|
|
{
|
|
int[] array10 = new int[3];
|
|
array10[0] = num + 2;
|
|
array10[1] = num + 1;
|
|
array11 = array10;
|
|
array10[2] = num;
|
|
}
|
|
else
|
|
{
|
|
int[] array12 = new int[3];
|
|
array12[0] = num;
|
|
array12[1] = num + 1;
|
|
array11 = array12;
|
|
array12[2] = num + 2;
|
|
}
|
|
array9[num18] = new pb_Face(array11);
|
|
array4[num12 - 1].textureGroup = j * steps + k;
|
|
array4[num12 - 1].smoothingGroup = j + 1;
|
|
num += 3;
|
|
num11 += 3;
|
|
}
|
|
}
|
|
array = array.Concat(array3);
|
|
array2 = array2.Concat(array4);
|
|
num10 += stairWidth;
|
|
}
|
|
float num19 = -Mathf.Cos(num3);
|
|
float num20 = Mathf.Sin(num3);
|
|
array = array.Concat(new Vector3[]
|
|
{
|
|
new Vector3(num19, 0f, num20) * innerRadius,
|
|
new Vector3(num19, 0f, num20) * num4,
|
|
new Vector3(num19 * innerRadius, height, num20 * innerRadius),
|
|
new Vector3(num19 * num4, height, num20 * num4)
|
|
});
|
|
array2 = array2.Add(new pb_Face(new int[]
|
|
{
|
|
num + 2,
|
|
num + 1,
|
|
num,
|
|
num + 2,
|
|
num + 3,
|
|
num + 1
|
|
}));
|
|
}
|
|
if (circumference < 0f)
|
|
{
|
|
Vector3 vector5 = new Vector3(-1f, 1f, 1f);
|
|
for (int l = 0; l < array.Length; l++)
|
|
{
|
|
array[l].Scale(vector5);
|
|
}
|
|
foreach (pb_Face pb_Face in array2)
|
|
{
|
|
pb_Face.ReverseIndices();
|
|
}
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array, array2);
|
|
pb_Object.gameObject.name = "Stairs";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x060001FE RID: 510 RVA: 0x00019E8C File Offset: 0x0001828C
|
|
public static pb_Object StairGenerator(int steps, float width, float height, float depth, bool sidesGoToFloor, bool generateBack, bool platformsOnly)
|
|
{
|
|
List<Vector3> list = new List<Vector3>();
|
|
Vector3[] array = ((!platformsOnly) ? new Vector3[16] : new Vector3[8]);
|
|
float num = height / (float)steps;
|
|
float num2 = depth / (float)steps;
|
|
for (int i = 0; i < steps; i++)
|
|
{
|
|
float num3 = width / 2f;
|
|
float num4 = (float)i * num;
|
|
float num5 = (float)i * num2;
|
|
if (sidesGoToFloor)
|
|
{
|
|
num4 = 0f;
|
|
}
|
|
float num6 = (float)i * num + num;
|
|
array[0] = new Vector3(num3, (float)i * num, num5);
|
|
array[1] = new Vector3(-num3, (float)i * num, num5);
|
|
array[2] = new Vector3(num3, num6, num5);
|
|
array[3] = new Vector3(-num3, num6, num5);
|
|
array[4] = new Vector3(num3, num6, num5);
|
|
array[5] = new Vector3(-num3, num6, num5);
|
|
array[6] = new Vector3(num3, num6, num5 + num2);
|
|
array[7] = new Vector3(-num3, num6, num5 + num2);
|
|
if (!platformsOnly)
|
|
{
|
|
array[8] = new Vector3(num3, num4, num5 + num2);
|
|
array[9] = new Vector3(num3, num4, num5);
|
|
array[10] = new Vector3(num3, num6, num5 + num2);
|
|
array[11] = new Vector3(num3, num6, num5);
|
|
array[12] = new Vector3(-num3, num4, num5);
|
|
array[13] = new Vector3(-num3, num4, num5 + num2);
|
|
array[14] = new Vector3(-num3, num6, num5);
|
|
array[15] = new Vector3(-num3, num6, num5 + num2);
|
|
}
|
|
list.AddRange(array);
|
|
}
|
|
if (generateBack)
|
|
{
|
|
list.Add(new Vector3(-width / 2f, 0f, depth));
|
|
list.Add(new Vector3(width / 2f, 0f, depth));
|
|
list.Add(new Vector3(-width / 2f, height, depth));
|
|
list.Add(new Vector3(width / 2f, height, depth));
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
|
|
pb_Object.gameObject.name = "Stairs";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x060001FF RID: 511 RVA: 0x0001A134 File Offset: 0x00018534
|
|
public static pb_Object CubeGenerator(Vector3 size)
|
|
{
|
|
Vector3[] array = new Vector3[pb_Constant.TRIANGLES_CUBE.Length];
|
|
for (int i = 0; i < pb_Constant.TRIANGLES_CUBE.Length; i++)
|
|
{
|
|
array[i] = Vector3.Scale(pb_Constant.VERTICES_CUBE[pb_Constant.TRIANGLES_CUBE[i]], size);
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(array);
|
|
pb_Object.gameObject.name = "Cube";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000200 RID: 512 RVA: 0x0001A1A8 File Offset: 0x000185A8
|
|
public static pb_Object CylinderGenerator(int axisDivisions, float radius, float height, int heightCuts, int smoothing = -1)
|
|
{
|
|
if (axisDivisions % 2 != 0)
|
|
{
|
|
axisDivisions++;
|
|
}
|
|
if (axisDivisions > 64)
|
|
{
|
|
axisDivisions = 64;
|
|
}
|
|
float num = 360f / (float)axisDivisions;
|
|
float num2 = height / (float)(heightCuts + 1);
|
|
Vector3[] array = new Vector3[axisDivisions];
|
|
for (int i = 0; i < axisDivisions; i++)
|
|
{
|
|
float num3 = num * (float)i * 0.017453292f;
|
|
float num4 = Mathf.Cos(num3) * radius;
|
|
float num5 = Mathf.Sin(num3) * radius;
|
|
array[i] = new Vector3(num4, 0f, num5);
|
|
}
|
|
Vector3[] array2 = new Vector3[axisDivisions * (heightCuts + 1) * 4 + axisDivisions * 6];
|
|
pb_Face[] array3 = new pb_Face[axisDivisions * (heightCuts + 1) + axisDivisions * 2];
|
|
int num6 = 0;
|
|
for (int j = 0; j < heightCuts + 1; j++)
|
|
{
|
|
float num7 = (float)j * num2;
|
|
float num8 = (float)(j + 1) * num2;
|
|
for (int k = 0; k < axisDivisions; k++)
|
|
{
|
|
array2[num6] = new Vector3(array[k].x, num7, array[k].z);
|
|
array2[num6 + 1] = new Vector3(array[k].x, num8, array[k].z);
|
|
if (k != axisDivisions - 1)
|
|
{
|
|
array2[num6 + 2] = new Vector3(array[k + 1].x, num7, array[k + 1].z);
|
|
array2[num6 + 3] = new Vector3(array[k + 1].x, num8, array[k + 1].z);
|
|
}
|
|
else
|
|
{
|
|
array2[num6 + 2] = new Vector3(array[0].x, num7, array[0].z);
|
|
array2[num6 + 3] = new Vector3(array[0].x, num8, array[0].z);
|
|
}
|
|
num6 += 4;
|
|
}
|
|
}
|
|
int num9 = 0;
|
|
for (int l = 0; l < heightCuts + 1; l++)
|
|
{
|
|
for (int m = 0; m < axisDivisions * 4; m += 4)
|
|
{
|
|
int num10 = l * (axisDivisions * 4) + m;
|
|
int num11 = num10;
|
|
int num12 = num10 + 1;
|
|
int num13 = num10 + 2;
|
|
int num14 = num10 + 3;
|
|
array3[num9++] = new pb_Face(new int[] { num11, num12, num13, num12, num14, num13 }, pb_Constant.DefaultMaterial, new pb_UV(), smoothing, -1, -1, false);
|
|
}
|
|
}
|
|
int num15 = axisDivisions * (heightCuts + 1) * 4;
|
|
int num16 = axisDivisions * (heightCuts + 1);
|
|
for (int n = 0; n < axisDivisions; n++)
|
|
{
|
|
array2[num15] = new Vector3(array[n].x, 0f, array[n].z);
|
|
array2[num15 + 1] = Vector3.zero;
|
|
if (n != axisDivisions - 1)
|
|
{
|
|
array2[num15 + 2] = new Vector3(array[n + 1].x, 0f, array[n + 1].z);
|
|
}
|
|
else
|
|
{
|
|
array2[num15 + 2] = new Vector3(array[0].x, 0f, array[0].z);
|
|
}
|
|
array3[num16 + n] = new pb_Face(new int[]
|
|
{
|
|
num15 + 2,
|
|
num15 + 1,
|
|
num15
|
|
});
|
|
num15 += 3;
|
|
array2[num15] = new Vector3(array[n].x, height, array[n].z);
|
|
array2[num15 + 1] = new Vector3(0f, height, 0f);
|
|
if (n != axisDivisions - 1)
|
|
{
|
|
array2[num15 + 2] = new Vector3(array[n + 1].x, height, array[n + 1].z);
|
|
}
|
|
else
|
|
{
|
|
array2[num15 + 2] = new Vector3(array[0].x, height, array[0].z);
|
|
}
|
|
array3[num16 + (n + axisDivisions)] = new pb_Face(new int[]
|
|
{
|
|
num15,
|
|
num15 + 1,
|
|
num15 + 2
|
|
});
|
|
num15 += 3;
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array2, array3);
|
|
pb_Object.gameObject.name = "Cylinder";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000201 RID: 513 RVA: 0x0001A688 File Offset: 0x00018A88
|
|
public static pb_Object PrismGenerator(Vector3 size)
|
|
{
|
|
size.y *= 2f;
|
|
Vector3[] array = new Vector3[]
|
|
{
|
|
Vector3.Scale(new Vector3(-0.5f, 0f, -0.5f), size),
|
|
Vector3.Scale(new Vector3(0.5f, 0f, -0.5f), size),
|
|
Vector3.Scale(new Vector3(0f, 0.5f, -0.5f), size),
|
|
Vector3.Scale(new Vector3(-0.5f, 0f, 0.5f), size),
|
|
Vector3.Scale(new Vector3(0.5f, 0f, 0.5f), size),
|
|
Vector3.Scale(new Vector3(0f, 0.5f, 0.5f), size)
|
|
};
|
|
Vector3[] array2 = new Vector3[]
|
|
{
|
|
array[0],
|
|
array[1],
|
|
array[2],
|
|
array[1],
|
|
array[4],
|
|
array[2],
|
|
array[5],
|
|
array[4],
|
|
array[3],
|
|
array[5],
|
|
array[3],
|
|
array[0],
|
|
array[5],
|
|
array[2],
|
|
array[0],
|
|
array[1],
|
|
array[3],
|
|
array[4]
|
|
};
|
|
pb_Face[] array3 = new pb_Face[5];
|
|
int num = 0;
|
|
int[] array4 = new int[3];
|
|
array4[0] = 2;
|
|
array4[1] = 1;
|
|
array3[num] = new pb_Face(array4);
|
|
array3[1] = new pb_Face(new int[] { 5, 4, 3, 5, 6, 4 });
|
|
array3[2] = new pb_Face(new int[] { 9, 8, 7 });
|
|
array3[3] = new pb_Face(new int[] { 12, 11, 10, 12, 13, 11 });
|
|
array3[4] = new pb_Face(new int[] { 14, 15, 16, 15, 17, 16 });
|
|
pb_Face[] array5 = array3;
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array2, array5);
|
|
pb_Object.gameObject.name = "Prism";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000202 RID: 514 RVA: 0x0001A9F0 File Offset: 0x00018DF0
|
|
public static pb_Object DoorGenerator(float totalWidth, float totalHeight, float ledgeHeight, float legWidth, float depth)
|
|
{
|
|
float num = totalWidth / 2f;
|
|
legWidth = num - legWidth;
|
|
ledgeHeight = totalHeight - ledgeHeight;
|
|
Vector3[] array = new Vector3[]
|
|
{
|
|
new Vector3(-num, 0f, depth),
|
|
new Vector3(-legWidth, 0f, depth),
|
|
new Vector3(legWidth, 0f, depth),
|
|
new Vector3(num, 0f, depth),
|
|
new Vector3(-num, ledgeHeight, depth),
|
|
new Vector3(-legWidth, ledgeHeight, depth),
|
|
new Vector3(legWidth, ledgeHeight, depth),
|
|
new Vector3(num, ledgeHeight, depth),
|
|
new Vector3(-num, totalHeight, depth),
|
|
new Vector3(-legWidth, totalHeight, depth),
|
|
new Vector3(legWidth, totalHeight, depth),
|
|
new Vector3(num, totalHeight, depth)
|
|
};
|
|
List<Vector3> list = new List<Vector3>();
|
|
list.Add(array[0]);
|
|
list.Add(array[1]);
|
|
list.Add(array[4]);
|
|
list.Add(array[5]);
|
|
list.Add(array[2]);
|
|
list.Add(array[3]);
|
|
list.Add(array[6]);
|
|
list.Add(array[7]);
|
|
list.Add(array[4]);
|
|
list.Add(array[5]);
|
|
list.Add(array[8]);
|
|
list.Add(array[9]);
|
|
list.Add(array[6]);
|
|
list.Add(array[7]);
|
|
list.Add(array[10]);
|
|
list.Add(array[11]);
|
|
list.Add(array[5]);
|
|
list.Add(array[6]);
|
|
list.Add(array[9]);
|
|
list.Add(array[10]);
|
|
List<Vector3> list2 = new List<Vector3>();
|
|
for (int i = 0; i < list.Count; i += 4)
|
|
{
|
|
list2.Add(list[i + 1] - Vector3.forward * depth);
|
|
list2.Add(list[i] - Vector3.forward * depth);
|
|
list2.Add(list[i + 3] - Vector3.forward * depth);
|
|
list2.Add(list[i + 2] - Vector3.forward * depth);
|
|
}
|
|
list.AddRange(list2);
|
|
list.Add(array[6]);
|
|
list.Add(array[5]);
|
|
list.Add(array[6] - Vector3.forward * depth);
|
|
list.Add(array[5] - Vector3.forward * depth);
|
|
list.Add(array[2] - Vector3.forward * depth);
|
|
list.Add(array[2]);
|
|
list.Add(array[6] - Vector3.forward * depth);
|
|
list.Add(array[6]);
|
|
list.Add(array[1]);
|
|
list.Add(array[1] - Vector3.forward * depth);
|
|
list.Add(array[5]);
|
|
list.Add(array[5] - Vector3.forward * depth);
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
|
|
pb_Object.gameObject.name = "Door";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000203 RID: 515 RVA: 0x0001AEA8 File Offset: 0x000192A8
|
|
public static pb_Object PlaneGenerator(float _width, float _height, int widthCuts, int heightCuts, Axis axis, bool smooth)
|
|
{
|
|
int num = widthCuts + 1;
|
|
int num2 = heightCuts + 1;
|
|
Vector2[] array = ((!smooth) ? new Vector2[num * num2 * 4] : new Vector2[num * num2]);
|
|
Vector3[] array2 = ((!smooth) ? new Vector3[num * num2 * 4] : new Vector3[num * num2]);
|
|
pb_Face[] array3 = new pb_Face[num * num2];
|
|
int i = 0;
|
|
int num3 = 0;
|
|
for (int j = 0; j < num2; j++)
|
|
{
|
|
for (int k = 0; k < num; k++)
|
|
{
|
|
float num4 = (float)k * (_width / (float)num) - _width / 2f - _width / (float)num / (float)num;
|
|
float num5 = (float)(k + 1) * (_width / (float)num) - _width / 2f - _width / (float)num / (float)num;
|
|
float num6 = (float)j * (_height / (float)num2) - _height / 2f - _height / (float)num2 / (float)num2;
|
|
float num7 = (float)(j + 1) * (_height / (float)num2) - _height / 2f - _height / (float)num2 / (float)num2;
|
|
array[i] = new Vector2(num4, num6);
|
|
array[i + 1] = new Vector2(num5, num6);
|
|
array[i + 2] = new Vector2(num4, num7);
|
|
array[i + 3] = new Vector2(num5, num7);
|
|
array3[num3++] = new pb_Face(new int[]
|
|
{
|
|
i,
|
|
i + 1,
|
|
i + 2,
|
|
i + 1,
|
|
i + 3,
|
|
i + 2
|
|
});
|
|
i += 4;
|
|
}
|
|
}
|
|
switch (axis)
|
|
{
|
|
case Axis.Right:
|
|
for (i = 0; i < array2.Length; i++)
|
|
{
|
|
array2[i] = new Vector3(0f, array[i].x, array[i].y);
|
|
}
|
|
break;
|
|
case Axis.Left:
|
|
for (i = 0; i < array2.Length; i++)
|
|
{
|
|
array2[i] = new Vector3(0f, array[i].y, array[i].x);
|
|
}
|
|
break;
|
|
case Axis.Up:
|
|
for (i = 0; i < array2.Length; i++)
|
|
{
|
|
array2[i] = new Vector3(array[i].y, 0f, array[i].x);
|
|
}
|
|
break;
|
|
case Axis.Down:
|
|
for (i = 0; i < array2.Length; i++)
|
|
{
|
|
array2[i] = new Vector3(array[i].x, 0f, array[i].y);
|
|
}
|
|
break;
|
|
case Axis.Forward:
|
|
for (i = 0; i < array2.Length; i++)
|
|
{
|
|
array2[i] = new Vector3(array[i].x, array[i].y, 0f);
|
|
}
|
|
break;
|
|
case Axis.Backward:
|
|
for (i = 0; i < array2.Length; i++)
|
|
{
|
|
array2[i] = new Vector3(array[i].y, array[i].x, 0f);
|
|
}
|
|
break;
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(array2, array3);
|
|
pb_Object.gameObject.name = "Plane";
|
|
Vector3 vector = Vector3.zero;
|
|
Vector3[] array4 = pb_Object.VerticesInWorldSpace();
|
|
foreach (Vector3 vector2 in array4)
|
|
{
|
|
vector += vector2;
|
|
}
|
|
vector /= (float)array4.Length;
|
|
Vector3 vector3 = pb_Object.transform.position - vector;
|
|
pb_Object.transform.position = vector;
|
|
pb_Object.TranslateVertices_World(pb_Object.msh.triangles, vector3);
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000204 RID: 516 RVA: 0x0001B30C File Offset: 0x0001970C
|
|
public static pb_Object PipeGenerator(float radius, float height, float thickness, int subdivAxis, int subdivHeight)
|
|
{
|
|
Vector2[] array = new Vector2[subdivAxis];
|
|
Vector2[] array2 = new Vector2[subdivAxis];
|
|
for (int i = 0; i < subdivAxis; i++)
|
|
{
|
|
array[i] = pb_Math.PointInCircumference(radius, (float)i * (360f / (float)subdivAxis), Vector2.zero);
|
|
array2[i] = pb_Math.PointInCircumference(radius - thickness, (float)i * (360f / (float)subdivAxis), Vector2.zero);
|
|
}
|
|
List<Vector3> list = new List<Vector3>();
|
|
subdivHeight++;
|
|
for (int j = 0; j < subdivHeight; j++)
|
|
{
|
|
float num = (float)j * (height / (float)subdivHeight);
|
|
float num2 = (float)(j + 1) * (height / (float)subdivHeight);
|
|
for (int k = 0; k < subdivAxis; k++)
|
|
{
|
|
Vector2 vector = array[k];
|
|
Vector2 vector2 = ((k >= subdivAxis - 1) ? array[0] : array[k + 1]);
|
|
Vector3[] array3 = new Vector3[]
|
|
{
|
|
new Vector3(vector2.x, num, vector2.y),
|
|
new Vector3(vector.x, num, vector.y),
|
|
new Vector3(vector2.x, num2, vector2.y),
|
|
new Vector3(vector.x, num2, vector.y)
|
|
};
|
|
vector = array2[k];
|
|
vector2 = ((k >= subdivAxis - 1) ? array2[0] : array2[k + 1]);
|
|
Vector3[] array4 = new Vector3[]
|
|
{
|
|
new Vector3(vector.x, num, vector.y),
|
|
new Vector3(vector2.x, num, vector2.y),
|
|
new Vector3(vector.x, num2, vector.y),
|
|
new Vector3(vector2.x, num2, vector2.y)
|
|
};
|
|
list.AddRange(array3);
|
|
list.AddRange(array4);
|
|
}
|
|
}
|
|
for (int l = 0; l < subdivAxis; l++)
|
|
{
|
|
Vector2 vector = array[l];
|
|
Vector2 vector2 = ((l >= subdivAxis - 1) ? array[0] : array[l + 1]);
|
|
Vector2 vector3 = array2[l];
|
|
Vector2 vector4 = ((l >= subdivAxis - 1) ? array2[0] : array2[l + 1]);
|
|
Vector3[] array5 = new Vector3[]
|
|
{
|
|
new Vector3(vector2.x, height, vector2.y),
|
|
new Vector3(vector.x, height, vector.y),
|
|
new Vector3(vector4.x, height, vector4.y),
|
|
new Vector3(vector3.x, height, vector3.y)
|
|
};
|
|
Vector3[] array6 = new Vector3[]
|
|
{
|
|
new Vector3(vector.x, 0f, vector.y),
|
|
new Vector3(vector2.x, 0f, vector2.y),
|
|
new Vector3(vector3.x, 0f, vector3.y),
|
|
new Vector3(vector4.x, 0f, vector4.y)
|
|
};
|
|
list.AddRange(array6);
|
|
list.AddRange(array5);
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
|
|
pb_Object.gameObject.name = "Pipe";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000205 RID: 517 RVA: 0x0001B74C File Offset: 0x00019B4C
|
|
public static pb_Object ConeGenerator(float radius, float height, int subdivAxis)
|
|
{
|
|
Vector3[] array = new Vector3[subdivAxis];
|
|
for (int i = 0; i < subdivAxis; i++)
|
|
{
|
|
Vector2 vector = pb_Math.PointInCircumference(radius, (float)i * (360f / (float)subdivAxis), Vector2.zero);
|
|
array[i] = new Vector3(vector.x, 0f, vector.y);
|
|
}
|
|
List<Vector3> list = new List<Vector3>();
|
|
List<pb_Face> list2 = new List<pb_Face>();
|
|
for (int j = 0; j < subdivAxis; j++)
|
|
{
|
|
list.Add(array[j]);
|
|
list.Add((j >= subdivAxis - 1) ? array[0] : array[j + 1]);
|
|
list.Add(Vector3.up * height);
|
|
list.Add(array[j]);
|
|
list.Add((j >= subdivAxis - 1) ? array[0] : array[j + 1]);
|
|
list.Add(Vector3.zero);
|
|
}
|
|
for (int k = 0; k < subdivAxis * 6; k += 6)
|
|
{
|
|
list2.Add(new pb_Face(new int[]
|
|
{
|
|
k + 2,
|
|
k + 1,
|
|
k
|
|
}));
|
|
list2.Add(new pb_Face(new int[]
|
|
{
|
|
k + 3,
|
|
k + 4,
|
|
k + 5
|
|
}));
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(list.ToArray(), list2.ToArray());
|
|
pb_Object.gameObject.name = "Cone";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000206 RID: 518 RVA: 0x0001B900 File Offset: 0x00019D00
|
|
public static pb_Object ArchGenerator(float angle, float radius, float width, float depth, int radialCuts, bool insideFaces, bool outsideFaces, bool frontFaces, bool backFaces, bool endCaps)
|
|
{
|
|
Vector2[] array = new Vector2[radialCuts];
|
|
Vector2[] array2 = new Vector2[radialCuts];
|
|
for (int i = 0; i < radialCuts; i++)
|
|
{
|
|
array[i] = pb_Math.PointInCircumference(radius, (float)i * (angle / (float)(radialCuts - 1)), Vector2.zero);
|
|
array2[i] = pb_Math.PointInCircumference(radius - width, (float)i * (angle / (float)(radialCuts - 1)), Vector2.zero);
|
|
}
|
|
List<Vector3> list = new List<Vector3>();
|
|
float num = 0f;
|
|
for (int j = 0; j < radialCuts - 1; j++)
|
|
{
|
|
Vector2 vector = array[j];
|
|
Vector2 vector2 = ((j >= radialCuts - 1) ? array[j] : array[j + 1]);
|
|
Vector3[] array3 = new Vector3[]
|
|
{
|
|
new Vector3(vector.x, vector.y, num),
|
|
new Vector3(vector2.x, vector2.y, num),
|
|
new Vector3(vector.x, vector.y, depth),
|
|
new Vector3(vector2.x, vector2.y, depth)
|
|
};
|
|
vector = array2[j];
|
|
vector2 = ((j >= radialCuts - 1) ? array2[j] : array2[j + 1]);
|
|
Vector3[] array4 = new Vector3[]
|
|
{
|
|
new Vector3(vector2.x, vector2.y, num),
|
|
new Vector3(vector.x, vector.y, num),
|
|
new Vector3(vector2.x, vector2.y, depth),
|
|
new Vector3(vector.x, vector.y, depth)
|
|
};
|
|
if (outsideFaces)
|
|
{
|
|
list.AddRange(array3);
|
|
}
|
|
if (j != radialCuts - 1 && insideFaces)
|
|
{
|
|
list.AddRange(array4);
|
|
}
|
|
if (angle < 360f && endCaps)
|
|
{
|
|
if (j == 0)
|
|
{
|
|
list.AddRange(new Vector3[]
|
|
{
|
|
new Vector3(array[j].x, array[j].y, depth),
|
|
new Vector3(array2[j].x, array2[j].y, depth),
|
|
new Vector3(array[j].x, array[j].y, num),
|
|
new Vector3(array2[j].x, array2[j].y, num)
|
|
});
|
|
}
|
|
if (j == radialCuts - 2)
|
|
{
|
|
list.AddRange(new Vector3[]
|
|
{
|
|
new Vector3(array2[j + 1].x, array2[j + 1].y, depth),
|
|
new Vector3(array[j + 1].x, array[j + 1].y, depth),
|
|
new Vector3(array2[j + 1].x, array2[j + 1].y, num),
|
|
new Vector3(array[j + 1].x, array[j + 1].y, num)
|
|
});
|
|
}
|
|
}
|
|
}
|
|
for (int k = 0; k < radialCuts - 1; k++)
|
|
{
|
|
Vector2 vector = array[k];
|
|
Vector2 vector2 = ((k >= radialCuts - 1) ? array[k] : array[k + 1]);
|
|
Vector2 vector3 = array2[k];
|
|
Vector2 vector4 = ((k >= radialCuts - 1) ? array2[k] : array2[k + 1]);
|
|
Vector3[] array5 = new Vector3[]
|
|
{
|
|
new Vector3(vector.x, vector.y, depth),
|
|
new Vector3(vector2.x, vector2.y, depth),
|
|
new Vector3(vector3.x, vector3.y, depth),
|
|
new Vector3(vector4.x, vector4.y, depth)
|
|
};
|
|
Vector3[] array6 = new Vector3[]
|
|
{
|
|
new Vector3(vector2.x, vector2.y, 0f),
|
|
new Vector3(vector.x, vector.y, 0f),
|
|
new Vector3(vector4.x, vector4.y, 0f),
|
|
new Vector3(vector3.x, vector3.y, 0f)
|
|
};
|
|
if (frontFaces)
|
|
{
|
|
list.AddRange(array5);
|
|
}
|
|
if (backFaces)
|
|
{
|
|
list.AddRange(array6);
|
|
}
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithPoints(list.ToArray());
|
|
pb_Object.gameObject.name = "Arch";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000207 RID: 519 RVA: 0x0001BEF4 File Offset: 0x0001A2F4
|
|
public static pb_Object IcosahedronGenerator(float radius, int subdivisions)
|
|
{
|
|
Vector3[] array = new Vector3[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES.Length];
|
|
for (int i = 0; i < pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES.Length; i += 3)
|
|
{
|
|
array[i] = pb_ShapeGenerator.ICOSAHEDRON_VERTICES[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES[i]].normalized * radius;
|
|
array[i + 1] = pb_ShapeGenerator.ICOSAHEDRON_VERTICES[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES[i + 1]].normalized * radius;
|
|
array[i + 2] = pb_ShapeGenerator.ICOSAHEDRON_VERTICES[pb_ShapeGenerator.ICOSAHEDRON_TRIANGLES[i + 2]].normalized * radius;
|
|
}
|
|
for (int j = 0; j < subdivisions; j++)
|
|
{
|
|
array = pb_ShapeGenerator.SubdivideIcosahedron(array, radius);
|
|
}
|
|
pb_Face[] array2 = new pb_Face[array.Length / 3];
|
|
for (int k = 0; k < array.Length; k += 3)
|
|
{
|
|
array2[k / 3] = new pb_Face(new int[]
|
|
{
|
|
k,
|
|
k + 1,
|
|
k + 2
|
|
});
|
|
array2[k / 3].manualUV = true;
|
|
}
|
|
GameObject gameObject = new GameObject();
|
|
pb_Object pb_Object = gameObject.AddComponent<pb_Object>();
|
|
pb_Object.SetVertices(array);
|
|
pb_Object.SetUV(new Vector2[array.Length]);
|
|
pb_Object.SetFaces(array2);
|
|
pb_IntArray[] array3 = new pb_IntArray[array.Length];
|
|
for (int l = 0; l < array3.Length; l++)
|
|
{
|
|
array3[l] = new pb_IntArray(new int[] { l });
|
|
}
|
|
pb_Object.SetSharedIndices(array3);
|
|
pb_Object.ToMesh();
|
|
pb_Object.Refresh(RefreshMask.All);
|
|
pb_Object.gameObject.name = "Icosphere";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x06000208 RID: 520 RVA: 0x0001C0AC File Offset: 0x0001A4AC
|
|
private static Vector3[] SubdivideIcosahedron(Vector3[] vertices, float radius)
|
|
{
|
|
Vector3[] array = new Vector3[vertices.Length * 4];
|
|
int num = 0;
|
|
Vector3 vector = Vector3.zero;
|
|
Vector3 vector2 = Vector3.zero;
|
|
Vector3 vector3 = Vector3.zero;
|
|
Vector3 vector4 = Vector3.zero;
|
|
Vector3 vector5 = Vector3.zero;
|
|
Vector3 vector6 = Vector3.zero;
|
|
for (int i = 0; i < vertices.Length; i += 3)
|
|
{
|
|
vector = vertices[i];
|
|
vector3 = vertices[i + 1];
|
|
vector6 = vertices[i + 2];
|
|
vector2 = ((vector + vector3) * 0.5f).normalized * radius;
|
|
vector4 = ((vector + vector6) * 0.5f).normalized * radius;
|
|
vector5 = ((vector3 + vector6) * 0.5f).normalized * radius;
|
|
array[num++] = vector;
|
|
array[num++] = vector2;
|
|
array[num++] = vector4;
|
|
array[num++] = vector2;
|
|
array[num++] = vector3;
|
|
array[num++] = vector5;
|
|
array[num++] = vector2;
|
|
array[num++] = vector5;
|
|
array[num++] = vector4;
|
|
array[num++] = vector4;
|
|
array[num++] = vector5;
|
|
array[num++] = vector6;
|
|
}
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x06000209 RID: 521 RVA: 0x0001C274 File Offset: 0x0001A674
|
|
private static Vector3[] CircleVertices(int segments, float radius, float circumference, Quaternion rotation, float offset)
|
|
{
|
|
float num = (float)segments - 1f;
|
|
Vector3[] array = new Vector3[(segments - 1) * 2];
|
|
array[0] = new Vector3(Mathf.Cos(0f / num * circumference * 0.017453292f) * radius, Mathf.Sin(0f / num * circumference * 0.017453292f) * radius, 0f);
|
|
array[1] = new Vector3(Mathf.Cos(1f / num * circumference * 0.017453292f) * radius, Mathf.Sin(1f / num * circumference * 0.017453292f) * radius, 0f);
|
|
array[0] = rotation * (array[0] + Vector3.right * offset);
|
|
array[1] = rotation * (array[1] + Vector3.right * offset);
|
|
int num2 = 2;
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
for (int i = 2; i < segments; i++)
|
|
{
|
|
float num3 = (float)i / num * circumference * 0.017453292f;
|
|
stringBuilder.AppendLine(num3.ToString());
|
|
array[num2] = array[num2 - 1];
|
|
array[num2 + 1] = rotation * (new Vector3(Mathf.Cos(num3) * radius, Mathf.Sin(num3) * radius, 0f) + Vector3.right * offset);
|
|
num2 += 2;
|
|
}
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x0600020A RID: 522 RVA: 0x0001C418 File Offset: 0x0001A818
|
|
public static pb_Object TorusGenerator(int InRows, int InColumns, float InRadius, float InTubeRadius, bool InSmooth, float InHorizontalCircumference, float InVerticalCircumference)
|
|
{
|
|
int num = Mathf.Clamp(InRows + 1, 4, 128);
|
|
int num2 = Mathf.Clamp(InColumns + 1, 4, 128);
|
|
float num3 = Mathf.Clamp(InRadius, 0.01f, 2048f);
|
|
float num4 = Mathf.Clamp(InTubeRadius, 0.01f, num3);
|
|
num3 -= num4;
|
|
float num5 = Mathf.Clamp(InHorizontalCircumference, 0.01f, 360f);
|
|
float num6 = Mathf.Clamp(InVerticalCircumference, 0.01f, 360f);
|
|
List<Vector3> list = new List<Vector3>();
|
|
int num7 = num2 - 1;
|
|
Vector3[] array = pb_ShapeGenerator.CircleVertices(num, num4, num6, Quaternion.Euler(Vector3.up * 0f * num5), num3);
|
|
for (int i = 1; i < num2; i++)
|
|
{
|
|
list.AddRange(array);
|
|
Quaternion quaternion = Quaternion.Euler(Vector3.up * ((float)i / (float)num7 * num5));
|
|
array = pb_ShapeGenerator.CircleVertices(num, num4, num6, quaternion, num3);
|
|
list.AddRange(array);
|
|
}
|
|
List<pb_Face> list2 = new List<pb_Face>();
|
|
int num8 = 0;
|
|
for (int j = 0; j < (num2 - 1) * 2; j += 2)
|
|
{
|
|
for (int k = 0; k < num - 1; k++)
|
|
{
|
|
int num9 = j * ((num - 1) * 2) + k * 2;
|
|
int num10 = (j + 1) * ((num - 1) * 2) + k * 2;
|
|
int num11 = j * ((num - 1) * 2) + k * 2 + 1;
|
|
int num12 = (j + 1) * ((num - 1) * 2) + k * 2 + 1;
|
|
list2.Add(new pb_Face(new int[] { num9, num10, num11, num10, num12, num11 }));
|
|
list2[num8].smoothingGroup = ((!InSmooth) ? (-1) : 1);
|
|
list2[num8].manualUV = true;
|
|
num8++;
|
|
}
|
|
}
|
|
pb_Object pb_Object = pb_Object.CreateInstanceWithVerticesFaces(list.ToArray(), list2.ToArray());
|
|
pb_Object.gameObject.name = "Torus";
|
|
return pb_Object;
|
|
}
|
|
|
|
// Token: 0x04000174 RID: 372
|
|
private static readonly Vector3[] ICOSAHEDRON_VERTICES = new Vector3[]
|
|
{
|
|
new Vector3(-1f, 1.618034f, 0f),
|
|
new Vector3(1f, 1.618034f, 0f),
|
|
new Vector3(-1f, -1.618034f, 0f),
|
|
new Vector3(1f, -1.618034f, 0f),
|
|
new Vector3(0f, -1f, 1.618034f),
|
|
new Vector3(0f, 1f, 1.618034f),
|
|
new Vector3(0f, -1f, -1.618034f),
|
|
new Vector3(0f, 1f, -1.618034f),
|
|
new Vector3(1.618034f, 0f, -1f),
|
|
new Vector3(1.618034f, 0f, 1f),
|
|
new Vector3(-1.618034f, 0f, -1f),
|
|
new Vector3(-1.618034f, 0f, 1f)
|
|
};
|
|
|
|
// Token: 0x04000175 RID: 373
|
|
private static readonly int[] ICOSAHEDRON_TRIANGLES = new int[]
|
|
{
|
|
0, 11, 5, 0, 5, 1, 0, 1, 7, 0,
|
|
7, 10, 0, 10, 11, 1, 5, 9, 5, 11,
|
|
4, 11, 10, 2, 10, 7, 6, 7, 1, 8,
|
|
3, 9, 4, 3, 4, 2, 3, 2, 6, 3,
|
|
6, 8, 3, 8, 9, 4, 9, 5, 2, 4,
|
|
11, 6, 2, 10, 8, 6, 7, 9, 8, 1
|
|
};
|
|
}
|
|
}
|