Package javax.vecmath

Examples of javax.vecmath.Vector3f.dot()


/* 165 */     if ((xAxis == null) || (sourceToHead == null))
/*     */     {
/* 168 */       return -1.0D;
/*     */     }
/*     */
/* 172 */     double dotProduct = sourceToHead.dot(xAxis) / (sourceToHead.length() * xAxis.length());
/*     */
/* 177 */     double theta = (float)Math.acos(dotProduct);
/*     */
/* 184 */     double minPlusMax = min + max;
/* 185 */     double tangent = Math.tan(theta);
View Full Code Here


                        expectedMove.sub(position);
                        extractResidualMovement(callback.getHitNormalWorld(), expectedMove);
                        float sqrDist = expectedMove.lengthSquared();
                        if (sqrDist > physics.getEpsilon()) {
                            expectedMove.normalize();
                            if (expectedMove.dot(normalizedDir) <= 0.0f) {
                                hit = true;
                                break;
                            }
                        } else {
                            hit = true;
View Full Code Here

    // TODO: This doesn't belong in this class, move it.
    public static Side getSecondaryPlacementDirection(Vector3f direction, Vector3f normal) {
        Side surfaceDir = Side.inDirection(normal);
        Vector3f attachDir = surfaceDir.reverse().getVector3i().toVector3f();
        Vector3f rawDirection = new Vector3f(direction);
        float dot = rawDirection.dot(attachDir);
        rawDirection.sub(new Vector3f(dot * attachDir.x, dot * attachDir.y, dot * attachDir.z));
        return Side.inDirection(rawDirection.x, rawDirection.y, rawDirection.z).reverse();
    }

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