当前位置: 首页>>代码示例>>Java>>正文


Java Attribute.toString方法代码示例

本文整理汇总了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);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:33,代码来源:DefaultShader.java

示例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);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:32,代码来源:ParticleShader.java

示例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);
}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:32,代码来源:AtmosphereShader.java


注:本文中的com.badlogic.gdx.graphics.g3d.Attribute.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。