コード例 #1
0
    public static RenderGeometry CreateCubeStarGeometry(float size, float extrusion = 1, float cutTop = 0)
    {
        float extrusionScale = Mathf.Sqrt(2f) / 2;

        return(CreateCubeGeometryInternal(
                   size * Vector3.one, dim => SurfaceComponentGeometries.CreateExtrudedPolygonCapGeometry(1, extrusion * extrusionScale, 4, 1, cutTop, dim, RenderGeometry.FaceType.Polygonal, true)));
    }
コード例 #2
0
    public static RenderGeometry CreateDodecahedronStarGeometry(float size, float extrusion, float cutTop)
    {
        int   currentGroup   = 0;
        float extrusionScale = Mathf.Sqrt(3) * (Mathf.Sqrt(5) + 1) / 4;

        return(CreateDodecahedronGeometryInternal(
                   size, () => SurfaceComponentGeometries.CreateExtrudedPolygonCapGeometry(1, extrusion * extrusionScale, 5, 1, cutTop, currentGroup++, RenderGeometry.FaceType.Polygonal, true)));
    }