public class AICamera
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
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.
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.
struct aiCamera {
struct aiString mName;
struct aiVector3D mPosition;
struct aiVector3D mUp;
struct aiVector3D mLookAt;
float mHorizontalFOV;
float mClipPlaneNear;
float mClipPlaneFar;
float mAspect;
}| Modifier and Type | Class and Description |
|---|---|
static class |
AICamera.Buffer
An array of
AICamera structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
MASPECT
The struct member offsets.
|
static int |
MCLIPPLANEFAR
The struct member offsets.
|
static int |
MCLIPPLANENEAR
The struct member offsets.
|
static int |
MHORIZONTALFOV
The struct member offsets.
|
static int |
MLOOKAT
The struct member offsets.
|
static int |
MNAME
The struct member offsets.
|
static int |
MPOSITION
The struct member offsets.
|
static int |
MUP
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
AICamera(java.nio.ByteBuffer container)
Creates a
AICamera instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static AICamera |
calloc()
Returns a new
AICamera instance allocated with memCalloc. |
static AICamera.Buffer |
calloc(int capacity)
Returns a new
AICamera.Buffer instance allocated with memCalloc. |
static AICamera |
callocStack()
Returns a new
AICamera instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static AICamera.Buffer |
callocStack(int capacity)
Returns a new
AICamera.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static AICamera.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
AICamera.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static AICamera |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
AICamera instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static AICamera |
create()
Returns a new
AICamera instance allocated with BufferUtils. |
static AICamera.Buffer |
create(int capacity)
Returns a new
AICamera.Buffer instance allocated with BufferUtils. |
static AICamera |
create(long address)
Returns a new
AICamera instance for the specified memory address. |
static AICamera.Buffer |
create(long address,
int capacity)
Create a
AICamera.Buffer instance at the specified memory. |
static AICamera |
createSafe(long address)
|
static AICamera.Buffer |
createSafe(long address,
int capacity)
|
static AICamera |
malloc()
Returns a new
AICamera instance allocated with memAlloc. |
static AICamera.Buffer |
malloc(int capacity)
Returns a new
AICamera.Buffer instance allocated with memAlloc. |
static AICamera |
mallocStack()
Returns a new
AICamera instance allocated on the thread-local MemoryStack. |
static AICamera.Buffer |
mallocStack(int capacity)
Returns a new
AICamera.Buffer instance allocated on the thread-local MemoryStack. |
static AICamera.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
AICamera.Buffer instance allocated on the specified MemoryStack. |
static AICamera |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
AICamera instance allocated on the specified MemoryStack. |
float |
mAspect()
Returns the value of the
mAspect field. |
AICamera |
mAspect(float value)
Sets the specified value to the
mAspect field. |
float |
mClipPlaneFar()
Returns the value of the
mClipPlaneFar field. |
AICamera |
mClipPlaneFar(float value)
Sets the specified value to the
mClipPlaneFar field. |
float |
mClipPlaneNear()
Returns the value of the
mClipPlaneNear field. |
AICamera |
mClipPlaneNear(float value)
Sets the specified value to the
mClipPlaneNear field. |
float |
mHorizontalFOV()
Returns the value of the
mHorizontalFOV field. |
AICamera |
mHorizontalFOV(float value)
Sets the specified value to the
mHorizontalFOV field. |
AIVector3D |
mLookAt()
Returns a
AIVector3D view of the mLookAt field. |
AICamera |
mLookAt(AIVector3D value)
Copies the specified
AIVector3D to the mLookAt field. |
AICamera |
mLookAt(java.util.function.Consumer<AIVector3D> consumer)
Passes the
mLookAt field to the specified Consumer. |
AIString |
mName()
Returns a
AIString view of the mName field. |
AICamera |
mName(AIString value)
Copies the specified
AIString to the mName field. |
AICamera |
mName(java.util.function.Consumer<AIString> consumer)
Passes the
mName field to the specified Consumer. |
AIVector3D |
mPosition()
Returns a
AIVector3D view of the mPosition field. |
AICamera |
mPosition(AIVector3D value)
Copies the specified
AIVector3D to the mPosition field. |
AICamera |
mPosition(java.util.function.Consumer<AIVector3D> consumer)
Passes the
mPosition field to the specified Consumer. |
AIVector3D |
mUp()
Returns a
AIVector3D view of the mUp field. |
AICamera |
mUp(AIVector3D value)
Copies the specified
AIVector3D to the mUp field. |
AICamera |
mUp(java.util.function.Consumer<AIVector3D> consumer)
Passes the
mUp field to the specified Consumer. |
static float |
nmAspect(long struct)
Unsafe version of
mAspect(). |
static void |
nmAspect(long struct,
float value)
Unsafe version of
mAspect. |
static float |
nmClipPlaneFar(long struct)
Unsafe version of
mClipPlaneFar(). |
static void |
nmClipPlaneFar(long struct,
float value)
Unsafe version of
mClipPlaneFar. |
static float |
nmClipPlaneNear(long struct)
Unsafe version of
mClipPlaneNear(). |
static void |
nmClipPlaneNear(long struct,
float value)
Unsafe version of
mClipPlaneNear. |
static float |
nmHorizontalFOV(long struct)
Unsafe version of
mHorizontalFOV(). |
static void |
nmHorizontalFOV(long struct,
float value)
Unsafe version of
mHorizontalFOV. |
static AIVector3D |
nmLookAt(long struct)
Unsafe version of
mLookAt(). |
static void |
nmLookAt(long struct,
AIVector3D value)
Unsafe version of
mLookAt. |
static AIString |
nmName(long struct)
Unsafe version of
mName(). |
static void |
nmName(long struct,
AIString value)
Unsafe version of
mName. |
static AIVector3D |
nmPosition(long struct)
Unsafe version of
mPosition(). |
static void |
nmPosition(long struct,
AIVector3D value)
Unsafe version of
mPosition. |
static AIVector3D |
nmUp(long struct)
Unsafe version of
mUp(). |
static void |
nmUp(long struct,
AIVector3D value)
Unsafe version of
mUp. |
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() |
public static final int SIZEOF
public static final int ALIGNOF
public static final int MNAME
public static final int MPOSITION
public static final int MUP
public static final int MLOOKAT
public static final int MHORIZONTALFOV
public static final int MCLIPPLANENEAR
public static final int MCLIPPLANEFAR
public static final int MASPECT
public AICamera(java.nio.ByteBuffer container)
AICamera instance at the current position of the specified ByteBuffer 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic AIVector3D mPosition()
AIVector3D view of the mPosition field.public AIVector3D mUp()
AIVector3D view of the mUp field.public AIVector3D mLookAt()
AIVector3D view of the mLookAt field.public float mHorizontalFOV()
mHorizontalFOV field.public float mClipPlaneNear()
mClipPlaneNear field.public float mClipPlaneFar()
mClipPlaneFar field.public float mAspect()
mAspect field.public AICamera mName(java.util.function.Consumer<AIString> consumer)
mName field to the specified Consumer.public AICamera mPosition(AIVector3D value)
AIVector3D to the mPosition field.public AICamera mPosition(java.util.function.Consumer<AIVector3D> consumer)
mPosition field to the specified Consumer.public AICamera mUp(AIVector3D value)
AIVector3D to the mUp field.public AICamera mUp(java.util.function.Consumer<AIVector3D> consumer)
mUp field to the specified Consumer.public AICamera mLookAt(AIVector3D value)
AIVector3D to the mLookAt field.public AICamera mLookAt(java.util.function.Consumer<AIVector3D> consumer)
mLookAt field to the specified Consumer.public AICamera mHorizontalFOV(float value)
mHorizontalFOV field.public AICamera mClipPlaneNear(float value)
mClipPlaneNear field.public AICamera mClipPlaneFar(float value)
mClipPlaneFar field.public AICamera mAspect(float value)
mAspect field.public AICamera set(AIString mName, AIVector3D mPosition, AIVector3D mUp, AIVector3D mLookAt, float mHorizontalFOV, float mClipPlaneNear, float mClipPlaneFar, float mAspect)
public AICamera set(AICamera src)
src - the source structpublic static AICamera malloc()
AICamera instance allocated with memAlloc. The instance must be explicitly freed.public static AICamera calloc()
AICamera instance allocated with memCalloc. The instance must be explicitly freed.public static AICamera create()
AICamera instance allocated with BufferUtils.public static AICamera create(long address)
AICamera instance for the specified memory address.@Nullable public static AICamera createSafe(long address)
public static AICamera.Buffer malloc(int capacity)
AICamera.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static AICamera.Buffer calloc(int capacity)
AICamera.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static AICamera.Buffer create(int capacity)
AICamera.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static AICamera.Buffer create(long address, int capacity)
AICamera.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static AICamera.Buffer createSafe(long address, int capacity)
public static AICamera mallocStack()
AICamera instance allocated on the thread-local MemoryStack.public static AICamera callocStack()
AICamera instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static AICamera mallocStack(org.lwjgl.system.MemoryStack stack)
AICamera instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static AICamera callocStack(org.lwjgl.system.MemoryStack stack)
AICamera instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static AICamera.Buffer mallocStack(int capacity)
AICamera.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static AICamera.Buffer callocStack(int capacity)
AICamera.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static AICamera.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
AICamera.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static AICamera.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
AICamera.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static AIVector3D nmPosition(long struct)
mPosition().public static AIVector3D nmUp(long struct)
mUp().public static AIVector3D nmLookAt(long struct)
mLookAt().public static float nmHorizontalFOV(long struct)
mHorizontalFOV().public static float nmClipPlaneNear(long struct)
mClipPlaneNear().public static float nmClipPlaneFar(long struct)
mClipPlaneFar().public static float nmAspect(long struct)
mAspect().public static void nmPosition(long struct,
AIVector3D value)
mPosition.public static void nmUp(long struct,
AIVector3D value)
mUp.public static void nmLookAt(long struct,
AIVector3D value)
mLookAt.public static void nmHorizontalFOV(long struct,
float value)
mHorizontalFOV.public static void nmClipPlaneNear(long struct,
float value)
mClipPlaneNear.public static void nmClipPlaneFar(long struct,
float value)
mClipPlaneFar.public static void nmAspect(long struct,
float value)
mAspect.Copyright LWJGL. All Rights Reserved. License terms.