Package info.ata4.unity.util

Examples of info.ata4.unity.util.UnityVersion


                    if ((stream.channelMask.longValue() & 1 << j) == 0) {
                        continue;
                    }
                   
                    boolean half = false;
                    ChannelInfo channel = null;

                    // channels may not be available in older versions
                    if (!channels.isEmpty()) {
                        channel = channels.get(j);
                        half = channel.format == 1;
View Full Code Here


            triangles.add(subMeshTriangles);
        }
    }

    private void readCompressedMesh() throws IOException {
        CompressedMesh cmesh = mesh.compressedMesh;

        float[] vertexFloats = readPackedFloats(cmesh.vertices);
        for (int i = 0; i < vertexFloats.length / 3; i++) {
            Vector3f v = new Vector3f();
            v.x = vertexFloats[i * 3];
 
View Full Code Here

    }
   
    @Override
    public void extract(UnityObject obj) throws IOException {
        // unpack the mesh
        MeshData meshData = new MeshData(new Mesh(obj));
       
        // choose a mesh writer
        MeshWriter meshWriter;
       
        switch (format) {
View Full Code Here

        super(handler);
    }
   
    @Override
    void write(MeshData meshData) throws IOException {
        Mesh mesh = meshData.getMesh();

        List<Vector3f> vertices = meshData.getVertices();
        List<Vector3f> normals = meshData.getNormals();
        List<Vector2f> uv1 = meshData.getUV1();
        List<Vector2f> uv2 = meshData.getUV2();
View Full Code Here

        super(handler);
    }
   
    @Override
    public void write(MeshData meshData) throws IOException {
        Mesh mesh = meshData.getMesh();
       
        vns = meshData.getNormals();
        vts = meshData.getUV1();
       
        // use second layer if the first one is unused
View Full Code Here

        // PLY can't have more than one mesh per file, so write one file per
        // sub-mesh
        final int subMeshCount = mesh.subMeshes.size();
        final int vertsPerFace = 3;
        for (int i = 0; i < subMeshCount; i++) {
            SubMesh subMesh = mesh.subMeshes.get(i);
           
            // use prefix if there's more than one submesh
            String name = mesh.name;
            if (subMeshCount > 1) {
                name = String.format("%s_%d", name, i);
View Full Code Here

        assert !bb.hasRemaining();
    }
   
    private void convertToRGBA32() {
        ByteBuffer imageBuffer = tex.imageBuffer;
        TextureFormat tf = tex.textureFormat;
       
        if (tf == RGBA32 || tf == ARGB32) {
            // convert ARGB and RGBA directly by swapping the bytes to get BGRA
            byte[] pixelOld = new byte[4];
            byte[] pixelNew = new byte[4];
View Full Code Here

        assert !bb.hasRemaining();
    }
   
    private void convertToRGBA32() {
        ByteBuffer imageBuffer = tex.imageBuffer;
        TextureFormat tf = tex.textureFormat;
       
        if (tf == RGBA32 || tf == ARGB32) {
            // convert ARGB and RGBA directly by swapping the bytes to get BGRA
            byte[] pixelOld = new byte[4];
            byte[] pixelNew = new byte[4];
View Full Code Here

                                in.skipBytes(2); // padding?
                            }
                            break;

                        case CHANNEL_COLORS:
                            Color32 c = new Color32();
                            c.read(in);
                            colors.add(c);
                            break;

                        case CHANNEL_UV1:
                        case CHANNEL_UV2:
View Full Code Here

            }
        }

        int[] colorInts = readPackedBits(cmesh.colors);
        for (int i = 0; i < colorInts.length; i++) {
            Color32 c = new Color32();
            c.fromInt(colorInts[i]);
            colors.add(c);
        }
       
        // TODO: works for triangulated meshes only!
        int[] triangleInts = readPackedBits(cmesh.triangles);
View Full Code Here

TOP

Related Classes of info.ata4.unity.util.UnityVersion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.