Package toxi.geom

Examples of toxi.geom.Vec3D.sub()


            intersectRay.setDirection(dir);
            Vec3D isec = box.intersectsRay(intersectRay, 0, Float.MAX_VALUE);
            if (isec != null) {
                isec.addSelf(box.getNormalForPoint(isec).scaleSelf(0.01f));
                p.setPreviousPosition(isec);
                p.set(isec.sub(dir.scaleSelf(restitution)));
            }
        }
    }

    public AABB getBox() {
View Full Code Here


    public List<Vec3D> computeSplitPoints(WingedEdge edge) {
        List<Vec3D> mid = new ArrayList<Vec3D>(2);
        float len = edge.getLength();
        Vec3D a = edge.a.interpolateTo(edge.b, 0.3333f);
        a.addSelf(a.sub(centroid).normalizeTo(ampA * len));
        Vec3D b = edge.a.interpolateTo(edge.b, 0.6666f);
        b.addSelf(b.sub(centroid).normalizeTo(ampB * len));
        mid.add(a);
        mid.add(b);
        return mid;
View Full Code Here

        List<Vec3D> mid = new ArrayList<Vec3D>(2);
        float len = edge.getLength();
        Vec3D a = edge.a.interpolateTo(edge.b, 0.3333f);
        a.addSelf(a.sub(centroid).normalizeTo(ampA * len));
        Vec3D b = edge.a.interpolateTo(edge.b, 0.6666f);
        b.addSelf(b.sub(centroid).normalizeTo(ampB * len));
        mid.add(a);
        mid.add(b);
        return mid;
    }
}
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.