當前位置: 首頁>>代碼示例>>Java>>正文


Java ParticleType.b2_waterParticle方法代碼示例

本文整理匯總了Java中org.jbox2d.particle.ParticleType.b2_waterParticle方法的典型用法代碼示例。如果您正苦於以下問題:Java ParticleType.b2_waterParticle方法的具體用法?Java ParticleType.b2_waterParticle怎麽用?Java ParticleType.b2_waterParticle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jbox2d.particle.ParticleType的用法示例。


在下文中一共展示了ParticleType.b2_waterParticle方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: DwParticleSpawn

import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public DwParticleSpawn(World world, DwViewportTransform transform){
  this.world = world;
  this.transform = transform;
  this.pdestroyer = new DwParticleDestroyer(world, transform);
  this.group_def  = new ParticleGroupDef();
  
  this.group_def.setColor(new Color3f(1,0.35f, 0.15f));
  this.group_def.flags = ParticleType.b2_waterParticle | ParticleType.b2_viscousParticle;
  this.group_def.groupFlags = 0;
  
  setCircleShape(30);
}
 
開發者ID:diwi,項目名稱:LiquidFunProcessing,代碼行數:13,代碼來源:DwParticleSpawn.java

示例2: setParticleSpawnProperties

import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public void setParticleSpawnProperties(int type){
    
    spawn_type = type;

    int COLOR_MIX = 0;
//    COLOR_MIX = ParticleType.b2_colorMixingParticle;
    
    DwParticleSpawn particle_spawn = world.mouse_spawn_particles;
    particle_spawn.join_groups = false;
    particle_spawn.setCircleShape(30);
    
    colorMode(HSB, 360, 100, 100);
    
    float hsb_s = 100;
    float hsb_b = 100;

    switch (type) {
      case 0:
        particle_spawn.group_def.setColor(color(225, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_waterParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 1:
        particle_spawn.group_def.setColor(color(100, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_viscousParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 2:
        particle_spawn.group_def.setColor(color(0, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_tensileParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 3:
        particle_spawn.group_def.setColor(color(60, hsb_s * 0.5f, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_powderParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 4:
        particle_spawn.group_def.setColor(color(330, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_wallParticle;
        particle_spawn.group_def.groupFlags = ParticleGroupType.b2_solidParticleGroup;
        particle_spawn.join_groups = true;
        particle_spawn.setCircleShape(20);
        break;
    }
    
    colorMode(RGB, 255);

  }
 
開發者ID:diwi,項目名稱:LiquidFunProcessing,代碼行數:50,代碼來源:liquidfun_ParticleRenderGroups_LiquidFx.java

示例3: setParticleSpawnProperties

import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public void setParticleSpawnProperties(int type){
    
    spawn_type = type;

    int COLOR_MIX = 0;
//    COLOR_MIX = ParticleType.b2_colorMixingParticle;
    
    DwParticleSpawn particle_spawn = world.mouse_spawn_particles;
    particle_spawn.join_groups = false;
    particle_spawn.setCircleShape(40);

    colorMode(HSB, 360, 100, 100);
    
    switch (type) {
      case 0:
        particle_spawn.group_def.setColor(color(225, 96, 96));
        particle_spawn.group_def.flags = ParticleType.b2_waterParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 1:
        particle_spawn.group_def.setColor(color(100, 96, 96));
        particle_spawn.group_def.flags = ParticleType.b2_viscousParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 2:
        particle_spawn.group_def.setColor(color(5, 96, 96));
        particle_spawn.group_def.flags = ParticleType.b2_tensileParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 3:
        particle_spawn.group_def.setColor(color(70, 50, 96));
        particle_spawn.group_def.flags = ParticleType.b2_powderParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 4:
        particle_spawn.group_def.setColor(color(300, 96, 96));
//        particle_spawn.group_def.flags = ParticleType.b2_elasticParticle | ParticleType.b2_springParticle | COLOR_MIX;
        particle_spawn.group_def.flags = ParticleType.b2_elasticParticle | COLOR_MIX;

        particle_spawn.group_def.groupFlags = 0;
        break;
      case 5:
        particle_spawn.group_def.setColor(color(120, 90, 50));
        particle_spawn.group_def.flags = ParticleType.b2_wallParticle;
        particle_spawn.group_def.groupFlags = ParticleGroupType.b2_solidParticleGroup;
        particle_spawn.join_groups = true;
        particle_spawn.setCircleShape(15);
        break;
    }
    
    colorMode(RGB, 255);

  }
 
開發者ID:diwi,項目名稱:LiquidFunProcessing,代碼行數:54,代碼來源:liquidfun_ParticleTypes.java

示例4: setParticleSpawnProperties

import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public void setParticleSpawnProperties(int type){
    
    spawn_type = type;

    int COLOR_MIX = 0;
//    COLOR_MIX = ParticleType.b2_colorMixingParticle;
    
    DwParticleSpawn particle_spawn = world.mouse_spawn_particles;
    particle_spawn.join_groups = false;
    particle_spawn.setCircleShape(40);
    
    colorMode(HSB, 360, 100, 100);

    switch (type) {
      case 0:
        particle_spawn.group_def.setColor(color(225, 100, 100));
        particle_spawn.group_def.flags = ParticleType.b2_waterParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 1:
        particle_spawn.group_def.setColor(color(100, 100, 100));
        particle_spawn.group_def.flags = ParticleType.b2_viscousParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 2:
        particle_spawn.group_def.setColor(color(0, 100, 100));
        particle_spawn.group_def.flags = ParticleType.b2_tensileParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 3:
        particle_spawn.group_def.setColor(color(60, 50, 100));
        particle_spawn.group_def.flags = ParticleType.b2_powderParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 4:
        particle_spawn.group_def.setColor(color(330, 100, 100));
        particle_spawn.group_def.flags = ParticleType.b2_wallParticle;
        particle_spawn.group_def.groupFlags = ParticleGroupType.b2_solidParticleGroup;
        particle_spawn.join_groups = true;
        particle_spawn.setCircleShape(20);
        break;
    }
    
    colorMode(RGB, 255);

  }
 
開發者ID:diwi,項目名稱:LiquidFunProcessing,代碼行數:47,代碼來源:liquidfun_DrawingParticles_LiquidFx.java

示例5: setParticleSpawnProperties

import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public void setParticleSpawnProperties(int type){
    
    spawn_type = type;

    int COLOR_MIX = 0;
//    COLOR_MIX = ParticleType.b2_colorMixingParticle;
    
    DwParticleSpawn particle_spawn = world.mouse_spawn_particles;
    particle_spawn.join_groups = false;
    particle_spawn.setCircleShape(30);
    
    colorMode(HSB, 360, 100, 100);
    
    float hsb_s = 10;
    float hsb_b = 20;

    switch (type) {
      case 0:
        particle_spawn.group_def.setColor(color(225, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_waterParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 1:
        particle_spawn.group_def.setColor(color(100, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_viscousParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 2:
        particle_spawn.group_def.setColor(color(0, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_tensileParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 3:
        particle_spawn.group_def.setColor(color(60, hsb_s * 0.5f, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_powderParticle | COLOR_MIX;
        particle_spawn.group_def.groupFlags = 0;
        break;
      case 4:
        particle_spawn.group_def.setColor(color(330, hsb_s, hsb_b));
        particle_spawn.group_def.flags = ParticleType.b2_wallParticle;
        particle_spawn.group_def.groupFlags = ParticleGroupType.b2_solidParticleGroup;
        particle_spawn.join_groups = true;
        particle_spawn.setCircleShape(20);
        break;
    }
    
    colorMode(RGB, 255);

  }
 
開發者ID:diwi,項目名稱:LiquidFunProcessing,代碼行數:50,代碼來源:liquidfun_ParticleRenderGroups_LiquidFxDark.java

示例6: initScene

import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public void initScene() {
    
    float dimx = world.transform.box2d_dimx;
    float dimy = world.transform.box2d_dimy;

    Vec2 ankerA = new Vec2();
    Vec2 ankerB = new Vec2();
    
    createChain(ankerA.set(-10, 10), ankerB.set(+15, 10), 0.5f, 0.5f);
    createChain(ankerA.set(-10, 15), ankerB.set(-30, 20), 0.5f, 0.5f);
    createChain(ankerA.set(-24,24), ankerB.set(24,26), 0.5f, 0.5f);
    


    
    emitter0 = new DwParticleEmitter(world, world.transform);
    emitter1 = new DwParticleEmitter(world, world.transform);
    emitter2 = new DwParticleEmitter(world, world.transform);
    emitter3 = new DwParticleEmitter(world, world.transform);
    
    
    int flags = 0;
    flags |= ParticleType.b2_waterParticle;
    flags |= ParticleType.b2_viscousParticle;
//    flags |= ParticleType.b2_colorMixingParticle;
    

    float hsb_s = 100;
    float hsb_b = 100;
    colorMode(HSB, 360, 100, 100);
    
    emitter0.setInScreen( 100, 100, 200,  -40, color(  5, hsb_s, hsb_b), flags);
    emitter1.setInScreen( 50,   50, 200,   0, color( 20, hsb_s, hsb_b), flags);
    emitter2.setInScreen(1000, 100, 300, -175, color(115, hsb_s, hsb_b), flags);
    emitter3.setInScreen(1100, 700, 400,  120, color(230, hsb_s, hsb_b), flags);
    
    colorMode(RGB, 255);

  }
 
開發者ID:diwi,項目名稱:LiquidFunProcessing,代碼行數:40,代碼來源:liquidfun_Chain_DistanceJoints_LiquidFx.java


注:本文中的org.jbox2d.particle.ParticleType.b2_waterParticle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。