本文整理匯總了Java中org.jbox2d.particle.ParticleType.b2_powderParticle方法的典型用法代碼示例。如果您正苦於以下問題:Java ParticleType.b2_powderParticle方法的具體用法?Java ParticleType.b2_powderParticle怎麽用?Java ParticleType.b2_powderParticle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jbox2d.particle.ParticleType
的用法示例。
在下文中一共展示了ParticleType.b2_powderParticle方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: keyPressed
import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
@Override
public void keyPressed(char keyCar, int keyCode) {
super.keyPressed(keyCar, keyCode);
int toggle = 0;
switch (keyCar) {
case 'a':
flags = 0;
break;
case 'e':
toggle = ParticleType.b2_elasticParticle;
break;
case 'q':
toggle = ParticleType.b2_powderParticle;
break;
case 't':
toggle = ParticleType.b2_tensileParticle;
break;
case 'v':
toggle = ParticleType.b2_viscousParticle;
break;
}
if (toggle != 0) {
if ((flags & toggle) != 0) {
flags = flags & ~toggle;
} else {
flags = flags | toggle;
}
}
}
示例2: keyPressed
import org.jbox2d.particle.ParticleType; //導入方法依賴的package包/類
public void keyPressed(char keyChar, int keyCode) {
m_drawing = keyChar != 'x';
m_particleFlags = 0;
m_groupFlags = 0;
color.set((byte)127, (byte)127, (byte)127, (byte)50);
switch (keyChar) {
case 'e':
m_particleFlags = ParticleType.b2_elasticParticle;
m_groupFlags = ParticleGroupType.b2_solidParticleGroup;
break;
case 'p':
m_particleFlags = ParticleType.b2_powderParticle;
break;
case 'f':
m_groupFlags =
ParticleGroupType.b2_rigidParticleGroup | ParticleGroupType.b2_solidParticleGroup;
break;
case 's':
m_particleFlags = ParticleType.b2_springParticle;
m_groupFlags = ParticleGroupType.b2_solidParticleGroup;
break;
case 't':
color.set((byte)0, (byte)127, (byte)0, (byte)50);
m_particleFlags = ParticleType.b2_tensileParticle;
break;
case 'v':
color.set((byte)0, (byte)0, (byte)127, (byte)50);
m_particleFlags = ParticleType.b2_viscousParticle;
break;
case 'w':
m_particleFlags = ParticleType.b2_wallParticle;
m_groupFlags = ParticleGroupType.b2_solidParticleGroup;
break;
case 'z':
m_particleFlags = ParticleType.b2_zombieParticle;
break;
}
}
示例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(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);
}
示例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, 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);
}
示例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(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);
}
示例6: 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);
}