水をシミュレートするために LiquidFun を使用しています。これは、パーティクルを使用する box2d に基づく物理エンジンです。私の問題は、特定の色でパーティクルをレンダリングするときです。
パーティクル定義でパーティクル カラーを設定する目的は何ですか? ParticleDebugRenderer でパーティクルをレンダリングする色も設定する必要がある場合。
public void createWater(float x, float y){
ParticleDef def = new ParticleDef();
def.color.set(Color.Red); //set particle color
def.flags.add(ParticleDef.ParticleType.b2_tensileParticle);
def.flags.add(ParticleDef.ParticleType.b2_colorMixingParticle);
def.position.set(x, y);
int index = system.createParticle(def);
}
ParticleDebugRenderer:
pdr = new ParticleDebugRenderer(Color.BLUE, maxParticles); //set as BLUE
パーティクルを赤に設定しても、ParticleDebugRenderer が青に設定されているため、青でレンダリングされます。