remove new float[]

This commit is contained in:
ikpil 2023-04-13 00:09:56 +09:00
parent c388e8087b
commit d3d0d80824
1 changed files with 3 additions and 4 deletions

View File

@ -11,16 +11,15 @@ public class CylinderGizmo : ColliderGizmo
{ {
private readonly float[] vertices; private readonly float[] vertices;
private readonly int[] triangles; private readonly int[] triangles;
private readonly float[] center; private readonly Vector3f center;
private readonly float[] gradient; private readonly float[] gradient;
public CylinderGizmo(Vector3f start, Vector3f end, float radius) public CylinderGizmo(Vector3f start, Vector3f end, float radius)
{ {
center = new float[] center = Vector3f.Of(
{
0.5f * (start[0] + end[0]), 0.5f * (start[1] + end[1]), 0.5f * (start[0] + end[0]), 0.5f * (start[1] + end[1]),
0.5f * (start[2] + end[2]) 0.5f * (start[2] + end[2])
}; );
Vector3f axis = Vector3f.Of(end[0] - start[0], end[1] - start[1], end[2] - start[2]); Vector3f axis = Vector3f.Of(end[0] - start[0], end[1] - start[1], end[2] - start[2]);
Vector3f[] normals = new Vector3f[3]; Vector3f[] normals = new Vector3f[3];
normals[1] = Vector3f.Of(end[0] - start[0], end[1] - start[1], end[2] - start[2]); normals[1] = Vector3f.Of(end[0] - start[0], end[1] - start[1], end[2] - start[2]);