Examples of Velocity


Examples of com.tankz.components.Velocity

  }

  @Override
  protected void process(Entity e) {
    Transform t = transformMapper.get(e);
    Velocity velocity = velocityMapper.get(e);

    float r = t.getRotationAsRadians();
    float v = velocity.getVelocity();

    float xn = t.getX() + (TrigLUT.cos(r) * v * world.getDelta());
    float yn = t.getY() + (TrigLUT.sin(r) * v * world.getDelta());

    t.setLocation(xn, yn);
View Full Code Here

Examples of com.tankz.components.Velocity

    if (player == null || !player.isActive())
      player = world.getManager(TagManager.class).getEntity("PLAYER");
  }

  protected void updatePlayer(Entity e) {
    Velocity v = velocityMapper.get(e);
    TurnFactor tf = turnFactorMapper.get(e);
    Physics c = collidableMapper.get(e);
   
    updateMoving(e);
    //updateRotating(e);
View Full Code Here

Examples of com.tankz.components.Velocity

    if (player == null || !player.isActive())
      player = world.getManager(TagManager.class).getEntity("PLAYER");
  }

  protected void updatePlayer(Entity e) {
    Velocity v = velocityMapper.get(e);
    TurnFactor tf = turnFactorMapper.get(e);
    Physics physics = physicsMapper.get(e);

    Tower tower = towerMapper.get(e);
    Ammo ammo = ammoMapper.get(e);
View Full Code Here

Examples of com.tankz.components.Velocity

  public static Entity createMammothTank(World world, float x, float y) {
    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "tanks");

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));
View Full Code Here

Examples of graphics.common.Velocity

    @Override
    public void applyTo( Effectable e, double delta ) {
        EffectData data = e.getData();
        if( data.isVelocitySupported() ) {
            Velocity vel = data.getCurVelocity();
            double modifier = mTime / delta;
            double deltaDecay = mShouldApplyDecay ? mDeltaDecayRate : 1.0;
            mVelDelta.modify( mVelDelta.getXPart() * modifier * deltaDecay,
                    mVelDelta.getYPart() * modifier * deltaDecay,
                    mVelDelta.getZPart() * modifier * deltaDecay );
            vel.modify( mVelDelta.getXPart(), mVelDelta.getYPart(), mVelDelta.getZPart() );

            // Make sure the modified velocity does not go below/above a certain amount
            // so that something doesn't either reverse velocity, or slow down
            // so much that it does not actually get to where it needs to go.

            //TODO: Fix this so it works with both negative and positive velocities.
            // currently it only works with positive, as minimumspeed will always
            // be a positive value.

            if( vel.getRealXVelocity() < mMinimumSpeed.getXPart() ) {
                vel.setXVelocity( mMinimumSpeed.getXPart() );
            }
            if( vel.getRealYVelocity() < mMinimumSpeed.getYPart() ) {
                vel.setYVelocity( mMinimumSpeed.getYPart() );
            }
            if( vel.getRealZVelocity() < mMinimumSpeed.getZPart() ) {
                vel.setZVelocity( mMinimumSpeed.getZPart() );
            }
           
            vel = null;
        }
        data = null;
View Full Code Here

Examples of org.jbox2d.dynamics.contacts.Velocity

    if (m_velocities == null || m_bodyCapacity > m_velocities.length) {
      final Velocity[] old = m_velocities == null ? new Velocity[0] : m_velocities;
      m_velocities = new Velocity[m_bodyCapacity];
      System.arraycopy(old, 0, m_velocities, 0, old.length);
      for (int i = old.length; i < m_velocities.length; i++) {
        m_velocities[i] = new Velocity();
      }
    }

    // dynamic array
    if (m_positions == null || m_bodyCapacity > m_positions.length) {
View Full Code Here

Examples of org.jbox2d.dynamics.contacts.Velocity

    if (m_velocities == null || m_bodyCapacity > m_velocities.length) {
      final Velocity[] old = m_velocities == null ? new Velocity[0] : m_velocities;
      m_velocities = new Velocity[m_bodyCapacity];
      System.arraycopy(old, 0, m_velocities, 0, old.length);
      for (int i = old.length; i < m_velocities.length; i++) {
        m_velocities[i] = new Velocity();
      }
    }

    // dynamic array
    if (m_positions == null || m_bodyCapacity > m_positions.length) {
View Full Code Here

Examples of org.jbox2d.dynamics.contacts.Velocity

    if (m_velocities == null || m_bodyCapacity > m_velocities.length) {
      final Velocity[] old = m_velocities == null ? new Velocity[0] : m_velocities;
      m_velocities = new Velocity[m_bodyCapacity];
      System.arraycopy(old, 0, m_velocities, 0, old.length);
      for (int i = old.length; i < m_velocities.length; i++) {
        m_velocities[i] = new Velocity();
      }
    }

    // dynamic array
    if (m_positions == null || m_bodyCapacity > m_positions.length) {
View Full Code Here

Examples of org.jbox2d.dynamics.contacts.Velocity

    if (m_velocities == null || m_bodyCapacity > m_velocities.length) {
      final Velocity[] old = m_velocities == null ? new Velocity[0] : m_velocities;
      m_velocities = new Velocity[m_bodyCapacity];
      System.arraycopy(old, 0, m_velocities, 0, old.length);
      for (int i = old.length; i < m_velocities.length; i++) {
        m_velocities[i] = new Velocity();
      }
    }

    // dynamic array
    if (m_positions == null || m_bodyCapacity > m_positions.length) {
View Full Code Here

Examples of soc.qase.state.Velocity

    if((bitmask & 0x0004) != 0) {
      x = Utils.shortValue(data, offset);
      y = Utils.shortValue(data, offset + 2);
      z = Utils.shortValue(data, offset + 4);
      offset = offset + 6;
      player.setVelocity(new Velocity((int)(0.125 * x), (int)(0.125 * y), (int)(0.125 * z)));
    }
    if((bitmask & 0x0008) != 0) {
      value = (int)data[offset];
      if(value < 0) value = value + 256;
      player.setMoveTime(value);
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.