Examples of Vector3


Examples of aspect.util.Vector3

           
            @Override
            public void render() {
                loadIdentity();
                begin(LINES);
                Vector3 force = ent.rigidBody().netForce();
                Vector3 vel = ent.rigidBody().vel.normalize().times(50);
                /*
                color(Color.RED);
                vertex(ent.pos.xy());
                vertex(ent.pos.plus(force).xy());*/
                color(Color.BLUE);
View Full Code Here

Examples of be.demmel.jgws.packets.Vector3

        readActions.add((packet, dataToDeserialize) -> {
          float x = dataToDeserialize.readFloat();
          float y = dataToDeserialize.readFloat();
          float z = dataToDeserialize.readFloat();

          Vector3 vector = new Vector3(x, y, z);
          try {
            field.set(packet, vector);
          } catch (IllegalArgumentException | IllegalAccessException e) {
            // should never happen
            LOGGER.error("Unexpected error: ", e);
View Full Code Here

Examples of ca.eandb.jmist.math.Vector3

   */
  @Override
  public void modify(ShadingContext context) {
    Basis3 basis = context.getBasis();
    RGB c = painter.getColor(context, WAVELENGTH_PACKET).toRGB();
    Vector3 n = Vector3.unit(c.r() - 0.5, c.g() - 0.5, c.b() - 0.5);
    Vector3 u = basis.u();
    Vector3 v = basis.v();

    basis = Basis3.fromWUV(n, u, v);
    context.setShadingBasis(basis);
  }
View Full Code Here

Examples of codechicken.lib.vec.Vector3

        if(part == null)
            return false;

        if(world.isRemote && !player.isSneaking())//attempt to use block activated like normal and tell the server the right stuff
        {
            Vector3 f = new Vector3(hit.hitVec).add(-hit.blockX, -hit.blockY, -hit.blockZ);
            Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
            if(!ignoreActivate(block) && block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float)f.x, (float)f.y, (float)f.z))
            {
                player.swingItem();
                PacketCustom.sendToServer(new C08PacketPlayerBlockPlacement(
View Full Code Here

Examples of cofh.repack.codechicken.lib.vec.Vector3

    public static QBQuad restore(Rectangle4i flat, int side, double d, QBImage img) {

      QBQuad quad = new QBQuad(side);
      quad.image = img;

      Transformation t = new Scale(-1, 1, -1).with(Rotation.sideOrientation(side, 0)).with(new Translation(new Vector3().setSide(side, d)));
      quad.verts[0] = new Vertex5(flat.x, 0, flat.y, 0, 0);
      quad.verts[1] = new Vertex5(flat.x + flat.w, 0, flat.y, 1, 0);
      quad.verts[2] = new Vertex5(flat.x + flat.w, 0, flat.y + flat.h, 1, 1);
      quad.verts[3] = new Vertex5(flat.x, 0, flat.y + flat.h, 0, 1);
      for (Vertex5 vert : quad.verts) {
View Full Code Here

Examples of com.ardor3d.math.Vector3

        // check if this example worries about input at all
        if (_logicalLayer == null) {
            return;
        }

        _controlHandle = FirstPersonControl.setupTriggers(_logicalLayer, new Vector3(0, 1, 0), true);


        _logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.ESCAPE), new TriggerAction()                       {

            public void perform(final Canvas source, final TwoInputStates inputState, final double tpf) {
View Full Code Here

Examples of com.ardor3d.math.Vector3

     *         src.eval.
     */
    public static Function3D rotateInput(final Function3D source, final ReadOnlyMatrix3 rotation) {
        return new Function3D() {
            public double eval(final double x, final double y, final double z) {
                final Vector3 temp = Vector3.fetchTempInstance();
                temp.set(x, y, z);
                rotation.applyPost(temp, temp);
                final double val = source.eval(temp.getX(), temp.getY(), temp.getZ());
                Vector3.releaseTempInstance(temp);
                return val;
            }
        };
    }
View Full Code Here

Examples of com.ardor3d.math.Vector3

        // find which integer based unit cube we're in
        final int ix = (int) MathUtils.floor(dx), iy = (int) MathUtils.floor(dy), iz = (int) MathUtils.floor(dz);

        final Key k = new Key();
        final Vector3 minPoint = new Vector3();
        double nearestSq = Double.MAX_VALUE;
        // Each cube has a point... Walk through all nearby cubes and see where our closest point lies.
        for (int a = ix - SEARCH_RADIUS; a <= ix + SEARCH_RADIUS; a++) {
            k.x = a;
            for (int b = iy - SEARCH_RADIUS; b <= iy + SEARCH_RADIUS; b++) {
                k.y = b;
                for (int c = iz - SEARCH_RADIUS; c <= iz + SEARCH_RADIUS; c++) {
                    k.z = c;
                    Vector3 point = _points.get(k);
                    if (point == null) {
                        final double pX = a + point(a, b, c, _seed);
                        final double pY = b + point(a, b, c, _seed + 1);
                        final double pZ = c + point(a, b, c, _seed + 2);
                        point = new Vector3(pX, pY, pZ);
                        // cache for future lookups
                        _points.put(new Key(k), point);
                    }
                    final double xDist = point.getX() - dx;
                    final double yDist = point.getY() - dy;
                    final double zDist = point.getZ() - dz;
                    final double distSq = xDist * xDist + yDist * yDist + zDist * zDist;

                    // check distance
                    if (distSq < nearestSq) {
                        nearestSq = distSq;
View Full Code Here

Examples of com.ardor3d.math.Vector3

            /** Set up how our camera sees. */
            _camera = new Camera(settings.getWidth(), settings.getHeight());
            _camera.setFrustumPerspective(45.0f, (float) settings.getWidth() / (float) settings.getHeight(), 1, 1000);
            _camera.setProjectionMode(ProjectionMode.Perspective);

            final Vector3 loc = new Vector3(0.0f, 0.0f, 10.0f);
            final Vector3 left = new Vector3(-1.0f, 0.0f, 0.0f);
            final Vector3 up = new Vector3(0.0f, 1.0f, 0.0f);
            final Vector3 dir = new Vector3(0.0f, 0f, -1.0f);
            /** Move our camera to a correct place and orientation. */
            _camera.setFrame(loc, left, up, dir);
        } else {
            // use new width and height to set ratio.
            _camera.setFrustumPerspective(_camera.getFovY(),
View Full Code Here

Examples of com.ardor3d.math.Vector3

        _camera = new Camera(width, _settings.getHeight());
        _camera.setFrustumPerspective(45.0f, (float) width / (float) _settings.getHeight(), 1, 1000);
        _camera.setProjectionMode(ProjectionMode.Perspective);

        // setup camera orientation and position.
        final Vector3 loc = new Vector3(0.0f, 0.0f, 0.0f);
        final Vector3 left = new Vector3(-1.0f, 0.0f, 0.0f);
        final Vector3 up = new Vector3(0.0f, 1.0f, 0.0f);
        final Vector3 dir = new Vector3(0.0f, 0f, -1.0f);
        _camera.setFrame(loc, left, up, dir);

        // release our FBO(s) until used.
        EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);
    }
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.