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


Java VertexAttributes.findByUsage方法代码示例

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


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

示例1: begin

import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
/** Begin building a mesh */
public void begin (final VertexAttributes attributes, int primitiveType) {
	if (this.attributes != null) throw new RuntimeException("Call end() first");
	this.attributes = attributes;
	this.vertices.clear();
	this.indices.clear();
	this.parts.clear();
	this.vindex = 0;
	this.istart = 0;
	this.part = null;
	this.stride = attributes.vertexSize / 4;
	this.vertex = new float[stride];
	VertexAttribute a = attributes.findByUsage(Usage.Position);
	if (a == null) throw new GdxRuntimeException("Cannot build mesh without position attribute");
	posOffset = a.offset / 4;
	posSize = a.numComponents;
	a = attributes.findByUsage(Usage.Normal);
	norOffset = a == null ? -1 : a.offset / 4;
	a = attributes.findByUsage(Usage.Color);
	colOffset = a == null ? -1 : a.offset / 4;
	colSize = a == null ? 0 : a.numComponents;
	a = attributes.findByUsage(Usage.ColorPacked);
	cpOffset = a == null ? -1 : a.offset / 4;
	a = attributes.findByUsage(Usage.TextureCoordinates);
	uvOffset = a == null ? -1 : a.offset / 4;
	setColor(null);
	setVertexTransform(null);
	this.primitiveType = primitiveType;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:30,代码来源:MeshBuilder.java

示例2: begin

import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
/** Begin building a mesh */
public void begin(final VertexAttributes attributes, int primitiveType) {
    if (this.attributes != null)
        throw new RuntimeException("Call end() first");
    this.attributes = attributes;
    this.vertices.clear();
    this.indices.clear();
    this.parts.clear();
    this.vindex = 0;
    this.istart = 0;
    this.part = null;
    this.stride = attributes.vertexSize / 4;
    this.vertex = new float[stride];
    VertexAttribute a = attributes.findByUsage(Usage.Position);
    if (a == null)
        throw new GdxRuntimeException("Cannot build mesh without position attribute");
    posOffset = a.offset / 4;
    posSize = a.numComponents;
    a = attributes.findByUsage(Usage.Normal);
    norOffset = a == null ? -1 : a.offset / 4;
    a = attributes.findByUsage(Usage.ColorUnpacked);
    colOffset = a == null ? -1 : a.offset / 4;
    colSize = a == null ? 0 : a.numComponents;
    a = attributes.findByUsage(Usage.ColorPacked);
    cpOffset = a == null ? -1 : a.offset / 4;
    a = attributes.findByUsage(Usage.TextureCoordinates);
    uvOffset = a == null ? -1 : a.offset / 4;
    setColor(null);
    this.primitiveType = primitiveType;
}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:31,代码来源:MeshBuilder2.java


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