/** * The material's diffuse color. This can be overwritten by {@link Object3D#setColor(int)}. This * color will be applied to the whole object. For vertex colors use {@link * Material#useVertexColors(boolean)} and {@link Material#setVertexColors(int)}. * * @param color A float array containing the colors to be used. These are normalized values * containing values for the red, green, blue and alpha channels. */ public void setColor(float[] color) { mColor[0] = color[0]; mColor[1] = color[1]; mColor[2] = color[2]; mColor[3] = color[3]; if (mVertexShader != null) mVertexShader.setColor(mColor); }
/** * The material's diffuse color. This can be overwritten by {@link Object3D#setColor(int)}. This * color will be applied to the whole object. For vertex colors use {@link * Material#useVertexColors(boolean)} and {@link Material#setVertexColors(int)}. * * @param int color The color to be used. Color.RED for instance. Or 0xffff0000. */ public void setColor(int color) { mColor[0] = (float) Color.red(color) / 255.f; mColor[1] = (float) Color.green(color) / 255.f; mColor[2] = (float) Color.blue(color) / 255.f; mColor[3] = (float) Color.alpha(color) / 255.f; if (mVertexShader != null) mVertexShader.setColor(mColor); }
/** * Applies parameters that should be set on the shaders. These are parameters like time, color, * buffer handles, etc. */ public void applyParams() { mVertexShader.setColor(mColor); mVertexShader.setTime(mTime); mVertexShader.applyParams(); mFragmentShader.setColorInfluence(mColorInfluence); mFragmentShader.applyParams(); }