Exemplo n.º 1
0
        public static bool GenerateHemisphereVertices(CSGHemisphereDefinition definition, ref Vector3[] vertices)
        {
            definition.Validate();
            var transform = Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(definition.rotation, Vector3.up), Vector3.one);

            return(GenerateHemisphereVertices(definition.diameterXYZ, transform, definition.horizontalSegments, definition.verticalSegments, ref vertices));
        }
Exemplo n.º 2
0
        public static bool GenerateHemisphereSubMesh(CSGBrushSubMesh subMesh, CSGHemisphereDefinition definition)
        {
            definition.Validate();
            var transform = Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(definition.rotation, Vector3.up), Vector3.one);

            return(GenerateHemisphereSubMesh(subMesh, definition.diameterXYZ, transform, definition.horizontalSegments, definition.verticalSegments, definition.surfaceAssets, definition.surfaceDescriptions));
        }
Exemplo n.º 3
0
        public static bool GenerateHemisphereAsset(CSGBrushMeshAsset brushMeshAsset, CSGHemisphereDefinition definition)
        {
            var subMesh = new CSGBrushSubMesh();

            if (!GenerateHemisphereSubMesh(subMesh, definition))
            {
                brushMeshAsset.Clear();
                return(false);
            }

            brushMeshAsset.SubMeshes = new[] { subMesh };
            brushMeshAsset.CalculatePlanes();
            brushMeshAsset.SetDirty();
            return(true);
        }