/*
---------------------------------------------------------------------------
Open Asset Import Library - Java Binding (jassimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2012, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
package jassimp;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
/**
* A mesh represents a geometry or model with a single material.
* <p>
*
* <h3>Data</h3>
* Meshes usually consist of a number of vertices and a series of faces
* referencing the vertices. In addition there might be a series of bones, each
* of them addressing a number of vertices with a certain weight. Vertex data is
* presented in channels with each channel containing a single per-vertex
* information such as a set of texture coordinates or a normal vector.<p>
*
* Faces consist of one or more references to vertices, called vertex indices.
* The {@link #getPrimitiveTypes()} method can be used to check what
* face types are present in the mesh. Note that a single mesh can possess
* faces of different types. The number of indices used by a specific face can
* be retrieved with the {@link #getFaceNumIndices(int)} method.
*
*
* <h3>API for vertex and face data</h3>
* The jassimp interface for accessing vertex and face data is not a one-to-one
* mapping of the c/c++ interface. The c/c++ interface uses an object-oriented
* approach to represent data, which provides a considerable
* overhead using a naive java based realization (cache locality would be
* unpredictable and most likely bad, bulk data transfer would be impossible).
* <p>
*
* The jassimp interface uses flat byte buffers to store vertex and face data.
* This data can be accessed through three APIs:
* <ul>
* <li><b>Buffer API:</b> the <code>getXXXBuffer()</code> methods return
* raw data buffers.
* <li><b>Direct API:</b> the <code>getXXX()</code> methods allow reading
* and writing of individual data values.
* <li><b>Wrapped API:</b> the <code>getWrappedXXX()</code> methods provide
* an object oriented view on the data.
* </ul>
*
* The Buffer API is optimized for use in conjunction with rendering APIs
* such as LWJGL. The returned buffers are guaranteed to have native byte order
* and to be direct byte buffers. They can be passed directly to LWJGL
* methods, e.g., to fill VBOs with data. Each invocation of a
* <code>getXXXBuffer()</code> method will return a new view of the internal
* buffer, i.e., if is safe to use the relative byte buffer operations.
* The Buffer API provides the best performance of all three APIs, especially
* if large data volumes have to be processed.<p>
*
* The Direct API provides an easy to use interface for reading and writing
* individual data values. Its performance is comparable to the Buffer API's
* performance for these operations. The main difference to the Buffer API is
* the missing support for bulk operations. If you intend to retrieve or modify
* large subsets of the raw data consider using the Buffer API, especially
* if the subsets are contiguous.
* <p>
*
* The Wrapped API offers an object oriented interface for accessing
* and modifying mesh data. As the name implies, this interface is realized
* through wrapper objects that provide a view on the raw data. For each
* invocation of a <code>getWrappedXXX()</code> method, a new wrapper object
* is created. Iterating over mesh data via this interface will create many
* short-lived wrapper objects which -depending on usage and virtual machine-
* may cause considerable garbage collection overhead. The Wrapped API provides
* the worst performance of all three APIs, which may nevertheless still be
* good enough to warrant its usage. See {@link AiWrapperProvider} for more
* details on wrappers.
*
*
* <h3>API for bones</h3>
* As there is no standardized way for doing skinning in different graphics
* engines, bones are not represented as flat buffers but as object structure.
* Users of this library should convert this structure to the format required
* by the specific graphics engine.
*
*
* <h3>Changing Data</h3>
* This class is designed to be mutable, i.e., the returned objects and buffers
* may be modified. It is not possible to add/remove vertices as this would
* require reallocation of the data buffers. Wrapped objects may or may not
* propagate changes to the underlying data buffers. Consult the documentation
* of your wrapper provider for details. The built in wrappers will propagate
* changes.
* <p>
* Modification of face data is theoretically possible by modifying the face
* buffer and the faceOffset buffer however it is strongly disadvised to do so
* because it might break all algorithms that depend on the internal consistency
* of these two data structures.
*/
public final class AiMesh {
/**
* Number of bytes per float value.
*/
private static final int SIZEOF_FLOAT = Jassimp.NATIVE_FLOAT_SIZE;
/**
* Number of bytes per int value.
*/
private static final int SIZEOF_INT = Jassimp.NATIVE_INT_SIZE;
/**
* Size of an AiVector3D in the native world.
*/
private static final int SIZEOF_V3D = Jassimp.NATIVE_AIVEKTOR3D_SIZE;
/**
* This class is instantiated via JNI, no accessible constructor.
*/
private AiMesh() {
/* nothing to do */
}
/**
* Returns the primitive types used by this mesh.
*
* @return a set of primitive types used by this mesh
*/
public Set<AiPrimitiveType> getPrimitiveTypes() {
return m_primitiveTypes;
}
/**
* Tells whether the mesh is a pure triangle mesh, i.e., contains only
* triangular faces.<p>
*
* To automatically triangulate meshes the
* {@link AiPostProcessSteps#TRIANGULATE} post processing option can be
* used when loading the scene
*
* @return true if the mesh is a pure triangle mesh, false otherwise
*/
public boolean isPureTriangle() {
return m_primitiveTypes.contains(AiPrimitiveType.TRIANGLE) &&
m_primitiveTypes.size() == 1;
}
/**
* Tells whether the mesh has vertex positions.<p>
没有合适的资源?快使用搜索试试~ 我知道了~
3D引擎,渲染系统使用的OpenGL 及 OpenGL ES,Windows上OpenGL ES使用AMD的ES模拟器.zip
共2000个文件
h:906个
c:600个
cpp:245个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 68 浏览量
2024-05-11
06:54:10
上传
评论
收藏 124.58MB ZIP 举报
温馨提示
opengl OpenGL(Open Graphics Library)是一个跨平台、跨语言的图形编程接口(API)。它被广泛用于实现2D和3D图形渲染,并且是许多应用程序、游戏和网页浏览器的核心组件。 以下是对 OpenGL 的一些主要特性的概述: 1. 低层次的渲染 API:OpenGL 提供了直接与图形硬件进行交互的能力。这使得它非常强大,因为它可以充分利用图形处理器(GPU)的性能。然而,这也意味着使用 OpenGL 需要对计算机图形学有深入的理解。 2. 状态机:OpenGL 是一个状态机,这意味着你可以通过一系列的函数调用来改变它的内部状态,然后这些状态会影响后续的渲染操作。 3. 可扩展性:OpenGL 的一个重要特性是它的可扩展性。硬件制造商可以为他们的硬件特性定义新的 OpenGL 函数和参数。这些扩展可以通过 OpenGL 的扩展机制被查询和使用。 4. 跨平台和跨语言:OpenGL 可以在所有主要的操作系统(如 Windows、macOS 和 Linux)上运行,并且有各种编程语言的绑定,包括 C、C++、Python、Java 和许多其他语言。
资源推荐
资源详情
资源评论
收起资源包目录
3D引擎,渲染系统使用的OpenGL 及 OpenGL ES,Windows上OpenGL ES使用AMD的ES模拟器.zip (2000个子文件)
method-to-ir.c 435KB
marshal.c 353KB
aot-compiler.c 350KB
class.c 326KB
ttinterp.c 294KB
icall.c 252KB
mini-amd64.c 247KB
object.c 244KB
mini-s390x.c 212KB
verify.c 203KB
metadata.c 198KB
stb_vorbis.c 184KB
dlmalloc.c 177KB
mini-ppc.c 174KB
aot-runtime.c 170KB
mini-mips.c 163KB
ftobjs.c 153KB
metadata-verify.c 147KB
mini-runtime.c 146KB
stb_image.c 145KB
threads.c 142KB
sre.c 141KB
mini-arm64.c 136KB
ttgxvar.c 135KB
w32file-unix.c 132KB
ttcmap.c 122KB
mini-generic-sharing.c 120KB
assembly.c 119KB
sgen-gc.c 119KB
transform.c 118KB
w32process-unix.c 117KB
aflatin.c 114KB
ftraster.c 107KB
psintrp.c 107KB
sre-save.c 107KB
get.c 105KB
cominterop.c 105KB
mini-exceptions.c 99KB
ttgload.c 97KB
reflection.c 95KB
sgen-marksweep.c 91KB
simd-intrinsics.c 89KB
sgen-mono.c 83KB
image.c 82KB
appdomain.c 80KB
decimal-ms.c 79KB
loader.c 79KB
t1load.c 78KB
mini-codegen.c 77KB
psobjs.c 77KB
cffload.c 76KB
bdflib.c 74KB
aflatin2.c 73KB
afblue.c 73KB
cffdecode.c 72KB
deflate.c 70KB
w32socket.c 69KB
afcjk.c 69KB
ftstroke.c 68KB
pshints.c 67KB
decompose.c 65KB
t1decode.c 64KB
remoting.c 63KB
ftgrays.c 63KB
image-writer.c 62KB
custom-attrs.c 61KB
pshalgo.c 60KB
main.c 59KB
sfobjs.c 59KB
gxvcommn.c 56KB
domain.c 54KB
ttload.c 53KB
inflate.c 52KB
mono-perfcounters.c 52KB
ttobjs.c 51KB
ttsbit.c 50KB
boehm-gc.c 49KB
pcfread.c 49KB
unzip.c 48KB
abcremoval.c 47KB
cffparse.c 47KB
afhints.c 45KB
mono-threads.c 45KB
trees.c 43KB
branch-opts.c 43KB
monitor.c 41KB
ssa.c 40KB
t42parse.c 40KB
profiler.c 39KB
cffobjs.c 38KB
cffdrivr.c 38KB
security-core-clr.c 37KB
w32handle.c 37KB
dump.c 37KB
threadpool-worker-default.c 37KB
winfnt.c 36KB
sgen-debug.c 36KB
w32socket-unix.c 36KB
tramp-arm.c 35KB
afranges.c 35KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
野生的狒狒
- 粉丝: 2820
- 资源: 2233
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功