Package aspect.util

Examples of aspect.util.Vector3.times()


       
        if (magnitude == Float.NaN) {
            return Vector3.zero();
        }
       
        return direction.times(magnitude);
    }
}
View Full Code Here


        Vector3 cur = ent2.rigidBody().vel.normalize();
        Vector3 dest = ent.pos.minus(ent2.pos).normalize();
        Vector3 cross = Vector3.cross(dest, cur);
        Vector3 direction = Matrix4x4.identity().rotate(cross, 90).apply(cur);
        float magnitude = model.multiplier(Vector3.distance(ent.pos, ent2.pos)) * Trig.sin(Vector3.angleBetween(cur, dest)) * strength;
        return direction.times(magnitude);
    }
}
View Full Code Here

            int nv = pipeVertices(branchWidth, branchLength, LOD, vertices, vpos);
            int nt = pipeTexCoords(1, 1, LOD, texCoords, tpos);
            int nn = pipeNormals(LOD, normals, npos);
           
            Vector3 pos = new Vector3(Trig.sin(branchYaw), -Trig.cos(branchPitch), Trig.cos(branchYaw));
            pos = pos.times(branchLength / 2.0f);
            pos.y += branchHeight - height / 2;
           
            Angles ang = Angles.zero();
            ang.pitch = 75;
            ang.yaw = branchYaw;
View Full Code Here

                   
                    Vector3 vn = m.velocity.normalize();
                    transform.setForward(vn);
                   
                    if (m.velocity.mag() > 5) {
                        m.velocity = vn.times(5);
                    }
                }
            };
        } else {
            flight = new FollowEntity(leader);
View Full Code Here

    public void update() {
        Vector3 velOld = velocity;
        velocity = Vector3.add(velocity, acceleration.times(Time.deltaTime()));
       
        Vector3 avgVel = Vector3.divide(velOld.plus(velocity), 2.0f);
        ent.transform.position = ent.transform.position.plus(avgVel.times(Time.deltaTime()));
       
       
       
        Vector3 rVelOld = angularVelocity;
        angularVelocity = angularVelocity.plus(angularAcceleration.times(Time.deltaTime()));
View Full Code Here

            }

            Vector3 vr = va.minus(vb);

            // Normal impulse
            float num = -Vector3.dot(vr.times(1 + coefficientOfRestitution), normal);
            float f = 1.0f / mass + 1.0f / rb2.mass;
            Vector3 n2 = normal.times(f);
            float denom1 = Vector3.dot(normal, n2);
            moiA = momentOfInertia(Vector3.cross(normal, pos1).normalize());
            if (both) {
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.