本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.Attribute.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.toString方法的具体用法?Java Attribute.toString怎么用?Java Attribute.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.g3d.Attribute
的用法示例。
在下文中一共展示了Attribute.toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindMaterial
import com.badlogic.gdx.graphics.g3d.Attribute; //导入方法依赖的package包/类
protected void bindMaterial (final Renderable renderable) {
if (currentMaterial == renderable.material) return;
int cullFace = config.defaultCullFace == -1 ? defaultCullFace : config.defaultCullFace;
int depthFunc = config.defaultDepthFunc == -1 ? defaultDepthFunc : config.defaultDepthFunc;
float depthRangeNear = 0f;
float depthRangeFar = 1f;
boolean depthMask = true;
currentMaterial = renderable.material;
for (final Attribute attr : currentMaterial) {
final long t = attr.type;
if (BlendingAttribute.is(t)) {
context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction);
set(u_opacity, ((BlendingAttribute)attr).opacity);
} else if ((t & IntAttribute.CullFace) == IntAttribute.CullFace)
cullFace = ((IntAttribute)attr).value;
else if ((t & FloatAttribute.AlphaTest) == FloatAttribute.AlphaTest)
set(u_alphaTest, ((FloatAttribute)attr).value);
else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) {
DepthTestAttribute dta = (DepthTestAttribute)attr;
depthFunc = dta.depthFunc;
depthRangeNear = dta.depthRangeNear;
depthRangeFar = dta.depthRangeFar;
depthMask = dta.depthMask;
} else if (!config.ignoreUnimplemented) throw new GdxRuntimeException("Unknown material attribute: " + attr.toString());
}
context.setCullFace(cullFace);
context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar);
context.setDepthMask(depthMask);
}
示例2: bindMaterial
import com.badlogic.gdx.graphics.g3d.Attribute; //导入方法依赖的package包/类
protected void bindMaterial(final Renderable renderable) {
if (currentMaterial == renderable.material)
return;
int cullFace = config.defaultCullFace == -1 ? GL20.GL_BACK : config.defaultCullFace;
int depthFunc = config.defaultDepthFunc == -1 ? GL20.GL_LEQUAL : config.defaultDepthFunc;
float depthRangeNear = 0f;
float depthRangeFar = 1f;
boolean depthMask = true;
currentMaterial = renderable.material;
for (final Attribute attr : currentMaterial) {
final long t = attr.type;
if (BlendingAttribute.is(t)) {
context.setBlending(true, ((BlendingAttribute)attr).sourceFunction, ((BlendingAttribute)attr).destFunction);
}
else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) {
DepthTestAttribute dta = (DepthTestAttribute)attr;
depthFunc = dta.depthFunc;
depthRangeNear = dta.depthRangeNear;
depthRangeFar = dta.depthRangeFar;
depthMask = dta.depthMask;
}
else if(!config.ignoreUnimplemented)
throw new GdxRuntimeException("Unknown material attribute: "+attr.toString());
}
context.setCullFace(cullFace);
context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar);
context.setDepthMask(depthMask);
}
示例3: bindMaterial
import com.badlogic.gdx.graphics.g3d.Attribute; //导入方法依赖的package包/类
protected void bindMaterial(final Renderable renderable) {
if (currentMaterial == renderable.material)
return;
int cullFace = config.defaultCullFace == -1 ? defaultCullFace : config.defaultCullFace;
int depthFunc = config.defaultDepthFunc == -1 ? defaultDepthFunc : config.defaultDepthFunc;
float depthRangeNear = 0f;
float depthRangeFar = 1f;
boolean depthMask = true;
currentMaterial = renderable.material;
for (final Attribute attr : currentMaterial) {
final long t = attr.type;
if (BlendingAttribute.is(t)) {
context.setBlending(true, ((BlendingAttribute) attr).sourceFunction, ((BlendingAttribute) attr).destFunction);
} else if ((t & IntAttribute.CullFace) == IntAttribute.CullFace)
cullFace = ((IntAttribute) attr).value;
else if ((t & DepthTestAttribute.Type) == DepthTestAttribute.Type) {
DepthTestAttribute dta = (DepthTestAttribute) attr;
depthFunc = dta.depthFunc;
depthRangeNear = dta.depthRangeNear;
depthRangeFar = dta.depthRangeFar;
depthMask = dta.depthMask;
} else if (!config.ignoreUnimplemented)
throw new GdxRuntimeException("Unknown material attribute: " + attr.toString());
}
context.setCullFace(cullFace);
context.setDepthTest(depthFunc, depthRangeNear, depthRangeFar);
context.setDepthMask(depthMask);
}