Package org.lwjgl.assimp
Class AILight
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.assimp.AILight
-
- All Implemented Interfaces:
org.lwjgl.system.Pointer
public class AILight extends org.lwjgl.system.StructHelper 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 subnode of a spotlights'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.
Member documentation
mName– The name of the light source. There must be a node in the scenegraph with the same name. This node specifies the position of the light in the scene hierarchy and can be animated.mType– The type of the light source.LightSource_UNDEFINEDis not a valid value for this member. One of:LightSource_DIRECTIONALLightSource_POINTLightSource_SPOTLightSource_AMBIENTLightSource_AREAmPosition– 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– 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– 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– 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– 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– 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.
Layout
struct aiLight {struct aiStringmName; aiLightSourceType mType;struct aiVector3DmPosition;struct aiVector3DmDirection;struct aiVector3DmUp; float mAttenuationConstant; float mAttenuationLinear; float mAttenuationQuadratic;struct aiColor3DmColorDiffuse;struct aiColor3DmColorSpecular;struct aiColor3DmColorAmbient; float mAngleInnerCone; float mAngleOuterCone;struct aiVector2DmSize; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAILight.BufferAn array ofAILightstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intMANGLEINNERCONE
MANGLEOUTERCONE
MATTENUATIONCONSTANT
MATTENUATIONLINEAR
MATTENUATIONQUADRATIC
MCOLORAMBIENT
MCOLORDIFFUSE
MCOLORSPECULAR
MDIRECTION
MNAME
MPOSITION
MSIZE
MTYPE
MUPThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description AILight(java.nio.ByteBuffer container)Creates aAILightinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AILightcreate(long address)Returns a newAILightinstance for the specified memory address.static AILight.Buffercreate(long address, int capacity)Create aAILight.Bufferinstance at the specified memory.static AILightcreateSafe(long address)static AILight.BuffercreateSafe(long address, int capacity)floatmAngleInnerCone()Returns the value of themAngleInnerConefield.floatmAngleOuterCone()Returns the value of themAngleOuterConefield.floatmAttenuationConstant()Returns the value of themAttenuationConstantfield.floatmAttenuationLinear()Returns the value of themAttenuationLinearfield.floatmAttenuationQuadratic()Returns the value of themAttenuationQuadraticfield.AIColor3DmColorAmbient()Returns aAIColor3Dview of themColorAmbientfield.AIColor3DmColorDiffuse()Returns aAIColor3Dview of themColorDiffusefield.AIColor3DmColorSpecular()Returns aAIColor3Dview of themColorSpecularfield.AIVector3DmDirection()Returns aAIVector3Dview of themDirectionfield.AIStringmName()Returns aAIStringview of themNamefield.AIVector3DmPosition()Returns aAIVector3Dview of themPositionfield.AIVector2DmSize()Returns aAIVector2Dview of themSizefield.intmType()Returns the value of themTypefield.AIVector3DmUp()Returns aAIVector3Dview of themUpfield.static floatnmAngleInnerCone(long struct)Unsafe version ofmAngleInnerCone().static floatnmAngleOuterCone(long struct)Unsafe version ofmAngleOuterCone().static floatnmAttenuationConstant(long struct)Unsafe version ofmAttenuationConstant().static floatnmAttenuationLinear(long struct)Unsafe version ofmAttenuationLinear().static floatnmAttenuationQuadratic(long struct)Unsafe version ofmAttenuationQuadratic().static AIColor3DnmColorAmbient(long struct)Unsafe version ofmColorAmbient().static AIColor3DnmColorDiffuse(long struct)Unsafe version ofmColorDiffuse().static AIColor3DnmColorSpecular(long struct)Unsafe version ofmColorSpecular().static AIVector3DnmDirection(long struct)Unsafe version ofmDirection().static AIStringnmName(long struct)Unsafe version ofmName().static AIVector3DnmPosition(long struct)Unsafe version ofmPosition().static AIVector2DnmSize(long struct)Unsafe version ofmSize().static intnmType(long struct)Unsafe version ofmType().static AIVector3DnmUp(long struct)Unsafe version ofmUp().intsizeof()
-
-
-
Field Detail
-
SIZEOF
The struct size in bytes.
-
ALIGNOF
The struct alignment in bytes.
-
MNAME, MTYPE, MPOSITION, MDIRECTION, MUP, MATTENUATIONCONSTANT, MATTENUATIONLINEAR, MATTENUATIONQUADRATIC, MCOLORDIFFUSE, MCOLORSPECULAR, MCOLORAMBIENT, MANGLEINNERCONE, MANGLEOUTERCONE, MSIZE
The struct member offsets.
-
-
Constructor Detail
-
AILight
public AILight(java.nio.ByteBuffer container)
Creates aAILightinstance 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
-
mType
public int mType()
Returns the value of themTypefield.
-
mPosition
public AIVector3D mPosition()
Returns aAIVector3Dview of themPositionfield.
-
mDirection
public AIVector3D mDirection()
Returns aAIVector3Dview of themDirectionfield.
-
mUp
public AIVector3D mUp()
Returns aAIVector3Dview of themUpfield.
-
mAttenuationConstant
public float mAttenuationConstant()
Returns the value of themAttenuationConstantfield.
-
mAttenuationLinear
public float mAttenuationLinear()
Returns the value of themAttenuationLinearfield.
-
mAttenuationQuadratic
public float mAttenuationQuadratic()
Returns the value of themAttenuationQuadraticfield.
-
mColorSpecular
public AIColor3D mColorSpecular()
Returns aAIColor3Dview of themColorSpecularfield.
-
mAngleInnerCone
public float mAngleInnerCone()
Returns the value of themAngleInnerConefield.
-
mAngleOuterCone
public float mAngleOuterCone()
Returns the value of themAngleOuterConefield.
-
mSize
public AIVector2D mSize()
Returns aAIVector2Dview of themSizefield.
-
create
public static AILight create(long address)
Returns a newAILightinstance for the specified memory address.
-
createSafe
@Nullable public static AILight createSafe(long address)
-
create
public static AILight.Buffer create(long address, int capacity)
Create aAILight.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static AILight.Buffer createSafe(long address, int capacity)
-
nmType
public static int nmType(long struct)
Unsafe version ofmType().
-
nmPosition
public static AIVector3D nmPosition(long struct)
Unsafe version ofmPosition().
-
nmDirection
public static AIVector3D nmDirection(long struct)
Unsafe version ofmDirection().
-
nmUp
public static AIVector3D nmUp(long struct)
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
public static AIColor3D nmColorDiffuse(long struct)
Unsafe version ofmColorDiffuse().
-
nmColorSpecular
public static AIColor3D nmColorSpecular(long struct)
Unsafe version ofmColorSpecular().
-
nmColorAmbient
public static AIColor3D nmColorAmbient(long struct)
Unsafe version ofmColorAmbient().
-
nmAngleInnerCone
public static float nmAngleInnerCone(long struct)
Unsafe version ofmAngleInnerCone().
-
nmAngleOuterCone
public static float nmAngleOuterCone(long struct)
Unsafe version ofmAngleOuterCone().
-
nmSize
public static AIVector2D nmSize(long struct)
Unsafe version ofmSize().
-
-