Package javax.vecmath

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


  }

  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

      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

  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

    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

   */
  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

  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

   
    return needsClip;
  }

  private void clipEdge(int v1, int v2) {
    Vector4f vtx1 = vertices[v1];
    Vector4f vtx2 = vertices[v2];
   
    Color3f c1 = colors[v1];
    Color3f c2 = colors[v2];
   
    float minZ = 0f;
View Full Code Here

  }

  @Override
  public void getPlane(Vector3f planeNormal, Vector3f planeSupport, int i) {
    // this plane might not be aligned...
    Vector4f plane = Stack.alloc(Vector4f.class);
    getPlaneEquation(plane, i);
    planeNormal.set(plane.x, plane.y, plane.z);
    Vector3f tmp = Stack.alloc(Vector3f.class);
    tmp.negate(planeNormal);
    localGetSupportingVertex(tmp, planeSupport);
View Full Code Here

public class GeometryUtil {

  public static boolean isPointInsidePlanes(ObjectArrayList<Vector4f> planeEquations, Vector3f point, float margin) {
    int numbrushes = planeEquations.size();
    for (int i = 0; i < numbrushes; i++) {
      Vector4f N1 = planeEquations.getQuick(i);
      float dist = VectorUtil.dot3(N1, point) + N1.w - margin;
      if (dist > 0f) {
        return false;
      }
    }
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector4f

Copyright © 2018 www.massapicom. 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.