Assimp  v4.1. (December 2018)
jassimp.AiWrapperProvider< V3, M4, C, N, Q > Interface Template Reference

Provides wrapper objects for raw data buffers. More...

Public Member Functions

wrapColor (ByteBuffer buffer, int offset)
 Wraps a RGBA color. More...
 
M4 wrapMatrix4f (float[] data)
 Wraps a 4x4 matrix of floats. More...
 
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...
 

Detailed Description

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.

Parameters
<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

Member Function Documentation

◆ wrapColor()

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

Parameters
bufferthe buffer to wrap
offsetthe offset into buffer
Returns
the wrapped color

◆ wrapMatrix4f()

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.

Parameters
datathe matrix data in row-major order
Returns
the wrapped matrix

◆ wrapQuaternion()

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

Parameters
bufferthe buffer to wrap
offsetthe offset into buffer
Returns
the wrapped quaternion

◆ wrapSceneNode()

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

Parameters
parentthe parent node
matrixthe transformation matrix
meshReferencesarray of mesh references (indexes)
namethe name of the node
Returns
the wrapped scene graph node

◆ wrapVector3f()

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

Parameters
bufferthe buffer to wrap
offsetthe offset into buffer
numComponentsthe number of components
Returns
the wrapped vector

The documentation for this interface was generated from the following file: