Package javax.vecmath

Examples of javax.vecmath.Vector3f.scale()


          tmp3.scale(b.z, features[0][2]);
          VectorUtil.add(nearest[0], tmp1, tmp2, tmp3);

          tmp1.scale(b.x, features[1][0]);
          tmp2.scale(b.y, features[1][1]);
          tmp3.scale(b.z, features[1][2]);
          VectorUtil.add(nearest[1], tmp1, tmp2, tmp3);
        }
        else {
          failed = true;
        }
View Full Code Here


    if (lenSqr < 0.0001f) {
      vec.set(1f, 0f, 0f);
    }
    else {
      float rlen = 1f / (float) Math.sqrt(lenSqr);
      vec.scale(rlen);
    }

    Vector3f vtx = Stack.alloc(Vector3f.class);
    float newDot;
View Full Code Here

  @Override
  public void getAabbSlow(Transform t, Vector3f aabbMin, Vector3f aabbMax) {
    childConvexShape.getAabbSlow(t, aabbMin, aabbMax);
    Vector3f aabbCenter = Stack.alloc(Vector3f.class);
    aabbCenter.add(aabbMax, aabbMin);
    aabbCenter.scale(0.5f);

    Vector3f scaledAabbHalfExtends = Stack.alloc(Vector3f.class);
    scaledAabbHalfExtends.sub(aabbMax, aabbMin);
    scaledAabbHalfExtends.scale(0.5f * uniformScalingFactor);

 
View Full Code Here

    aabbCenter.add(aabbMax, aabbMin);
    aabbCenter.scale(0.5f);

    Vector3f scaledAabbHalfExtends = Stack.alloc(Vector3f.class);
    scaledAabbHalfExtends.sub(aabbMax, aabbMin);
    scaledAabbHalfExtends.scale(0.5f * uniformScalingFactor);

    aabbMin.sub(aabbCenter, scaledAabbHalfExtends);
    aabbMax.add(aabbCenter, scaledAabbHalfExtends);
  }

View Full Code Here

  @Override
  public void getAabb(Transform t, Vector3f aabbMin, Vector3f aabbMax) {
    childConvexShape.getAabb(t, aabbMin, aabbMax);
    Vector3f aabbCenter = Stack.alloc(Vector3f.class);
    aabbCenter.add(aabbMax, aabbMin);
    aabbCenter.scale(0.5f);

    Vector3f scaledAabbHalfExtends = Stack.alloc(Vector3f.class);
    scaledAabbHalfExtends.sub(aabbMax, aabbMin);
    scaledAabbHalfExtends.scale(0.5f * uniformScalingFactor);

 
View Full Code Here

    aabbCenter.add(aabbMax, aabbMin);
    aabbCenter.scale(0.5f);

    Vector3f scaledAabbHalfExtends = Stack.alloc(Vector3f.class);
    scaledAabbHalfExtends.sub(aabbMax, aabbMin);
    scaledAabbHalfExtends.scale(0.5f * uniformScalingFactor);

    aabbMin.sub(aabbCenter, scaledAabbHalfExtends);
    aabbMax.add(aabbCenter, scaledAabbHalfExtends);
  }

View Full Code Here

    Vector3f tmp1 = Stack.alloc(Vector3f.class);
    Vector3f tmp2 = Stack.alloc(Vector3f.class);

    tmp1.scale(v, ab);
    tmp2.scale(w, ac);
    VectorUtil.add(result.closestPointOnSimplex, a, tmp1, tmp2);
    result.usedVertices.usedVertexA = true;
    result.usedVertices.usedVertexB = true;
    result.usedVertices.usedVertexC = true;
    result.setBarycentricCoordinates(1f-v-w, v, w, 0f);
View Full Code Here

           
            Vector3f pt0 = vectorsPool.get();
            pt0.scaleAdd(vecLen, vec0, planeOrigin);

            Vector3f pt1 = vectorsPool.get();
            pt1.scale(vecLen, vec0);
            pt1.sub(planeOrigin, pt1);

            Vector3f pt2 = vectorsPool.get();
            pt2.scaleAdd(vecLen, vec1, planeOrigin);
View Full Code Here

            Vector3f pt2 = vectorsPool.get();
            pt2.scaleAdd(vecLen, vec1, planeOrigin);

            Vector3f pt3 = vectorsPool.get();
            pt3.scale(vecLen, vec1);
            pt3.sub(planeOrigin, pt3);
           
            gl.glBegin(gl.GL_LINES);
            gl.glVertex3f(pt0.x,pt0.y,pt0.z);
            gl.glVertex3f(pt1.x,pt1.y,pt1.z);
View Full Code Here

      RigidBody body = this.localCreateRigidBody(mass, startTransform, shootBoxShape);

      Vector3f linVel = new Vector3f(destination.x - camPos.x, destination.y - camPos.y, destination.z - camPos.z);
      linVel.normalize();
      linVel.scale(ShootBoxInitialSpeed);

      Transform worldTrans = body.getWorldTransform(new Transform());
      worldTrans.origin.set(camPos);
      worldTrans.setRotation(new Quat4f(0f, 0f, 0f, 1f));
      body.setWorldTransform(worldTrans);
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.