Package com.ardor3d.util

Examples of com.ardor3d.util.LittleEndianRandomAccessDataInput.seek()


                throw new Ardor3dException("Invalid file version (Version not 8)!");
            }

            // Parse out texture names
            final String[] texNames = new String[header.numSkins];
            bis.seek(header.offsetSkins);
            for (int i = 0; i < header.numSkins; i++) {
                texNames[i] = bis.readString(64);
            }

            // Parse out tex coords
View Full Code Here


                texNames[i] = bis.readString(64);
            }

            // Parse out tex coords
            final float[] texCoords = new float[2 * header.numTexCoords];
            bis.seek(header.offsetTexCoords);
            final float inverseWidth = 1f / header.skinWidth;
            final float inverseHeight = 1f / header.skinHeight;
            for (int i = 0; i < header.numTexCoords; i++) {
                texCoords[i * 2 + 0] = bis.readShort() * inverseWidth;
                texCoords[i * 2 + 1] = bis.readShort() * inverseHeight;
 
View Full Code Here

                texCoords[i * 2 + 1] = bis.readShort() * inverseHeight;
            }

            // Parse out triangles
            final short[] triangles = new short[header.numTriangles * 6];
            bis.seek(header.offsetTriangles);
            for (int i = 0; i < header.numTriangles; i++) {
                triangles[i * 6 + 0] = bis.readShort(); // vert index 0
                triangles[i * 6 + 1] = bis.readShort(); // vert index 1
                triangles[i * 6 + 2] = bis.readShort(); // vert index 2
                triangles[i * 6 + 3] = bis.readShort(); // texcoord index 0
View Full Code Here

                triangles[i * 6 + 5] = bis.readShort(); // texcoord index 2
            }

            // Parse out gl commands
            final Md2GlCommand[] commands = new Md2GlCommand[header.numGlCommands];
            bis.seek(header.offsetGlCommands);
            int length, absLength;
            Md2GlCommand cmd;
            final List<Integer> fanIndices = Lists.newArrayList();
            final List<Integer> stripIndices = Lists.newArrayList();
            for (int i = 0; i < header.numGlCommands; i++) {
View Full Code Here

                }
            }

            // Parse out frames
            final Md2Frame[] frames = new Md2Frame[header.numFrames];
            bis.seek(header.offsetFrames);
            final Vector3 scale = new Vector3();
            final Vector3 translate = new Vector3();
            for (int i = 0; i < header.numFrames; i++) {
                scale.set(bis.readFloat(), bis.readFloat(), bis.readFloat());
                translate.set(bis.readFloat(), bis.readFloat(), bis.readFloat());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.