Package org.lwjgl.assimp
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.NativeResource
Helper 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.Member documentation
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
– Position of the camera relative to the coordinate space defined by the corresponding node. The default value is 0|0|0.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
– '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 is 0|0|1. The vector may be normalized, but it needn't.mHorizontalFOV
– Half 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 is 1/4PI.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
– 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
– 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.
Layout
struct aiCamera {
struct aiString
mName;struct aiVector3D
mPosition;struct aiVector3D
mUp;struct aiVector3D
mLookAt; float mHorizontalFOV; float mClipPlaneNear; float mClipPlaneFar; float mAspect; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AICamera.Buffer
An array ofAICamera
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
MASPECT
MCLIPPLANEFAR
MCLIPPLANENEAR
MHORIZONTALFOV
MLOOKAT
MNAME
MPOSITION
MUPThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AICamera(java.nio.ByteBuffer container)
Creates aAICamera
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AICamera
calloc()
Returns a newAICamera
instance allocated withmemCalloc
.static AICamera.Buffer
calloc(int capacity)
Returns a newAICamera.Buffer
instance allocated withmemCalloc
.static AICamera
callocStack()
Returns a newAICamera
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static AICamera.Buffer
callocStack(int capacity)
Returns a newAICamera.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static AICamera.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAICamera.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static AICamera
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAICamera
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static AICamera
create()
Returns a newAICamera
instance allocated withBufferUtils
.static AICamera.Buffer
create(int capacity)
Returns a newAICamera.Buffer
instance allocated withBufferUtils
.static AICamera
create(long address)
Returns a newAICamera
instance for the specified memory address.static AICamera.Buffer
create(long address, int capacity)
Create aAICamera.Buffer
instance at the specified memory.static AICamera
createSafe(long address)
static AICamera.Buffer
createSafe(long address, int capacity)
static AICamera
malloc()
Returns a newAICamera
instance allocated withmemAlloc
.static AICamera.Buffer
malloc(int capacity)
Returns a newAICamera.Buffer
instance allocated withmemAlloc
.static AICamera
mallocStack()
Returns a newAICamera
instance allocated on the thread-localMemoryStack
.static AICamera.Buffer
mallocStack(int capacity)
Returns a newAICamera.Buffer
instance allocated on the thread-localMemoryStack
.static AICamera.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAICamera.Buffer
instance allocated on the specifiedMemoryStack
.static AICamera
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAICamera
instance allocated on the specifiedMemoryStack
.float
mAspect()
Returns the value of themAspect
field.AICamera
mAspect(float value)
Sets the specified value to themAspect
field.float
mClipPlaneFar()
Returns the value of themClipPlaneFar
field.AICamera
mClipPlaneFar(float value)
Sets the specified value to themClipPlaneFar
field.float
mClipPlaneNear()
Returns the value of themClipPlaneNear
field.AICamera
mClipPlaneNear(float value)
Sets the specified value to themClipPlaneNear
field.float
mHorizontalFOV()
Returns the value of themHorizontalFOV
field.AICamera
mHorizontalFOV(float value)
Sets the specified value to themHorizontalFOV
field.AIVector3D
mLookAt()
Returns aAIVector3D
view of themLookAt
field.AICamera
mLookAt(java.util.function.Consumer<AIVector3D> consumer)
Passes themLookAt
field to the specifiedConsumer
.AICamera
mLookAt(AIVector3D value)
Copies the specifiedAIVector3D
to themLookAt
field.AIString
mName()
Returns aAIString
view of themName
field.AICamera
mName(java.util.function.Consumer<AIString> consumer)
Passes themName
field to the specifiedConsumer
.AICamera
mName(AIString value)
Copies the specifiedAIString
to themName
field.AIVector3D
mPosition()
Returns aAIVector3D
view of themPosition
field.AICamera
mPosition(java.util.function.Consumer<AIVector3D> consumer)
Passes themPosition
field to the specifiedConsumer
.AICamera
mPosition(AIVector3D value)
Copies the specifiedAIVector3D
to themPosition
field.AIVector3D
mUp()
Returns aAIVector3D
view of themUp
field.AICamera
mUp(java.util.function.Consumer<AIVector3D> consumer)
Passes themUp
field to the specifiedConsumer
.AICamera
mUp(AIVector3D value)
Copies the specifiedAIVector3D
to themUp
field.static float
nmAspect(long struct)
Unsafe version ofmAspect()
.static void
nmAspect(long struct, float value)
Unsafe version ofmAspect
.static float
nmClipPlaneFar(long struct)
Unsafe version ofmClipPlaneFar()
.static void
nmClipPlaneFar(long struct, float value)
Unsafe version ofmClipPlaneFar
.static float
nmClipPlaneNear(long struct)
Unsafe version ofmClipPlaneNear()
.static void
nmClipPlaneNear(long struct, float value)
Unsafe version ofmClipPlaneNear
.static float
nmHorizontalFOV(long struct)
Unsafe version ofmHorizontalFOV()
.static void
nmHorizontalFOV(long struct, float value)
Unsafe version ofmHorizontalFOV
.static AIVector3D
nmLookAt(long struct)
Unsafe version ofmLookAt()
.static void
nmLookAt(long struct, AIVector3D value)
Unsafe version ofmLookAt
.static AIString
nmName(long struct)
Unsafe version ofmName()
.static void
nmName(long struct, AIString value)
Unsafe version ofmName
.static AIVector3D
nmPosition(long struct)
Unsafe version ofmPosition()
.static void
nmPosition(long struct, AIVector3D value)
Unsafe version ofmPosition
.static AIVector3D
nmUp(long struct)
Unsafe version ofmUp()
.static void
nmUp(long struct, AIVector3D value)
Unsafe version ofmUp
.AICamera
set(AICamera src)
Copies the specified struct data to this struct.AICamera
set(AIString mName, AIVector3D mPosition, AIVector3D mUp, AIVector3D mLookAt, float mHorizontalFOV, float mClipPlaneNear, float mClipPlaneFar, float mAspect)
Initializes this struct with the specified values.int
sizeof()
-
-
-
Constructor Detail
-
AICamera
public AICamera(java.nio.ByteBuffer container)
Creates aAICamera
instance at the current position of the specifiedByteBuffer
container. 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:
sizeof
in classorg.lwjgl.system.Struct
-
mPosition
public AIVector3D mPosition()
Returns aAIVector3D
view of themPosition
field.
-
mUp
public AIVector3D mUp()
Returns aAIVector3D
view of themUp
field.
-
mLookAt
public AIVector3D mLookAt()
Returns aAIVector3D
view of themLookAt
field.
-
mHorizontalFOV
public float mHorizontalFOV()
Returns the value of themHorizontalFOV
field.
-
mClipPlaneNear
public float mClipPlaneNear()
Returns the value of themClipPlaneNear
field.
-
mClipPlaneFar
public float mClipPlaneFar()
Returns the value of themClipPlaneFar
field.
-
mAspect
public float mAspect()
Returns the value of themAspect
field.
-
mName
public AICamera mName(java.util.function.Consumer<AIString> consumer)
Passes themName
field to the specifiedConsumer
.
-
mPosition
public AICamera mPosition(AIVector3D value)
Copies the specifiedAIVector3D
to 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 specifiedAIVector3D
to 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 specifiedAIVector3D
to 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.
-
mAspect
public AICamera mAspect(float value)
Sets the specified value to themAspect
field.
-
set
public AICamera set(AIString mName, AIVector3D mPosition, AIVector3D mUp, AIVector3D mLookAt, float mHorizontalFOV, float mClipPlaneNear, float mClipPlaneFar, float mAspect)
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 newAICamera
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static AICamera calloc()
Returns a newAICamera
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static AICamera create()
Returns a newAICamera
instance allocated withBufferUtils
.
-
create
public static AICamera create(long address)
Returns a newAICamera
instance for the specified memory address.
-
createSafe
@Nullable public static AICamera createSafe(long address)
-
malloc
public static AICamera.Buffer malloc(int capacity)
Returns a newAICamera.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static AICamera.Buffer calloc(int capacity)
Returns a newAICamera.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static AICamera.Buffer create(int capacity)
Returns a newAICamera.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static AICamera.Buffer create(long address, int capacity)
Create aAICamera.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static AICamera.Buffer createSafe(long address, int capacity)
-
mallocStack
public static AICamera mallocStack()
Returns a newAICamera
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static AICamera callocStack()
Returns a newAICamera
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static AICamera mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAICamera
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static AICamera callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newAICamera
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static AICamera.Buffer mallocStack(int capacity)
Returns a newAICamera.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static AICamera.Buffer callocStack(int capacity)
Returns a newAICamera.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static AICamera.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAICamera.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static AICamera.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newAICamera.Buffer
instance allocated on the specifiedMemoryStack
and 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()
.
-
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
.
-
-