Package org.lwjgl.assimp
Class AILight
- All Implemented Interfaces:
Pointer
Helper structure to describe a light source.
Assimp supports multiple sorts of light sources, including directional, point and spot lights. All of them are defined with just a single structure and distinguished by their parameters. Note - some file formats (such as 3DS, ASE) export a "target point" - the point a spot light is looking at (it can even be animated). Assimp writes the target point as a sub-node of a spot-lights's main node, called "<spotName>.Target". However, this is just additional information then, the transformation tracks of the main node make the spot light already point in the right direction.
Layout
struct aiLight {
struct aiString
mName()
;
aiLightSourceType mType()
;
struct aiVector3D
mPosition()
;
struct aiVector3D
mDirection()
;
struct aiVector3D
mUp()
;
float mAttenuationConstant()
;
float mAttenuationLinear()
;
float mAttenuationQuadratic()
;
struct aiColor3D
mColorDiffuse()
;
struct aiColor3D
mColorSpecular()
;
struct aiColor3D
mColorAmbient()
;
float mAngleInnerCone()
;
float mAngleOuterCone()
;
struct aiVector2D
mSize()
;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionAILight
(ByteBuffer container) Creates aAILight
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic AILight
create
(long address) Returns a newAILight
instance for the specified memory address.static AILight.Buffer
create
(long address, int capacity) Create aAILight.Buffer
instance at the specified memory.static AILight
createSafe
(long address) static AILight.Buffer
createSafe
(long address, int capacity) float
Inner angle of a spot light's light cone.float
Outer angle of a spot light's light cone.float
Constant light attenuation factor.float
Linear light attenuation factor.float
Quadratic light attenuation factor.Ambient color of the light source.Diffuse color of the light source.Specular color of the light source.Direction of the light source in space.mName()
The name of the light source.Position of the light source in space.mSize()
Size of area light source.int
mType()
The type of the light source.mUp()
Up direction of the light source in space.static float
nmAngleInnerCone
(long struct) Unsafe version ofmAngleInnerCone()
.static float
nmAngleOuterCone
(long struct) Unsafe version ofmAngleOuterCone()
.static float
nmAttenuationConstant
(long struct) Unsafe version ofmAttenuationConstant()
.static float
nmAttenuationLinear
(long struct) Unsafe version ofmAttenuationLinear()
.static float
nmAttenuationQuadratic
(long struct) Unsafe version ofmAttenuationQuadratic()
.static AIColor3D
nmColorAmbient
(long struct) Unsafe version ofmColorAmbient()
.static AIColor3D
nmColorDiffuse
(long struct) Unsafe version ofmColorDiffuse()
.static AIColor3D
nmColorSpecular
(long struct) Unsafe version ofmColorSpecular()
.static AIVector3D
nmDirection
(long struct) Unsafe version ofmDirection()
.static AIString
nmName
(long struct) Unsafe version ofmName()
.static AIVector3D
nmPosition
(long struct) Unsafe version ofmPosition()
.static AIVector2D
nmSize
(long struct) Unsafe version ofmSize()
.static int
nmType
(long struct) Unsafe version ofmType()
.static AIVector3D
nmUp
(long struct) Unsafe version ofmUp()
.int
sizeof()
Returnssizeof(struct)
.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
MNAME
public static final int MNAMEThe struct member offsets. -
MTYPE
public static final int MTYPEThe struct member offsets. -
MPOSITION
public static final int MPOSITIONThe struct member offsets. -
MDIRECTION
public static final int MDIRECTIONThe struct member offsets. -
MUP
public static final int MUPThe struct member offsets. -
MATTENUATIONCONSTANT
public static final int MATTENUATIONCONSTANTThe struct member offsets. -
MATTENUATIONLINEAR
public static final int MATTENUATIONLINEARThe struct member offsets. -
MATTENUATIONQUADRATIC
public static final int MATTENUATIONQUADRATICThe struct member offsets. -
MCOLORDIFFUSE
public static final int MCOLORDIFFUSEThe struct member offsets. -
MCOLORSPECULAR
public static final int MCOLORSPECULARThe struct member offsets. -
MCOLORAMBIENT
public static final int MCOLORAMBIENTThe struct member offsets. -
MANGLEINNERCONE
public static final int MANGLEINNERCONEThe struct member offsets. -
MANGLEOUTERCONE
public static final int MANGLEOUTERCONEThe struct member offsets. -
MSIZE
public static final int MSIZEThe struct member offsets.
-
-
Constructor Details
-
AILight
Creates aAILight
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 Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
. -
mName
The name of the light source. There must be a node in the scene-graph with the same name. This node specifies the position of the light in the scene hierarchy and can be animated. -
mType
public int mType()The type of the light source.LightSource_UNDEFINED
is not a valid value for this member. One of:LightSource_DIRECTIONAL
LightSource_POINT
LightSource_SPOT
LightSource_AMBIENT
LightSource_AREA
-
mPosition
Position of the light source in space. Relative to the transformation of the node corresponding to the light. The position is undefined for directional lights. -
mDirection
Direction of the light source in space. Relative to the transformation of the node corresponding to the light. The direction is undefined for point lights. The vector may be normalized, but it needn't. -
mUp
Up direction of the light source in space. Relative to the transformation of the node corresponding to the light. The direction is undefined for point lights. The vector may be normalized, but it needn't. -
mAttenuationConstant
public float mAttenuationConstant()Constant light attenuation factor. The intensity of the light source at a given distance 'd' from the light's position isAtten = 1/( att0 + att1 * d + att2 * d*d)
. This member corresponds to the att0 variable in the equation. Naturally undefined for directional lights. -
mAttenuationLinear
public float mAttenuationLinear()Linear light attenuation factor. The intensity of the light source at a given distance 'd' from the light's position isAtten = 1/( att0 + att1 * d + att2 * d*d)
. This member corresponds to the att1 variable in the equation. Naturally undefined for directional lights. -
mAttenuationQuadratic
public float mAttenuationQuadratic()Quadratic light attenuation factor. The intensity of the light source at a given distance 'd' from the light's position isAtten = 1/( att0 + att1 * d + att2 * d*d)
. This member corresponds to the att2 variable in the equation. Naturally undefined for directional lights. -
mColorDiffuse
Diffuse color of the light source. The diffuse light color is multiplied with the diffuse material color to obtain the final color that contributes to the diffuse shading term. -
mColorSpecular
Specular color of the light source. The specular light color is multiplied with the specular material color to obtain the final color that contributes to the specular shading term. -
mColorAmbient
Ambient color of the light source. The ambient light color is multiplied with the ambient material color to obtain the final color that contributes to the ambient shading term. Most renderers will ignore this value it, is just a remaining of the fixed-function pipeline that is still supported by quite many file formats. -
mAngleInnerCone
public float mAngleInnerCone()Inner angle of a spot light's light cone. The spot light has maximum influence on objects inside this angle. The angle is given in radians. It is 2PI for point lights and undefined for directional lights. -
mAngleOuterCone
public float mAngleOuterCone()Outer angle of a spot light's light cone. The spot light does not affect objects outside this angle. The angle is given in radians. It is 2PI for point lights and undefined for directional lights. The outer angle must be greater than or equal to the inner angle. It is assumed that the application uses a smooth interpolation between the inner and the outer cone of the spot light. -
mSize
Size of area light source. -
create
Returns a newAILight
instance for the specified memory address. -
createSafe
-
create
Create aAILight.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
nmName
Unsafe version ofmName()
. -
nmType
public static int nmType(long struct) Unsafe version ofmType()
. -
nmPosition
Unsafe version ofmPosition()
. -
nmDirection
Unsafe version ofmDirection()
. -
nmUp
Unsafe version ofmUp()
. -
nmAttenuationConstant
public static float nmAttenuationConstant(long struct) Unsafe version ofmAttenuationConstant()
. -
nmAttenuationLinear
public static float nmAttenuationLinear(long struct) Unsafe version ofmAttenuationLinear()
. -
nmAttenuationQuadratic
public static float nmAttenuationQuadratic(long struct) Unsafe version ofmAttenuationQuadratic()
. -
nmColorDiffuse
Unsafe version ofmColorDiffuse()
. -
nmColorSpecular
Unsafe version ofmColorSpecular()
. -
nmColorAmbient
Unsafe version ofmColorAmbient()
. -
nmAngleInnerCone
public static float nmAngleInnerCone(long struct) Unsafe version ofmAngleInnerCone()
. -
nmAngleOuterCone
public static float nmAngleOuterCone(long struct) Unsafe version ofmAngleOuterCone()
. -
nmSize
Unsafe version ofmSize()
.
-