Assimp
v3.1.1 (June 2014)
|
Provides wrapper objects for raw data buffers. More...
Public Member Functions | |
C | wrapColor (ByteBuffer buffer, int offset) |
Wraps a RGBA color. More... | |
M4 | wrapMatrix4f (float[] data) |
Wraps a 4x4 matrix of floats. More... | |
Q | wrapQuaternion (ByteBuffer buffer, int offset) |
Wraps a quaternion. More... | |
N | wrapSceneNode (Object parent, Object matrix, int[] meshReferences, String name) |
Wraps a scene graph node. More... | |
V3 | wrapVector3f (ByteBuffer buffer, int offset, int numComponents) |
Wraps a vector. More... | |
Provides wrapper objects for raw data buffers.
It is likely that applications using Jassimp will already have a scene graph implementation and/ or the typical math related classes such as vectors, matrices, etc.
To ease the integration with existing code, Jassimp can be customized to represent the scene graph and compound data structures such as vectors and matrices with user supplied classes.
All methods returning wrapped objects rely on the AiWrapperProvider to create individual instances. Custom wrappers can be created by implementing AiWrapperProvider and registering the implementation via Jassimp#setWrapperProvider(AiWrapperProvider) before the scene is imported.
The methods returning wrapped types take an AiWrapperProvider instance. This instance must match the instance set via Jassimp#setWrapperProvider(AiWrapperProvider). The method parameter is used to infer the type of the returned object. The passed in wrapper provider is not necessarily used to actually create the wrapped object, as the object may be cached for performance reasons. It is not possible to use different AiWrapperProviders throughout the lifetime of an imported scene.
<V3> | the type used to represent vectors |
<M4> | the type used to represent matrices |
<C> | the type used to represent colors |
<N> | the type used to represent scene graph nodes |
<Q> | the type used to represent quaternions |
C jassimp.AiWrapperProvider< V3, M4, C, N, Q >.wrapColor | ( | ByteBuffer | buffer, |
int | offset | ||
) |
Wraps a RGBA color.
A color consists of 4 float values (r,g,b,a) starting from offset
buffer | the buffer to wrap |
offset | the offset into buffer |
M4 jassimp.AiWrapperProvider< V3, M4, C, N, Q >.wrapMatrix4f | ( | float [] | data | ) |
Wraps a 4x4 matrix of floats.
The calling code will allocate a new array for each invocation of this method. It is safe to store a reference to the passed in array and use the array to store the matrix data.
data | the matrix data in row-major order |
Q jassimp.AiWrapperProvider< V3, M4, C, N, Q >.wrapQuaternion | ( | ByteBuffer | buffer, |
int | offset | ||
) |
Wraps a quaternion.
A quaternion consists of 4 float values (w,x,y,z) starting from offset
buffer | the buffer to wrap |
offset | the offset into buffer |
N jassimp.AiWrapperProvider< V3, M4, C, N, Q >.wrapSceneNode | ( | Object | parent, |
Object | matrix, | ||
int [] | meshReferences, | ||
String | name | ||
) |
Wraps a scene graph node.
See AiNode for a description of the scene graph structure used by assimp.
The parent node is either null or an instance returned by this method. It is therefore safe to cast the passed in parent object to the implementation specific type
parent | the parent node |
matrix | the transformation matrix |
meshReferences | array of mesh references (indexes) |
name | the name of the node |
V3 jassimp.AiWrapperProvider< V3, M4, C, N, Q >.wrapVector3f | ( | ByteBuffer | buffer, |
int | offset, | ||
int | numComponents | ||
) |
Wraps a vector.
Most vectors are 3-dimensional, i.e., with 3 components. The exception are texture coordinates, which may be 1- or 2-dimensional. A vector consists of numComponents floats (x,y,z) starting from offset
buffer | the buffer to wrap |
offset | the offset into buffer |
numComponents | the number of components |