Examples of addSelf()


Examples of toxi.geom.Vec3D.addSelf()

      //   intersect.
      intersect.rotateX(-GLOBAL.rotateModelsX);
      intersect.rotateY(-GLOBAL.rotateModelsY);

      intersect.addSelf(focusCentre);

      //intersect.x += (GLOBAL.CAM_OFFSET_X*GLOBAL.getZOOM());
      //intersect.y += GLOBAL.CAM_OFFSET_Y;

      //intersect.rotateAroundAxis(axis, theta)
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

  public Vec3D getCentre() {
    Vec3D centre = new Vec3D();

    for (SlicePlane plane : this.getList()) {
      centre.addSelf(plane.getPlane());
    }
    centre.scaleSelf(1 / this.getList().size());

    return centre;
  }
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

    Vec3D centre = new Vec3D();
    int planeCount = 0;
    for (int i = 0; i < this.getSlicePlanesY().size(); i++) {
      SlicePlane slicePlane = this.getSlicePlanesY().get(i);
      if (slicePlane.getCentreOfMass() != null) {
        centre.addSelf(slicePlane.getCentreOfMass());
        planeCount++;
      }
    }

    centre.x /= planeCount;
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

    // returnVec.rotateX(this.plane.x);
    // returnVec.rotateY(this.plane.y);
    // returnVec.rotateZ(this.plane.z);

    returnVec.addSelf(this.getPlane());
    return returnVec;

  }

  public Vec3D getWorldPosIntersect(Vec3D vec) {
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

        final float sinStart = (float) Math.sin(thetaStart);
        final float cosStart = (float) Math.cos(thetaStart);
        tmp.set(o.xAxis).scaleSelf(r * cosStart);
        Vec3D p0 = new Vec3D(o.origin).addSelf(tmp);
        tmp.set(o.yAxis).scaleSelf(r * sinStart);
        p0.addSelf(tmp);

        tmp.set(o.yAxis).scaleSelf(cosStart);
        Vec3D t0 = new Vec3D(o.xAxis).scaleSelf(-sinStart).addSelf(tmp);

        Vec4D[] cps = new Vec4D[n + 1];
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

            cps[index + 2] = new Vec4D(p2, 1);

            t2.set(o.xAxis).scaleSelf((float) -sin);
            tmp.set(o.yAxis).scaleSelf((float) cos);
            t2.addSelf(tmp);

            lineIntersect3D(p0, t0, p2, t2, p1, p1);

            cps[index + 1] = new Vec4D(p1, (float) w1);
            index += 2;
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

            }
            intersectRay.set(prev);
            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)));
            }
        }
    }
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

        for (int k = 0; k <= grade; k++) {
            Vec3D d = new Vec3D();
            for (int j = 0; j <= degree; j++) {
                Vec4D v = cpoly[(span - degree) + j];
                float s = derivVals[k][j];
                d.addSelf(v.x * s, v.y * s, v.z * s);
            }
            derivs[k] = d;
        }
        return derivs;
    }
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

    @Override
    public List<Vec3D> computeSplitPoints(WingedEdge edge) {
        Vec3D mid = edge.getMidPoint();
        Vec3D n = edge.faces.get(0).normal;
        if (edge.faces.size() > 1) {
            n.addSelf(edge.faces.get(1).normal);
        }
        n.normalizeTo(amp * edge.getLength());
        List<Vec3D> points = new ArrayList<Vec3D>(3);
        points.add(mid.addSelf(n));
        return points;
View Full Code Here

Examples of toxi.geom.Vec3D.addSelf()

    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
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.