Examples of Vector4f


Examples of javax.vecmath.Vector4f

     * texture generation modes.
     * @param planeR plane equation for the R coordinate
     */
    final void setPlaneR(Vector4f planeR) {
  initPlaneR(planeR);
  sendMessage(PLANE_R_CHANGED, new Vector4f(planeR));
    }
View Full Code Here

Examples of javax.vecmath.Vector4f

     * texture generation modes.
     * @param planeQ plane equation for the Q coordinate
     */
    final void setPlaneQ(Vector4f planeQ) {
  initPlaneQ(planeQ);
  sendMessage(PLANE_Q_CHANGED, new Vector4f(planeQ));
    }
View Full Code Here

Examples of javax.vecmath.Vector4f

    }

    @Override
    protected Object clone() {
  TexCoordGenerationRetained tr = (TexCoordGenerationRetained)super.clone();
  tr.planeS = new Vector4f(planeS);
  tr.planeT = new Vector4f(planeT);
  tr.planeR = new Vector4f(planeR);
  // other attributes is copied in super.clone()
  return tr;

    }
View Full Code Here

Examples of javax.vecmath.Vector4f

  TexCoordGenerationRetained tex = (TexCoordGenerationRetained)
      originalNodeComponent.retained;
  TexCoordGenerationRetained rt = (TexCoordGenerationRetained) retained;

  Vector4f v = new Vector4f();

  rt.initGenMode(tex.getGenMode());
  tex.getPlaneS(v);
  rt.initPlaneS(v);
  tex.getPlaneT(v);
View Full Code Here

Examples of javax.vecmath.Vector4f

  }

  public boolean overlap_test_conservative(TriangleShapeEx other) {
    float total_margin = getMargin() + other.getMargin();

    Vector4f plane0 = Stack.alloc(Vector4f.class);
    buildTriPlane(plane0);
    Vector4f plane1 = Stack.alloc(Vector4f.class);
    other.buildTriPlane(plane1);

    // classify points on other triangle
    float dis0 = ClipPolygon.distance_point_plane(plane0, other.vertices1[0]) - total_margin;
View Full Code Here

Examples of javax.vecmath.Vector4f

      Vector3f cross = Stack.alloc(Vector3f.class);
      cross.cross(a3, b3);
      res3 = cross.lengthSquared();
    }

    Vector4f maxvec = Stack.alloc(Vector4f.class);
    maxvec.set(res0, res1, res2, res3);
    int biggestarea = VectorUtil.closestAxis4(maxvec);
    return biggestarea;
  }
View Full Code Here

Examples of javax.vecmath.Vector4f

  protected void gimpacttrimeshpart_vs_plane_collision(CollisionObject body0, CollisionObject body1, GImpactMeshShapePart shape0, StaticPlaneShape shape1, boolean swapped) {
    Transform orgtrans0 = body0.getWorldTransform(Stack.alloc(Transform.class));
    Transform orgtrans1 = body1.getWorldTransform(Stack.alloc(Transform.class));

    StaticPlaneShape planeshape = shape1;
    Vector4f plane = Stack.alloc(Vector4f.class);
    PlaneShape.get_plane_equation_transformed(planeshape, orgtrans1, plane);

    // test box against plane

    AABB tribox = Stack.alloc(AABB.class);
View Full Code Here

Examples of javax.vecmath.Vector4f

    Vector3f N = Stack.alloc(Vector3f.class);
    N.cross(AD, BD);
    float[] tp = new float[] { N.lengthSquared() };

    Vector4f _M = Stack.alloc(Vector4f.class);//plane

    if (tp[0] < BulletGlobals.SIMD_EPSILON)//ARE PARALELE
    {
      // project B over A
      boolean invert_b_order = false;
      _M.x = vB1.dot(AD);
      _M.y = vB2.dot(AD);

      if (_M.x > _M.y) {
        invert_b_order = true;
        //BT_SWAP_NUMBERS(_M[0],_M[1]);
        _M.x = _M.x + _M.y;
        _M.y = _M.x - _M.y;
        _M.x = _M.x - _M.y;
      }
      _M.z = vA1.dot(AD);
      _M.w = vA2.dot(AD);
      // mid points
      N.x = (_M.x + _M.y) * 0.5f;
      N.y = (_M.z + _M.w) * 0.5f;

      if (N.x < N.y) {
        if (_M.y < _M.z) {
          vPointB = invert_b_order ? vB1 : vB2;
          vPointA = vA1;
        }
        else if (_M.y < _M.w) {
          vPointB = invert_b_order ? vB1 : vB2;
          closest_point_on_segment(vPointA, vPointB, vA1, vA2);
        }
        else {
          vPointA = vA2;
          closest_point_on_segment(vPointB, vPointA, vB1, vB2);
        }
      }
      else {
        if (_M.w < _M.x) {
          vPointB = invert_b_order ? vB2 : vB1;
          vPointA = vA2;
        }
        else if (_M.w < _M.y) {
          vPointA = vA2;
          closest_point_on_segment(vPointB, vPointA, vB1, vB2);
        }
        else {
          vPointB = invert_b_order ? vB1 : vB2;
          closest_point_on_segment(vPointA, vPointB, vA1, vA2);
        }
      }
      return;
    }

    N.cross(N, BD);
    _M.set(N.x, N.y, N.z, vB1.dot(N));

    // get point A as the plane collision point
    line_plane_collision(_M, AD, vA1, vPointA, tp, 0f, 1f);

    /*Closest point on segment*/
 
View Full Code Here

Examples of javax.vecmath.Vector4f

   */
  public int clip_triangle(PrimitiveTriangle other, ObjectArrayList<Vector3f> clipped_points) {
    // edge 0
    ObjectArrayList<Vector3f> temp_points = tmpVecList1;

    Vector4f edgeplane = Stack.alloc(Vector4f.class);

    get_edge_plane(0, edgeplane);

    int clipped_count = ClipPolygon.plane_clip_triangle(edgeplane, other.vertices[0], other.vertices[1], other.vertices[2], temp_points);

View Full Code Here

Examples of javax.vecmath.Vector4f

  private Vector3f origColor = new Vector3f();
  private Vector3f tmpVec3 = new Vector3f();
  private Vector3f[] lightResult = new Vector3f[lights.length];

  public Graphics3D() {
    for (int i=0; i<vertices.length; i++) vertices[i] = new Vector4f();
    for (int i=0; i<normals.length; i++) normals[i] = new Vector3f();
    for (int i=0; i<colors.length; i++) colors[i] = new Color3f();

    for (int i=0; i<clippedVertices.length; i++) clippedVertices[i] = new Vector4f();
    for (int i=0; i<clippedColors.length; i++) clippedColors[i] = new Color3f();
   
    viewMatrix.setIdentity();
   
    for (int i=0; i<viewMatStack.length; i++) viewMatStack[i] = new Matrix4f();
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.