Examples of Motion


Examples of aspect.physics.Motion

    public float mouseSensitivity = 5.0f;

    public PlayerShip() {
        Mouse.setGrabbed(true);
        Motion m = new Motion();
        rot = Matrix4x4.identity();
        addBehavior(m);
        addBehavior(new ShipControl());
       
        centerMouse();
View Full Code Here

Examples of aspect.physics.Motion

        public void update() {
            Vector3 up = Vector3.yAxis();
            Vector3 right = Vector3.xAxis();
            Vector3 forward = Vector3.zAxis().negate();

            Motion m = getBehavior(Motion.class);
           
            float yaw = -getMouseDX() * mouseSensitivity;
            float pitch = getMouseDY() * mouseSensitivity;
           
            if (isKeyDown(KEY_UP)) {
View Full Code Here

Examples of aspect.physics.Motion

        this.maxSpeed = entity.getBehavior(Motion.class).velocity.mag();
    }

    @Override
    public void update() {
        Motion m = ent.getBehavior(Motion.class);

        m.acceleration = entity.transform.position.minus(ent.transform.position).normalize().times(10.0f);

        if (m.velocity.mag() > maxSpeed) {
            m.velocity = m.velocity.normalize().times(maxSpeed);
View Full Code Here

Examples of aspect.physics.Motion

       
        Material mtl = new Material(shader);
        model = ellipse(mtl, 2.0f, 2.0f, 20);

        addBehavior(new Billboard(model));
        addBehavior(new Motion(vel, Vector3.zero()));
        addBehavior(new TimeToLive(2.0f));

        addBehavior(new Behavior() {
            @Override
            public void update() {
View Full Code Here

Examples of aspect.physics.Motion

    private Behavior flight;

    public Fighter(Fighter leader) {
        super(loadObjModel("fighter", new File("models/fighter.obj"), new Vector3(0.25f)));

        final Motion m = new Motion();
        m.velocity = new Vector3(0, 0, -5);
        addBehavior(m);

        if (leader == null) {
            flight = new Behavior() {
View Full Code Here

Examples of aspect.physics.Motion

    }

    public void die() {
        removeBehavior(flight);
       
        Motion motion = getBehavior(Motion.class);
        System.out.println(motion);
        removeBehavior(motion);
        RigidBody rigidBody = new RigidBody();
        addBehavior(rigidBody);
        rigidBody.velocity = motion.velocity;
View Full Code Here

Examples of aspect.physics.Motion

            return;
        }
       
        FloatBuffer pos = ent.transform.position.getBuffer();
        FloatBuffer vel = BufferUtils.createFloatBuffer(3);
        Motion motion = ent.getBehavior(Motion.class);
       
        if (motion != null) {
            motion.velocity.store(vel);
            vel.flip();
        }
View Full Code Here

Examples of aspect.physics.Motion

        }

        FloatBuffer pos = ent.transform.position.getBuffer();
        FloatBuffer vel = BufferUtils.createFloatBuffer(3);
        FloatBuffer ori = BufferUtils.createFloatBuffer(6);
        Motion motion = ent.getBehavior(Motion.class);

        if (motion != null) {
            motion.velocity.store(vel);
        } else {
            Vector3.zero().store(vel);
View Full Code Here

Examples of com.sun.dtv.lwuit.animations.Motion

            }
        }
    }

    private void initScrollMotion() {
        Motion m = Motion.createLinearMotion(initialScrollY, destScrollY, getScrollAnimationSpeed());
        setAnimationMotion(m);
        m.start();
    }
View Full Code Here

Examples of com.sun.dtv.lwuit.animations.Motion

     * Presente no JAVADTV 1.1
     */
    public boolean animate() {
        Image bgImage = getStyle().getBgImage();
        boolean animateBackground = bgImage != null && bgImage.isAnimation() && ((Animation) bgImage).animate();
        Motion m = getAnimationMotion();
        //preform regular scrolling
        if (m != null && destScrollY != -1 && destScrollY != getScrollY()) {
            // change the variable directly for efficiency both in removing redundant
            // repaints and scroll checks
            scrollY = m.getValue();

            if (destScrollY == scrollY) {
                destScrollY = -1;
            }
            return true;
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.