Package codechicken.lib.vec

Examples of codechicken.lib.vec.Vector3


        this(x, y, z, u, v, 0);
    }

    public Vertex5(double x, double y, double z, double u, double v, int tex)
    {
        this(new Vector3(x, y, z), new UV(u, v));
    }
View Full Code Here


    }
   
    public static void addBlockHitEffects(World world, Cuboid6 bounds, int side, IIcon icon, EffectRenderer effectRenderer)
    {
        float border = 0.1F;
        Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2*border);
        diff.x*=world.rand.nextDouble();
        diff.y*=world.rand.nextDouble();
        diff.z*=world.rand.nextDouble();
        Vector3 pos = diff.add(bounds.min).add(border);
       
        if (side == 0)
            diff.y = bounds.min.y - border;
        if (side == 1)
            diff.y = bounds.max.y + border;
View Full Code Here

                    .multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
    }
   
    public static void addBlockDestroyEffects(World world, Cuboid6 bounds, IIcon[] icons, EffectRenderer effectRenderer)
    {
        Vector3 diff = bounds.max.copy().subtract(bounds.min);
        Vector3 center = bounds.min.copy().add(bounds.max).multiply(0.5);
        Vector3 density = diff.copy().multiply(4);
        density.x = Math.ceil(density.x);
        density.y = Math.ceil(density.y);
        density.z = Math.ceil(density.z);
       
        for (int i = 0; i < density.x; ++i)
View Full Code Here

        generateControlPoints();
    }

    public ParticleLogicArcToEntity generateControlPoints()
    {
        firstControl = new Vector3(start.x + (target.posX - start.x) / 3.0D, start.y + (target.posY - start.y) / 3.0D, start.z + (target.posZ - start.z) / 3.0D);

        secondControl = new Vector3(start.x + (target.posX - start.x) / 3.0D * 2.0D, start.y + (target.posY - start.y) / 3.0D * 2.0D, start.z + (target.posZ - start.z) / 3.0D * 2.0D);

        double offsetX = rand.nextFloat() * offsetFactor - halfOffsetFactor;
        double offsetZ = rand.nextFloat() * offsetFactor - halfOffsetFactor;

        Vector3 offset = new Vector3(offsetX, 0.0D, offsetZ);

        firstControl = firstControl.add(offset);
        secondControl = secondControl.add(offset);

        return this;
View Full Code Here

        if (percent >= 1.0F)
        {
            finishLogic();
            return;
        }
        Vector3 bez = MathLib.bezier(start, firstControl, secondControl, new Vector3(target.posX, target.posY, target.posZ).add(new Vector3(0.0D, target.getEyeHeight(), 0.0D)), percent);
        particle.setPosition(bez.x, bez.y, bez.z);
    }
View Full Code Here

    }

    @Override
    public ParticleLogic clone()
    {
        return new ParticleLogicApproachPoint(new Vector3(targetX, targetY, targetZ), approachSpeed, targetDistance).setIgnoreY(ignoreY).setFinal(finalLogic).setPriority(priority);
    }
View Full Code Here

        generateControlPoints();
    }

    public ParticleLogicArcToPoint generateControlPoints()
    {
        firstControl = new Vector3(start.x + (target.x - start.x) / 3.0F, start.y + (target.y - start.y) / 3.0F, start.z + (target.z - start.z) / 3.0F);

        secondControl = new Vector3(start.x + (target.x - start.x) / 3.0F * 2.0F, start.y + (target.y - start.y) / 3.0F * 2.0F, start.z + (target.z - start.z) / 3.0F * 2.0F);

        double offsetX = rand.nextFloat() * offsetFactor - halfOffsetFactor;
        double offsetZ = rand.nextFloat() * offsetFactor - halfOffsetFactor;
        double offsetY = rand.nextFloat() * offsetFactor - halfOffsetFactor;

        Vector3 offset = new Vector3(offsetX, offsetY, offsetZ);

        firstControl = firstControl.add(offset);
        secondControl = secondControl.add(offset);

        return this;
View Full Code Here

        if (percent >= 1.0F)
        {
            finishLogic();
            return;
        }
        Vector3 bez = MathLib.bezier(start, firstControl, secondControl, target, percent);
        particle.setPosition(bez.x, bez.y, bez.z);
    }
View Full Code Here

            };

            ParticleLogicTrail trail = new ParticleLogicTrail("box", build);

            double speed = MathHelper.getRandomDoubleInRange(rand, 0.1D, 0.2D);
            ParticleLogicApproachPoint approach = new ParticleLogicApproachPoint(new Vector3(x1,y1,z1), speed, 0.1D);
            approach.setTerminate(true);

            ParticleLogicScale scale = new ParticleLogicScale();
            scale.setRate(-0.0001F, -0.0001F);
            scale.setTerminate(true);
View Full Code Here

        double z1 = bc.z+0.5;

        CoreParticle c = ParticleManagement.instance.spawn(world, "flutter1", x, y, z);
        if (c != null)
        {
            ParticleLogicOrbitPoint orbit = new ParticleLogicOrbitPoint(new Vector3(x1, y1, z1));
            orbit.setOrbitSpeed(0.5f * rand.nextDouble()).setTargetDistance(0.3D);
            orbit.setShrinkingOrbit(0.01, 0.01);

            ParticleLogicScale scale = new ParticleLogicScale();
            scale.setRate(-0.001F, -0.0001F * rand.nextFloat());
 
View Full Code Here

TOP

Related Classes of codechicken.lib.vec.Vector3

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.