【发布时间】:2017-01-08 03:57:13
【问题描述】:
我正在使用 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);
}
粒子调试渲染器:
pdr = new ParticleDebugRenderer(Color.BLUE, maxParticles); //set as BLUE
如果我将粒子设置为红色,它仍会呈现为蓝色,因为 ParticleDebugRenderer 设置为蓝色。
【问题讨论】:
-
如果您有多个水域并且想要调试它们怎么办?它们都是蓝色的,你不会看到太多?
-
我猜是吗?但我对将它们渲染为特定颜色感到困惑,因为 def.color.set() 由于 ParticleDebufRenderer 将无用
标签: java libgdx box2d liquidfun