Sha256: 4f283e3ea66a93cd6d969f2b3749c5578582995210cdca3162f2381491a79e7e

Contents?: true

Size: 1.11 KB

Versions: 11

Compression:

Stored size: 1.11 KB

Contents

package toxi.newmesh;

import toxi.geom.Vec3D;
import toxi.util.datatypes.ItemIndex;

/**
 *
 * @author tux
 */
public class MeshVertexNormalCompiler extends MeshAttributeCompiler {

    /**
     *
     * @param f
     * @param index
     * @param buf
     * @param offset
     */
    @Override
    public void compileFace(AttributedFace f, ItemIndex<?> index, float[] buf,
            int offset) {
        int[] vn = f.attribs.get(IndexedTriangleMesh.ATTR_VNORMALS);
        Vec3D v = (Vec3D) index.forID(vn[0]);
        buf[offset++] = v.x;
        buf[offset++] = v.y;
        buf[offset++] = v.z;
        v = (Vec3D) index.forID(vn[1]);
        buf[offset++] = v.x;
        buf[offset++] = v.y;
        buf[offset++] = v.z;
        v = (Vec3D) index.forID(vn[2]);
        buf[offset++] = v.x;
        buf[offset++] = v.y;
        buf[offset++] = v.z;
    }

    /**
     *
     * @return
     */
    @Override
    public ItemIndex<?> getIndex() {
        return mesh.attributes.get(IndexedTriangleMesh.ATTR_VNORMALS);
    }

    /**
     *
     * @return
     */
    @Override
    public int getStride() {
        return 3;
    }

}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
toxiclibs-2.1.0 src/main/java/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-2.0.0 src/main/java/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-1.0.0 src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.9.3 src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.9.2 src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.9.1 src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.9.0 src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.8.0 src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.6.0-java src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.5.1-java src/toxi/newmesh/MeshVertexNormalCompiler.java
toxiclibs-0.5.0-java src/toxi/newmesh/MeshVertexNormalCompiler.java