Package toxi.geom

Examples of toxi.geom.Vec2D.scale()


                if (v > 0 && u > 0) {
                    mesh.addFace(curr[v - 1], vert, prev[v - 1],
                            dUV.scale(u, v - 1), dUV.scale(u, v),
                            dUV.scale(u - 1, v - 1));
                    mesh.addFace(vert, prev[v], prev[v - 1], dUV.scale(u, v),
                            dUV.scale(u - 1, v), dUV.scale(u - 1, v - 1));
                }
                curr[v] = vert;
            }
            prev = curr;
            if (u == 0) {
View Full Code Here


                if (v > 0 && u > 0) {
                    mesh.addFace(curr[v - 1], vert, prev[v - 1],
                            dUV.scale(u, v - 1), dUV.scale(u, v),
                            dUV.scale(u - 1, v - 1));
                    mesh.addFace(vert, prev[v], prev[v - 1], dUV.scale(u, v),
                            dUV.scale(u - 1, v), dUV.scale(u - 1, v - 1));
                }
                curr[v] = vert;
            }
            prev = curr;
            if (u == 0) {
View Full Code Here

        // add minute offset to avoid div-by-zero errors
        float dist = delta.magnitude() + EPS;
        float normDistStrength = (dist - restLength)
                / (dist * (a.invWeight + b.invWeight)) * strength;
        if (!a.isLocked && !isALocked) {
            a.addSelf(delta.scale(normDistStrength * a.invWeight).limit(limit));
            if (applyConstraints) {
                a.applyConstraints();
            }
        }
        if (!b.isLocked && !isBLocked) {
View Full Code Here

            if (applyConstraints) {
                a.applyConstraints();
            }
        }
        if (!b.isLocked && !isBLocked) {
            b.subSelf(delta.scale(normDistStrength * b.invWeight).limit(limit));
            if (applyConstraints) {
                b.applyConstraints();
            }
        }
    }
View Full Code Here

        // add minute offset to avoid div-by-zero errors
        float dist = delta.magnitude() + EPS;
        float normDistStrength = (dist - restLength)
                / (dist * (a.invWeight + b.invWeight)) * strength;
        if (!a.isLocked && !isALocked) {
            a.addSelf(delta.scale(normDistStrength * a.invWeight));
            if (applyConstraints) {
                a.applyConstraints();
            }
        }
        if (!b.isLocked && !isBLocked) {
View Full Code Here

            if (applyConstraints) {
                a.applyConstraints();
            }
        }
        if (!b.isLocked && !isBLocked) {
            b.addSelf(delta.scale(-normDistStrength * b.invWeight));
            if (applyConstraints) {
                b.applyConstraints();
            }
        }
    }
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.