Package javax.vecmath

Examples of javax.vecmath.Quat4f


/* 429 */     this.positions = new Point3f[len];
/* 430 */     this.quats = new Quat4f[len];
/* 431 */     this.scales = new float[len];
/*     */
/* 433 */     Point3f point = new Point3f();
/* 434 */     Quat4f quat = new Quat4f();
/*     */
/* 436 */     for (int i = 0; i < len; i++) {
/* 437 */       this.positions[i] = new Point3f();
/* 438 */       ri.getPosition(i, point);
/* 439 */       setPosition(i, point);
/*     */
/* 441 */       this.quats[i] = new Quat4f();
/* 442 */       ri.getQuat(i, quat);
/* 443 */       setQuat(i, quat);
/*     */
/* 445 */       setScale(i, ri.getScale(i));
/*     */     }
View Full Code Here


/*     */
/*  66 */     this.positions = new Point3f[this.knots.length];
/*  67 */     this.quats = new Quat4f[this.knots.length];
/*  68 */     for (int i = 0; i < this.positions.length; i++) {
/*  69 */       this.positions[i] = new Point3f();
/*  70 */       this.quats[i] = new Quat4f();
/*     */     }
/*     */
/*  73 */     ((RotPosPathInterpolator)this.node).getPositions(this.positions);
/*  74 */     ((RotPosPathInterpolator)this.node).getQuats(this.quats);
/*  75 */     for (int i = 0; i < this.positions.length; i++) {
View Full Code Here

/*    */   public void writeConstructorParams(DataOutput out) throws IOException {
/* 62 */     super.writeConstructorParams(out);
/*    */
/* 64 */     this.quats = new Quat4f[this.knots.length];
/* 65 */     for (int i = 0; i < this.quats.length; i++) {
/* 66 */       this.quats[i] = new Quat4f();
/*    */     }
/*    */
/* 69 */     ((RotationPathInterpolator)this.node).getQuats(this.quats);
/* 70 */     for (int i = 0; i < this.quats.length; i++)
/* 71 */       this.control.writeQuat4f(out, this.quats[i]);
View Full Code Here

/*     */
/*     */   private void setPathArrays(Quat4f[] quats)
/*     */   {
/* 124 */     this.quats = new Quat4f[quats.length];
/* 125 */     for (int i = 0; i < quats.length; i++) {
/* 126 */       this.quats[i] = new Quat4f();
/* 127 */       this.quats[i].set(quats[i]);
/*     */     }
/*     */   }
View Full Code Here

/* 282 */     RotationPathInterpolator ri = (RotationPathInterpolator)originalNode;
/*     */
/* 285 */     int len = ri.getArrayLengths();
/*     */
/* 288 */     this.quats = new Quat4f[len];
/* 289 */     Quat4f quat = new Quat4f();
/*     */
/* 291 */     for (int i = 0; i < len; i++) {
/* 292 */       this.quats[i] = new Quat4f();
/* 293 */       ri.getQuat(i, quat);
/* 294 */       setQuat(i, quat);
/*     */     }
/*     */   }
View Full Code Here

        if (dir.lengthSquared() > 0.001f) {
            dir.normalize();
        } else {
            dir.set(Direction.FORWARD.getVector3f());
        }
        Quat4f rotation = QuaternionUtil.shortestArcQuat(Direction.FORWARD.getVector3f(), dir, new Quat4f());

        Prefab prefab = Assets.getPrefab(prefabName);
        if (prefab != null && prefab.getComponent(LocationComponent.class) != null) {
            entityManager.create(prefab, spawnPos, rotation);
            return "Done";
View Full Code Here

    @Override
    public Quat4f deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        if (json.isJsonArray()) {
            JsonArray array = json.getAsJsonArray();
            if (array.size() == 4) {
                return new Quat4f(array.get(0).getAsFloat(), array.get(1).getAsFloat(), array.get(2).getAsFloat(), array.get(3).getAsFloat());
            }
        }
        return null;
    }
View Full Code Here

    // What inventory slot the character has selected (this currently also determines held item, will need to review based on gameplay)
    public int selectedItem;
    public float handAnimation;

    public Quat4f getLookRotation() {
        Quat4f lookRotation = new Quat4f();
        QuaternionUtil.setEuler(lookRotation, TeraMath.DEG_TO_RAD * yaw, TeraMath.DEG_TO_RAD * pitch, 0);
        return lookRotation;
    }
View Full Code Here

    }

    public Quat4f getRotation() {
        LocationComponent location = getCharacterEntity().getComponent(LocationComponent.class);
        if (location == null) {
            return new Quat4f(0, 0, 0, 1);
        }
        return location.getWorldRotation();
    }
View Full Code Here

    }

    public Quat4f getViewRotation() {
        CharacterComponent character = getCharacterEntity().getComponent(CharacterComponent.class);
        if (character == null) {
            return new Quat4f(0, 0, 0, 1);
        }
        Quat4f rot = new Quat4f();
        QuaternionUtil.setEuler(rot, TeraMath.DEG_TO_RAD * character.yaw, TeraMath.DEG_TO_RAD * character.pitch, 0);
        return rot;
    }
View Full Code Here

TOP

Related Classes of javax.vecmath.Quat4f

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.