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


Java VertexAttributes.get方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.VertexAttributes.get方法的典型用法代码示例。如果您正苦于以下问题:Java VertexAttributes.get方法的具体用法?Java VertexAttributes.get怎么用?Java VertexAttributes.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.VertexAttributes的用法示例。


在下文中一共展示了VertexAttributes.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAttributeLocations

import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
protected final int[] getAttributeLocations(Renderable renderable) {
    final IntIntMap attributes = new IntIntMap();
    final VertexAttributes attrs = renderable.meshPart.mesh.getVertexAttributes();
    final int c = attrs.size();
    for (int i = 0; i < c; i++) {
        final VertexAttribute attr = attrs.get(i);
        final int location = program.getAttributeLocation(attr.alias);
        if (location >= 0)
            attributes.put(attr.getKey(), location);
    }

    tempArray.clear();
    final int n = attrs.size();
    for (int i = 0; i < n; i++) {
        tempArray.add(attributes.get(attrs.get(i).getKey(), -1));
    }
    return tempArray.items;
}
 
开发者ID:PWorlds,项目名称:LibGDX-PBR,代码行数:19,代码来源:PBRShader.java

示例2: init

import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
/** Initialize this shader, causing all registered uniforms/attributes to be fetched. */
public void init (final ShaderProgram program, final Renderable renderable) {
	if (locations != null) throw new GdxRuntimeException("Already initialized");
	if (!program.isCompiled()) throw new GdxRuntimeException(program.getLog());
	this.program = program;

	final int n = uniforms.size;
	locations = new int[n];
	for (int i = 0; i < n; i++) {
		final String input = uniforms.get(i);
		final Validator validator = validators.get(i);
		final Setter setter = setters.get(i);
		if (validator != null && !validator.validate(this, i, renderable))
			locations[i] = -1;
		else {
			locations[i] = program.fetchUniformLocation(input, false);
			if (locations[i] >= 0 && setter != null) {
				if (setter.isGlobal(this, i))
					globalUniforms.add(i);
				else
					localUniforms.add(i);
			}
		}
		if (locations[i] < 0) {
			validators.set(i, null);
			setters.set(i, null);
		}
	}
	if (renderable != null) {
		final VertexAttributes attrs = renderable.mesh.getVertexAttributes();
		final int c = attrs.size();
		for (int i = 0; i < c; i++) {
			final VertexAttribute attr = attrs.get(i);
			final int location = program.getAttributeLocation(attr.alias);
			if (location >= 0) attributes.put(attr.getKey(), location);
		}
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:39,代码来源:BaseShader.java

示例3: a

import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
public static VertexAttribute a(VertexAttributes paramVertexAttributes)
{
  for (int i = 0; i < paramVertexAttributes.size(); i++)
  {
    VertexAttribute localVertexAttribute = paramVertexAttributes.get(i);
    if (localVertexAttribute.usage == 0)
      return localVertexAttribute;
  }
  return null;
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:11,代码来源:bd.java


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