Package com.ardor3d.math

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


                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntA);
                work.multiplyLocal(a);
                result.set(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntB);
                work.multiplyLocal(b);
                result.addLocal(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntC);
                work.multiplyLocal(c);
                result.addLocal(work);
View Full Code Here


                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntB);
                work.multiplyLocal(b);
                result.addLocal(work);

                BufferUtils.populateFromBuffer(work, getVertexBuffer(), pntC);
                work.multiplyLocal(c);
                result.addLocal(work);
                Vector3.releaseTempInstance(work);
                break;
            }
            case Points: {
View Full Code Here

        final Vector3 wanderTarget = _wanderTargets.get(index);

        wanderTarget.addLocal(calcNewJitter(), calcNewJitter(), calcNewJitter());
        wanderTarget.normalizeLocal();
        wanderTarget.multiplyLocal(_wanderRadius);

        _workVect.set(particle.getVelocity()).normalizeLocal().multiplyLocal(_wanderDistance);
        _workVect.addLocal(wanderTarget).normalizeLocal();
        _workVect.multiplyLocal(particle.getVelocity().length());
        particle.getVelocity().set(_workVect);
View Full Code Here

            final double angle = workVect.smallestAngleBetween(workVect2);
            if (angle < _deviance) {
                // if it is, increase the speed speedBump over time
                if (pVelocity.lengthSquared() < _maxSpeedSQ) {
                    final double change = _speedBump * dt;
                    workVect2.multiplyLocal(change); // where workVector2 = pVelocity.normalizeLocal()
                    pVelocity.addLocal(workVect2);
                }
            } else {
                final Vector3 axis = workVect2.crossLocal(workVect);
                // if it is not, shift the velocity to bring it back in line
View Full Code Here

        final Vector3 origin = store.set(source);
        final Vector3 direction = tmpStorage.set(destination).subtractLocal(origin);

        final double t = (planeHeight - origin.getY()) / (direction.getY());

        direction.multiplyLocal(t);
        origin.addLocal(direction);

        return t >= 0.0 && t <= 1.0;
    }
View Full Code Here

            if (_floor.getNormal().smallestAngleBetween(tempVect1) > MathUtils.HALF_PI) {
                // reflect our velocity vector across the floor plane
                _floor.reflectVector(tempVect1, tempVect1);

                // apply the "bounciness" factor
                tempVect1.multiplyLocal(scale * _bounciness);

                // write back to particle
                particle.setVelocity(tempVect1);
            }
            Vector3.releaseTempInstance(tempVect1);
View Full Code Here

                    if (orient != 0) {
                        tempQuat.apply(triModel.get(x), tempVec3);
                    } else {
                        tempVec3.set(triModel.get(x));
                    }
                    tempVec3.multiplyLocal(currSize).addLocal(_position);
                    BufferUtils.setInBuffer(tempVec3, vertexBuffer, startIndex + x);
                }
                Quaternion.releaseTempInstance(tempQuat);
                break;
            }
View Full Code Here

        }
        result.setX(MathUtils.cos(randDir) * MathUtils.sin(randAngle));
        result.setY(MathUtils.cos(randAngle));
        result.setZ(MathUtils.sin(randDir) * MathUtils.sin(randAngle));
        rotateVectorSpeed(result);
        result.multiplyLocal(getInitialVelocity());
        return result;
    }

    /**
     * Apply the rotation matrix to a given vector representing a particle velocity.
View Full Code Here

        final double distance = Math.max(radius, _minimumLightDistance);

        final Vector3 tmpVec = Vector3.fetchTempInstance();
        tmpVec.set(direction);
        tmpVec.negateLocal();
        tmpVec.multiplyLocal(distance);
        tmpVec.addLocal(center);

        // temporary location
        shadowCam.setLocation(tmpVec);
        shadowCam.lookAt(center, Vector3.UNIT_Y);
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.