Class AICamera
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.assimp.AICamera
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class AICamera extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceHelper structure to describe a virtual camera.Cameras have a representation in the node graph and can be animated. An important aspect is that the camera itself is also part of the scenegraph. This means, any values such as the look-at vector are not *absolute*, they're relative to the coordinate system defined by the node which corresponds to the camera. This allows for camera animations. For static cameras parameters like the 'look-at' or 'up' vectors are usually specified directly in
aiCamera, but beware, they could also be encoded in the node transformation.Layout
struct aiCamera {struct aiStringmName();struct aiVector3DmPosition();struct aiVector3DmUp();struct aiVector3DmLookAt(); floatmHorizontalFOV(); floatmClipPlaneNear(); floatmClipPlaneFar(); floatmAspect(); floatmOrthographicWidth(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAICamera.BufferAn array ofAICamerastructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intMASPECT
MCLIPPLANEFAR
MCLIPPLANENEAR
MHORIZONTALFOV
MLOOKAT
MNAME
MORTHOGRAPHICWIDTH
MPOSITION
MUPThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AICamera(java.nio.ByteBuffer container)Creates aAICamerainstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static AICameracalloc()Returns a newAICamerainstance allocated withmemCalloc.static AICamera.Buffercalloc(int capacity)Returns a newAICamera.Bufferinstance allocated withmemCalloc.static AICamera.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAICamera.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AICameracalloc(org.lwjgl.system.MemoryStack stack)Returns a newAICamerainstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static AICameracallocStack()Deprecated.static AICamera.BuffercallocStack(int capacity)Deprecated.static AICamera.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static AICameracallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static AICameracreate()Returns a newAICamerainstance allocated withBufferUtils.static AICamera.Buffercreate(int capacity)Returns a newAICamera.Bufferinstance allocated withBufferUtils.static AICameracreate(long address)Returns a newAICamerainstance for the specified memory address.static AICamera.Buffercreate(long address, int capacity)Create aAICamera.Bufferinstance at the specified memory.static AICameracreateSafe(long address)static AICamera.BuffercreateSafe(long address, int capacity)static AICameramalloc()Returns a newAICamerainstance allocated withmemAlloc.static AICamera.Buffermalloc(int capacity)Returns a newAICamera.Bufferinstance allocated withmemAlloc.static AICamera.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newAICamera.Bufferinstance allocated on the specifiedMemoryStack.static AICameramalloc(org.lwjgl.system.MemoryStack stack)Returns a newAICamerainstance allocated on the specifiedMemoryStack.static AICameramallocStack()Deprecated.static AICamera.BuffermallocStack(int capacity)Deprecated.static AICamera.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static AICameramallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.floatmAspect()Screen aspect ratio.AICameramAspect(float value)Sets the specified value to themAspect()field.floatmClipPlaneFar()Distance of the far clipping plane from the camera.AICameramClipPlaneFar(float value)Sets the specified value to themClipPlaneFar()field.floatmClipPlaneNear()Distance of the near clipping plane from the camera.AICameramClipPlaneNear(float value)Sets the specified value to themClipPlaneNear()field.floatmHorizontalFOV()Horizontal field of view angle, in radians.AICameramHorizontalFOV(float value)Sets the specified value to themHorizontalFOV()field.AIVector3DmLookAt()'LookAt' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node.AICameramLookAt(java.util.function.Consumer<AIVector3D> consumer)Passes themLookAt()field to the specifiedConsumer.AICameramLookAt(AIVector3D value)Copies the specifiedAIVector3Dto themLookAt()field.AIStringmName()The name of the camera.AICameramName(java.util.function.Consumer<AIString> consumer)Passes themName()field to the specifiedConsumer.AICameramName(AIString value)floatmOrthographicWidth()Half horizontal orthographic width, in scene units.AICameramOrthographicWidth(float value)Sets the specified value to themOrthographicWidth()field.AIVector3DmPosition()Position of the camera relative to the coordinate space defined by the corresponding node.AICameramPosition(java.util.function.Consumer<AIVector3D> consumer)Passes themPosition()field to the specifiedConsumer.AICameramPosition(AIVector3D value)Copies the specifiedAIVector3Dto themPosition()field.AIVector3DmUp()'Up' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node.AICameramUp(java.util.function.Consumer<AIVector3D> consumer)Passes themUp()field to the specifiedConsumer.AICameramUp(AIVector3D value)Copies the specifiedAIVector3Dto themUp()field.static floatnmAspect(long struct)Unsafe version ofmAspect().static voidnmAspect(long struct, float value)Unsafe version ofmAspect.static floatnmClipPlaneFar(long struct)Unsafe version ofmClipPlaneFar().static voidnmClipPlaneFar(long struct, float value)Unsafe version ofmClipPlaneFar.static floatnmClipPlaneNear(long struct)Unsafe version ofmClipPlaneNear().static voidnmClipPlaneNear(long struct, float value)Unsafe version ofmClipPlaneNear.static floatnmHorizontalFOV(long struct)Unsafe version ofmHorizontalFOV().static voidnmHorizontalFOV(long struct, float value)Unsafe version ofmHorizontalFOV.static AIVector3DnmLookAt(long struct)Unsafe version ofmLookAt().static voidnmLookAt(long struct, AIVector3D value)Unsafe version ofmLookAt.static AIStringnmName(long struct)Unsafe version ofmName().static voidnmName(long struct, AIString value)Unsafe version ofmName.static floatnmOrthographicWidth(long struct)Unsafe version ofmOrthographicWidth().static voidnmOrthographicWidth(long struct, float value)Unsafe version ofmOrthographicWidth.static AIVector3DnmPosition(long struct)Unsafe version ofmPosition().static voidnmPosition(long struct, AIVector3D value)Unsafe version ofmPosition.static AIVector3DnmUp(long struct)Unsafe version ofmUp().static voidnmUp(long struct, AIVector3D value)Unsafe version ofmUp.AICameraset(AICamera src)Copies the specified struct data to this struct.AICameraset(AIString mName, AIVector3D mPosition, AIVector3D mUp, AIVector3D mLookAt, float mHorizontalFOV, float mClipPlaneNear, float mClipPlaneFar, float mAspect, float mOrthographicWidth)Initializes this struct with the specified values.intsizeof()
-
-
-
Constructor Detail
-
AICamera
public AICamera(java.nio.ByteBuffer container)
Creates aAICamerainstance 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
-
mName
public AIString mName()
The name of the camera. There must be a node in the scenegraph with the same name. This node specifies the position of the camera in the scene hierarchy and can be animated.
-
mPosition
public AIVector3D mPosition()
Position of the camera relative to the coordinate space defined by the corresponding node. The default value is 0|0|0.
-
mUp
public AIVector3D mUp()
'Up' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node. The 'right' vector of the camera coordinate system is the cross product of the up and lookAt vectors. The default value is 0|1|0. The vector may be normalized, but it needn't.
-
mLookAt
public AIVector3D mLookAt()
'LookAt' - vector of the camera coordinate system relative to the coordinate space defined by the corresponding node. This is the viewing direction of the user. The default value is0|0|1. The vector may be normalized, but it needn't.
-
mHorizontalFOV
public float mHorizontalFOV()
Horizontal field of view angle, in radians. The field of view angle is the angle between the center line of the screen and the left or right border. The default value is1/4PI.
-
mClipPlaneNear
public float mClipPlaneNear()
Distance of the near clipping plane from the camera. The value may not be 0.f (for arithmetic reasons to prevent a division through zero). The default value is 0.1f.
-
mClipPlaneFar
public float mClipPlaneFar()
Distance of the far clipping plane from the camera. The far clipping plane must, of course, be further away than the near clipping plane. The default value is 1000.f. The ratio between the near and the far plane should not be too large (between 1000-10000 should be ok) to avoid floating-point inaccuracies which could lead to z-fighting.
-
mAspect
public float mAspect()
Screen aspect ratio. This is the ration between the width and the height of the screen. Typical values are 4/3, 1/2 or 1/1. This value is 0 if the aspect ratio is not defined in the source file. 0 is also the default value.
-
mOrthographicWidth
public float mOrthographicWidth()
Half horizontal orthographic width, in scene units.The orthographic width specifies the half width of the orthographic view box. If non-zero the camera is orthographic and the
mAspectshould define to the ratio between the orthographic width and height andmHorizontalFOVshould be set to 0. The default value is 0 (not orthographic).
-
mName
public AICamera mName(java.util.function.Consumer<AIString> consumer)
Passes themName()field to the specifiedConsumer.
-
mPosition
public AICamera mPosition(AIVector3D value)
Copies the specifiedAIVector3Dto themPosition()field.
-
mPosition
public AICamera mPosition(java.util.function.Consumer<AIVector3D> consumer)
Passes themPosition()field to the specifiedConsumer.
-
mUp
public AICamera mUp(AIVector3D value)
Copies the specifiedAIVector3Dto themUp()field.
-
mUp
public AICamera mUp(java.util.function.Consumer<AIVector3D> consumer)
Passes themUp()field to the specifiedConsumer.
-
mLookAt
public AICamera mLookAt(AIVector3D value)
Copies the specifiedAIVector3Dto themLookAt()field.
-
mLookAt
public AICamera mLookAt(java.util.function.Consumer<AIVector3D> consumer)
Passes themLookAt()field to the specifiedConsumer.
-
mHorizontalFOV
public AICamera mHorizontalFOV(float value)
Sets the specified value to themHorizontalFOV()field.
-
mClipPlaneNear
public AICamera mClipPlaneNear(float value)
Sets the specified value to themClipPlaneNear()field.
-
mClipPlaneFar
public AICamera mClipPlaneFar(float value)
Sets the specified value to themClipPlaneFar()field.
-
mOrthographicWidth
public AICamera mOrthographicWidth(float value)
Sets the specified value to themOrthographicWidth()field.
-
set
public AICamera set(AIString mName, AIVector3D mPosition, AIVector3D mUp, AIVector3D mLookAt, float mHorizontalFOV, float mClipPlaneNear, float mClipPlaneFar, float mAspect, float mOrthographicWidth)
Initializes this struct with the specified values.
-
set
public AICamera set(AICamera src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static AICamera malloc()
Returns a newAICamerainstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static AICamera calloc()
Returns a newAICamerainstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static AICamera create()
Returns a newAICamerainstance allocated withBufferUtils.
-
create
public static AICamera create(long address)
Returns a newAICamerainstance for the specified memory address.
-
createSafe
@Nullable public static AICamera createSafe(long address)
-
malloc
public static AICamera.Buffer malloc(int capacity)
Returns a newAICamera.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static AICamera.Buffer calloc(int capacity)
Returns a newAICamera.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static AICamera.Buffer create(int capacity)
Returns a newAICamera.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static AICamera.Buffer create(long address, int capacity)
Create aAICamera.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static AICamera.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static AICamera mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static AICamera callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static AICamera mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static AICamera callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static AICamera.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static AICamera.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static AICamera.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static AICamera.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static AICamera malloc(org.lwjgl.system.MemoryStack stack)
Returns a newAICamerainstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static AICamera calloc(org.lwjgl.system.MemoryStack stack)
Returns a newAICamerainstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static AICamera.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAICamera.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static AICamera.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAICamera.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nmPosition
public static AIVector3D nmPosition(long struct)
Unsafe version ofmPosition().
-
nmUp
public static AIVector3D nmUp(long struct)
Unsafe version ofmUp().
-
nmLookAt
public static AIVector3D nmLookAt(long struct)
Unsafe version ofmLookAt().
-
nmHorizontalFOV
public static float nmHorizontalFOV(long struct)
Unsafe version ofmHorizontalFOV().
-
nmClipPlaneNear
public static float nmClipPlaneNear(long struct)
Unsafe version ofmClipPlaneNear().
-
nmClipPlaneFar
public static float nmClipPlaneFar(long struct)
Unsafe version ofmClipPlaneFar().
-
nmAspect
public static float nmAspect(long struct)
Unsafe version ofmAspect().
-
nmOrthographicWidth
public static float nmOrthographicWidth(long struct)
Unsafe version ofmOrthographicWidth().
-
nmPosition
public static void nmPosition(long struct, AIVector3D value)Unsafe version ofmPosition.
-
nmUp
public static void nmUp(long struct, AIVector3D value)Unsafe version ofmUp.
-
nmLookAt
public static void nmLookAt(long struct, AIVector3D value)Unsafe version ofmLookAt.
-
nmHorizontalFOV
public static void nmHorizontalFOV(long struct, float value)Unsafe version ofmHorizontalFOV.
-
nmClipPlaneNear
public static void nmClipPlaneNear(long struct, float value)Unsafe version ofmClipPlaneNear.
-
nmClipPlaneFar
public static void nmClipPlaneFar(long struct, float value)Unsafe version ofmClipPlaneFar.
-
nmAspect
public static void nmAspect(long struct, float value)Unsafe version ofmAspect.
-
nmOrthographicWidth
public static void nmOrthographicWidth(long struct, float value)Unsafe version ofmOrthographicWidth.
-
-