Package org.lwjgl.assimp
Class AIUVTransform
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.assimp.AIUVTransform
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class AIUVTransform extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceDefines how an UV channel is transformed.This is just a helper structure for the
Assimp._AI_MATKEY_UVTRANSFORM_BASEkey. See its documentation for more details.Typically you'll want to build a matrix of this information. However, we keep separate scaling/translation/rotation values to make it easier to process and optimize UV transformations internally.
Member documentation
mTranslation– Translation on the u and v axes. The default value is (0|0).mScaling– Scaling on the u and v axes. The default value is (1|1).mRotation– Rotation - in counter-clockwise direction. The rotation angle is specified in radians. The rotation center is 0.5f|0.5f. The default value 0.f.
Layout
struct aiUVTransform {struct aiVector2DmTranslation;struct aiVector2DmScaling; float mRotation; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAIUVTransform.BufferAn array ofAIUVTransformstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intMROTATION
MSCALING
MTRANSLATIONThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AIUVTransform(java.nio.ByteBuffer container)Creates aAIUVTransforminstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AIUVTransformcalloc()Returns a newAIUVTransforminstance allocated withmemCalloc.static AIUVTransform.Buffercalloc(int capacity)Returns a newAIUVTransform.Bufferinstance allocated withmemCalloc.static AIUVTransformcallocStack()Returns a newAIUVTransforminstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static AIUVTransform.BuffercallocStack(int capacity)Returns a newAIUVTransform.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static AIUVTransform.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAIUVTransform.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AIUVTransformcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newAIUVTransforminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AIUVTransformcreate()Returns a newAIUVTransforminstance allocated withBufferUtils.static AIUVTransform.Buffercreate(int capacity)Returns a newAIUVTransform.Bufferinstance allocated withBufferUtils.static AIUVTransformcreate(long address)Returns a newAIUVTransforminstance for the specified memory address.static AIUVTransform.Buffercreate(long address, int capacity)Create aAIUVTransform.Bufferinstance at the specified memory.static AIUVTransformcreateSafe(long address)static AIUVTransform.BuffercreateSafe(long address, int capacity)static AIUVTransformmalloc()Returns a newAIUVTransforminstance allocated withmemAlloc.static AIUVTransform.Buffermalloc(int capacity)Returns a newAIUVTransform.Bufferinstance allocated withmemAlloc.static AIUVTransformmallocStack()Returns a newAIUVTransforminstance allocated on the thread-localMemoryStack.static AIUVTransform.BuffermallocStack(int capacity)Returns a newAIUVTransform.Bufferinstance allocated on the thread-localMemoryStack.static AIUVTransform.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAIUVTransform.Bufferinstance allocated on the specifiedMemoryStack.static AIUVTransformmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newAIUVTransforminstance allocated on the specifiedMemoryStack.floatmRotation()Returns the value of themRotationfield.AIVector2DmScaling()Returns aAIVector2Dview of themScalingfield.AIVector2DmTranslation()Returns aAIVector2Dview of themTranslationfield.static floatnmRotation(long struct)Unsafe version ofmRotation().static AIVector2DnmScaling(long struct)Unsafe version ofmScaling().static AIVector2DnmTranslation(long struct)Unsafe version ofmTranslation().intsizeof()
-
-
-
Constructor Detail
-
AIUVTransform
public AIUVTransform(java.nio.ByteBuffer container)
Creates aAIUVTransforminstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
mTranslation
public AIVector2D mTranslation()
Returns aAIVector2Dview of themTranslationfield.
-
mScaling
public AIVector2D mScaling()
Returns aAIVector2Dview of themScalingfield.
-
mRotation
public float mRotation()
Returns the value of themRotationfield.
-
malloc
public static AIUVTransform malloc()
Returns a newAIUVTransforminstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static AIUVTransform calloc()
Returns a newAIUVTransforminstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static AIUVTransform create()
Returns a newAIUVTransforminstance allocated withBufferUtils.
-
create
public static AIUVTransform create(long address)
Returns a newAIUVTransforminstance for the specified memory address.
-
createSafe
@Nullable public static AIUVTransform createSafe(long address)
-
malloc
public static AIUVTransform.Buffer malloc(int capacity)
Returns a newAIUVTransform.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static AIUVTransform.Buffer calloc(int capacity)
Returns a newAIUVTransform.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static AIUVTransform.Buffer create(int capacity)
Returns a newAIUVTransform.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static AIUVTransform.Buffer create(long address, int capacity)
Create aAIUVTransform.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static AIUVTransform.Buffer createSafe(long address, int capacity)
-
mallocStack
public static AIUVTransform mallocStack()
Returns a newAIUVTransforminstance allocated on the thread-localMemoryStack.
-
callocStack
public static AIUVTransform callocStack()
Returns a newAIUVTransforminstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static AIUVTransform mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAIUVTransforminstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static AIUVTransform callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAIUVTransforminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static AIUVTransform.Buffer mallocStack(int capacity)
Returns a newAIUVTransform.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static AIUVTransform.Buffer callocStack(int capacity)
Returns a newAIUVTransform.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static AIUVTransform.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAIUVTransform.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static AIUVTransform.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAIUVTransform.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nmTranslation
public static AIVector2D nmTranslation(long struct)
Unsafe version ofmTranslation().
-
nmScaling
public static AIVector2D nmScaling(long struct)
Unsafe version ofmScaling().
-
nmRotation
public static float nmRotation(long struct)
Unsafe version ofmRotation().
-
-