Package com.ardor3d.math.type

Examples of com.ardor3d.math.type.ReadOnlyVector3


        return true;
    }

    @Override
    public IntersectionRecord intersectsWhere(final ReadOnlyRay3 ray) {
        final ReadOnlyVector3 rayDir = ray.getDirection();
        final ReadOnlyVector3 rayOrigin = ray.getOrigin();

        // convert ray to box coordinates
        final Vector3 diff = rayOrigin.subtract(getCenter(), _compVect1);
        diff.set(_xAxis.dot(diff), _yAxis.dot(diff), _zAxis.dot(diff));
        final Vector3 direction = _compVect2.set(_xAxis.dot(rayDir), _yAxis.dot(rayDir), _zAxis.dot(rayDir));

        final double[] t = { 0, Double.POSITIVE_INFINITY };
View Full Code Here


        if (!transform.isRotationMatrix()) {
            final Vector3 scale = _compVect3.set(1, 1, 1);
            transform.applyForwardVector(scale);
            sphere.setRadius(Math.abs(maxAxis(scale) * getRadius()) + radiusEpsilon - 1);
        } else {
            final ReadOnlyVector3 scale = transform.getScale();
            sphere.setRadius(Math.abs(maxAxis(scale) * getRadius()) + radiusEpsilon - 1);
        }

        return sphere;
    }
View Full Code Here

        switch (volume.getType()) {

            case Sphere: {
                final BoundingSphere sphere = (BoundingSphere) volume;
                final double temp_radius = sphere.getRadius();
                final ReadOnlyVector3 tempCenter = sphere.getCenter();
                final BoundingSphere rVal = new BoundingSphere();
                return merge(temp_radius, tempCenter, rVal);
            }

            case AABB: {
View Full Code Here

        switch (volume.getType()) {

            case Sphere: {
                final BoundingSphere sphere = (BoundingSphere) volume;
                final double temp_radius = sphere.getRadius();
                final ReadOnlyVector3 temp_center = sphere.getCenter();
                return merge(temp_radius, temp_center, this);
            }

            case AABB: {
                final BoundingBox box = (BoundingBox) volume;
View Full Code Here

        final Camera cam = Camera.getCurrentCamera();

        if (spat.getWorldBound() != null && Vector3.isValid(spat.getWorldBound().getCenter())) {
            spat._queueDistance = spat.getWorldBound().distanceToEdge(cam.getLocation());
        } else {
            final ReadOnlyVector3 spatPosition = spat.getWorldTranslation();
            if (!Vector3.isValid(spatPosition)) {
                spat._queueDistance = Double.POSITIVE_INFINITY;
            } else {
                spat._queueDistance = cam.getLocation().distance(spatPosition);
            }
View Full Code Here

    protected static double getValueFor(final PointLight l, final BoundingVolume val) {
        if (val == null) {
            return 0;
        }
        if (l.isAttenuate()) {
            final ReadOnlyVector3 location = l.getLocation();
            final double dist = val.distanceTo(location);

            final double color = getColorValue(l);
            final double amlat = l.getConstant() + l.getLinear() * dist + l.getQuadratic() * dist * dist;

 
View Full Code Here

    protected static double getValueFor(final SpotLight l, final BoundingVolume val) {
        if (val == null) {
            return 0;
        }
        final ReadOnlyVector3 direction = l.getDirection();
        final ReadOnlyVector3 location = l.getLocation();
        // direction is copied into Plane, not reused.
        final Plane p = new Plane(direction, direction.dot(location));
        if (val.whichSide(p) != Plane.Side.Inside) {
            return getValueFor((PointLight) l, val);
        }
View Full Code Here

    /**
     * Forces rotation and translation of this node to be sync'd with the attached camera. (Assumes the node is in world
     * space.)
     */
    public void updateFromCamera() {
        final ReadOnlyVector3 camLeft = _camera.getLeft();
        final ReadOnlyVector3 camUp = _camera.getUp();
        final ReadOnlyVector3 camDir = _camera.getDirection();
        final ReadOnlyVector3 camLoc = _camera.getLocation();

        final Matrix3 rotation = Matrix3.fetchTempInstance();
        rotation.fromAxes(camLeft, camUp, camDir);

        setRotation(rotation);
View Full Code Here

     */
    @Override
    public void updateWorldTransform(final boolean recurse) {
        super.updateWorldTransform(recurse);
        if (_camera != null) {
            final ReadOnlyVector3 worldTranslation = getWorldTranslation();
            final ReadOnlyMatrix3 worldRotation = getWorldRotation();
            _camera.setFrame(worldTranslation, worldRotation);
        }
    }
View Full Code Here

        assert (null != to) : "parameter 'to' can not be null";
        assert (null != caller) : "parameter 'caller' can not be null";

        final Vector3 target = Vector3.fetchTempInstance();

        final ReadOnlyVector3 interpolated = interpolateVectors(from, to, delta, target);

        switch (getUpdateField()) {
            case LOCAL_SCALE:
                caller.setScale(interpolated);
                break;
View Full Code Here

TOP

Related Classes of com.ardor3d.math.type.ReadOnlyVector3

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.