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


Java VertexBuffer.Format方法代码示例

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


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

示例1: convertVertexFormat

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
private int convertVertexFormat(VertexBuffer.Format fmt) {
    switch (fmt) {
        case Byte:
            return GL_BYTE;
        case Float:
            return GL_FLOAT;
        case Int:
            return GL_INT;
        case Short:
            return GL_SHORT;
        case UnsignedByte:
            return GL_UNSIGNED_BYTE;
        case UnsignedInt:
            return GL_UNSIGNED_INT;
        case UnsignedShort:
            return GL_UNSIGNED_SHORT;
        default:
            throw new UnsupportedOperationException("Unrecognized vertex format: " + fmt);
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:LwjglGL1Renderer.java

示例2: convertVertexFormat

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
private int convertVertexFormat(VertexBuffer.Format fmt) {
    switch (fmt) {
        case Byte:
            return gl.GL_BYTE;
        case Double:
            return gl.GL_DOUBLE;
        case Float:
            return gl.GL_FLOAT;
        case Half:
            return gl.GL_HALF_FLOAT_ARB;
        case Int:
            return gl.GL_INT;
        case Short:
            return gl.GL_SHORT;
        case UnsignedByte:
            return gl.GL_UNSIGNED_BYTE;
        case UnsignedInt:
            return gl.GL_UNSIGNED_INT;
        case UnsignedShort:
            return gl.GL_UNSIGNED_SHORT;
        default:
            throw new UnsupportedOperationException("Unrecognized vertex format: " + fmt);
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:25,代码来源:JoglRenderer.java

示例3: convertVertexFormat

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
@Override
protected int convertVertexFormat(VertexBuffer.Format fmt) {
    switch (fmt) {
        case Byte:
            return GL.GL_BYTE;
        case Double:
            return GL2GL3.GL_DOUBLE;
        case Float:
            return GL.GL_FLOAT;
        case Half:
            return GL.GL_HALF_FLOAT;
        case Int:
            return GL2ES2.GL_INT;
        case Short:
            return GL.GL_SHORT;
        case UnsignedByte:
            return GL.GL_UNSIGNED_BYTE;
        case UnsignedInt:
            return GL2ES2.GL_UNSIGNED_INT;
        case UnsignedShort:
            return GL.GL_UNSIGNED_SHORT;
        default:
            throw new UnsupportedOperationException("Unrecognized vertex format: " + fmt);
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:26,代码来源:JoglRenderer.java

示例4: bulkPut

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
private static void bulkPut(VertexBuffer.Format format, Buffer buf1, Buffer buf2) {
	switch (format) {
		case Byte:
		case Half:
		case UnsignedByte:
			((ByteBuffer) buf1).put((ByteBuffer) buf2);
			break;
		case Short:
		case UnsignedShort:

			((ShortBuffer) buf1).put((ShortBuffer) buf2);
			break;

		case Int:
		case UnsignedInt:
			((IntBuffer) buf1).put((IntBuffer) buf2);
			break;
		case Float:

			((FloatBuffer) buf1).put((FloatBuffer) buf2);
			break;
		case Double:
			((DoubleBuffer) buf1).put((DoubleBuffer) buf2);
			break;

		default:
			throw new UnsupportedOperationException("Unrecoginized buffer format: " + format);
	}
}
 
开发者ID:meltzow,项目名称:supernovae,代码行数:30,代码来源:SilentTangentBinormalGenerator.java

示例5: putValue

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
private static void putValue(VertexBuffer.Format format, Buffer buf1, Buffer buf2, int index) {
	switch (format) {
		case Byte:
		case Half:
		case UnsignedByte:
			byte b = ((ByteBuffer) buf2).get(index);
			((ByteBuffer) buf1).put(b);
			break;
		case Short:
		case UnsignedShort:
			short s = ((ShortBuffer) buf2).get(index);
			((ShortBuffer) buf1).put(s);
			break;

		case Int:
		case UnsignedInt:
			int i = ((IntBuffer) buf2).get(index);
			((IntBuffer) buf1).put(i);
			break;
		case Float:
			float f = ((FloatBuffer) buf2).get(index);
			((FloatBuffer) buf1).put(f);
			break;
		case Double:
			double d = ((DoubleBuffer) buf2).get(index);
			((DoubleBuffer) buf1).put(d);
			break;
		default:
			throw new UnsupportedOperationException("Unrecoginized buffer format: " + format);
	}
}
 
开发者ID:meltzow,项目名称:supernovae,代码行数:32,代码来源:SilentTangentBinormalGenerator.java

示例6: SharedBuffer

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
/**
 * Creates a new vertex buffer with the specified properties and shares it 
 * with OpenCL. The initial buffer will be uninitialized.
 * @param format the format of the buffer
 * @param type the type of each component
 * @param components the number of components per entry
 * @param size the size of the buffer
 */
public SharedBuffer(VertexBuffer.Format format, VertexBuffer.Type type, int components, int size) {
	this.format = format;
	this.type = type;
	this.components = components;
	this.size = size;
}
 
开发者ID:shamanDevel,项目名称:jME3-OpenCL-Library,代码行数:15,代码来源:SharedBuffer.java

示例7: convertVertexFormat

import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
protected abstract int convertVertexFormat(VertexBuffer.Format fmt); 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:2,代码来源:AbstractRenderer.java


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