Package com.ardor3d.math

Examples of com.ardor3d.math.Vector3.dot()


            return false;
        }

        rayDir.cross(diff, wCrossD);

        fAWxDdU[0] = Math.abs(wCrossD.dot(_xAxis));
        rhs = _extent.getY() * fAWdU[2] + _extent.getZ() * fAWdU[1];
        if (fAWxDdU[0] > rhs) {
            return false;
        }

View Full Code Here


        rhs = _extent.getY() * fAWdU[2] + _extent.getZ() * fAWdU[1];
        if (fAWxDdU[0] > rhs) {
            return false;
        }

        fAWxDdU[1] = Math.abs(wCrossD.dot(_yAxis));
        rhs = _extent.getX() * fAWdU[2] + _extent.getZ() * fAWdU[0];
        if (fAWxDdU[1] > rhs) {
            return false;
        }

View Full Code Here

        rhs = _extent.getX() * fAWdU[2] + _extent.getZ() * fAWdU[0];
        if (fAWxDdU[1] > rhs) {
            return false;
        }

        fAWxDdU[2] = Math.abs(wCrossD.dot(_zAxis));
        rhs = _extent.getX() * fAWdU[1] + _extent.getY() * fAWdU[0];
        if (fAWxDdU[2] > rhs) {
            return false;

        }
View Full Code Here

    private void setSphere(final Vector3 O, final Vector3 A, final Vector3 B) {
        final Vector3 a = A.subtract(O, null);
        final Vector3 b = B.subtract(O, null);
        final Vector3 acrossB = a.cross(b, null);

        final double Denominator = 2.0 * acrossB.dot(acrossB);

        if (Denominator == 0) {
            _center.set(0, 0, 0);
            setRadius(0);
        } else {
View Full Code Here

            return false;
        }

        final Vector3 diff = _compVect1.set(getCenter()).subtractLocal(bs.getCenter());
        final double rsum = getRadius() + bs.getRadius();
        return (diff.dot(diff) <= rsum * rsum);
    }

    @Override
    public boolean intersectsBoundingBox(final BoundingBox bb) {
        if (!Vector3.isValid(_center) || !Vector3.isValid(bb._center)) {
View Full Code Here

            return false;
        }

        final Vector3 diff = ray.getOrigin().subtract(getCenter(), _compVect1);
        final double radiusSquared = getRadius() * getRadius();
        final double a = diff.dot(diff) - radiusSquared;
        if (a <= 0.0) {
            // in sphere
            return true;
        }

View Full Code Here

            return true;
        }

        // outside sphere
        final Vector3 dir = _compVect2.set(ray.getDirection());
        final double b = dir.dot(diff);
        if (b >= 0.0) {
            return false;
        }
        return b * b >= a;
    }
View Full Code Here

    @Override
    public IntersectionRecord intersectsWhere(final ReadOnlyRay3 ray) {

        final Vector3 diff = ray.getOrigin().subtract(getCenter(), _compVect1);
        final double a = diff.dot(diff) - (getRadius() * getRadius());
        double a1, discr, root;
        if (a <= 0.0) {
            // inside sphere
            a1 = ray.getDirection().dot(diff);
            discr = (a1 * a1) - a;
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.