AR_Engine_SDK
Functions | Variables
XLightBase.lua File Reference
类 IXLightManager 继承关系图:
Inheritance graph
类 IXLightBase 继承关系图:
Inheritance graph
类 IXDirectionLight 继承关系图:
Inheritance graph
类 IXEnvironmentLight 继承关系图:
Inheritance graph
类 IXPointLight 继承关系图:
Inheritance graph
类 IXSpotLight 继承关系图:
Inheritance graph

Functions

function XPointLightDesc new () end
 @type XCOLORBASE More...
 
function XPointLightDesc new (_clrColorVal, _fLuminance, _vPos, _fRadius, _fFallOffExponent) end
 
function XSpotLightDesc new (_clrColorVal, _fLuminance, _vPos, _vDir, _fRadius, _fFallOffExponent, _fConeInnerAngle, _fConeOuterAngle) end
 
function IXLightManager Init () end
 
function IXLightManager Release () end
 
function IXLightManager CreateDirectionLight (vDir, clrColorVal, fLuminance) end
 
function IXLightManager CreateEnvironmentLight (clrColorVal, fLuminance) end
 
function IXLightManager CreatePointLight (desc) end
 
function IXLightManager CreateSpotLight (desc) end
 
function IXLightManager ReleaseLight (pLight) end
 
function IXLightBase GetType () end
 
function IXLightBase GetAABB () end
 
function IXLightBase GetRadius () end
 
function IXLightBase GetColor () end
 
function IXLightBase GetColorValue () end
 
function IXLightBase GetLuminance () end
 
function IXLightBase SetColorValue (clrColorVal) end
 
function IXLightBase SetLuminance (fLuminance) end
 
function IXLightBase IsEnable () end
 
function IXLightBase Enable (enabled) end
 
function IXLightBase IsCastShadow () end
 
function IXLightBase EnableCastShadow (bEnabled) end
 
function IXLightBase GetBeLightedPrimitives (primitives, lightedPrimitives) end
 
function IXLightBase GetBeLightedPrimitives (primitives) end
 
function IXDirectionLight GetDir () end
 
function IXDirectionLight SetDir (vDir) end
 
function IXPointLight GetPos () end
 
function IXPointLight SetPos (vPos) end
 
function IXPointLight SetRadius (fRadius) end
 
function IXPointLight GetFallOffExponent () end
 
function IXPointLight SetFallOffExponent (fFallOffExponent) end
 
function IXSpotLight GetConeInnerAngle () end
 
function IXSpotLight SetConeInnerAngle (fAngle) end
 
function IXSpotLight GetConeOuterAngle () end
 
function IXSpotLight SetConeOuterAngle (fAngle) end
 

Variables

 XLT_DIRECTION = 0
 
 XLT_POINT = 0
 
 XLT_SPOT = 0
 
 XLT_ENV = 0
 
 XLT_NUM = 0
 
 XPointLightDesc = {}
 
XPointLightDesc clrColorVal = {}
 @type XCOLORBASE More...
 
XPointLightDesc fLuminance = 0
 @type number More...
 
XPointLightDesc vPos = {}
 @type XVECTOR3 More...
 
XPointLightDesc fRadius = 0
 @type number More...
 
XPointLightDesc fFallOffExponent = 0
 @type number More...
 

Function Documentation

◆ CreateDirectionLight()

function IXLightManager CreateDirectionLight ( vDir  ,
clrColorVal  ,
fLuminance   
)

创建方向光,并设置光源颜色、方向和强度

Parameters
vDirXVECTOR3 平行光的方向,单位化的向量
clrColorValXCOLORBASE 光源颜色
fLuminancenumber 光照强度
Returns
IXLightBase 创建的方向光对象指针

◆ CreateEnvironmentLight()

function IXLightManager CreateEnvironmentLight ( clrColorVal  ,
fLuminance   
)

创建环境光对象,并设置光源颜色和强度

Parameters
clrColorValXCOLORBASE 光源颜色
fLuminancenumber 光照强度
Returns
IXLightBase 创建的环境光对象指针

◆ CreatePointLight()

function IXLightManager CreatePointLight ( desc  )

创建点光源对象,并设置光源参数

Parameters
descXPointLightDesc 点光源参数结构体
Returns
IXLightBase

◆ CreateSpotLight()

function IXLightManager CreateSpotLight ( desc  )

创建聚光源对象,并设置光源参数

Parameters
descXSpotLightDesc 聚光源参数结构体
Returns
IXLightBase

◆ Enable()

function IXLightBase Enable ( enabled  )

设置光源是否开启

Parameters
enabledboolean 光源是否开启
Returns
void

◆ EnableCastShadow()

function IXLightBase EnableCastShadow ( bEnabled  )

开启或关闭投射阴影

Parameters
bEnabledboolean 开启或关闭投射阴影
Returns
void

◆ GetAABB()

function IXLightBase GetAABB ( )

获取光源AABB包围盒信息

Returns
XCusAABB 光源AABB包围盒信息

◆ GetBeLightedPrimitives() [1/2]

function IXLightBase GetBeLightedPrimitives ( primitives  ,
lightedPrimitives   
)

IXLightBase_GetBeLightedPrimitives00

Parameters
primitivesIXPrimitiveBase[]
lightedPrimitivesIXPrimitiveBase[]
Returns
void

◆ GetBeLightedPrimitives() [2/2]

function IXLightBase GetBeLightedPrimitives ( primitives  )

IXLightBase_GetBeLightedPrimitives01

Parameters
primitivesIXPrimitiveBase[]
Returns
IXPrimitiveBase[]
void

◆ GetColor()

function IXLightBase GetColor ( )

获取光源颜色

Returns
number 光源颜色(XCOLOR格式)

◆ GetColorValue()

function IXLightBase GetColorValue ( )

获取光源颜色

Returns
XCOLORBASE 光源颜色(XCOLORBASE格式)

◆ GetConeInnerAngle()

function IXSpotLight GetConeInnerAngle ( )

获取聚光源内锥角

Returns
number 聚光源内锥角大小

◆ GetConeOuterAngle()

function IXSpotLight GetConeOuterAngle ( )

获取聚光源外锥角

Returns
number 聚光源外锥角大小

◆ GetDir()

function IXDirectionLight GetDir ( )

获取方向光方向

Returns
XVECTOR3 方向光方向向量

◆ GetFallOffExponent()

function IXPointLight GetFallOffExponent ( )

获取光源衰减值

Returns
number 光源衰减值

◆ GetLuminance()

function IXLightBase GetLuminance ( )

获取光照强度

Returns
number 光照强度

◆ GetPos()

function IXPointLight GetPos ( )

获取点光源位置

Returns
XVECTOR3 点光源位置

◆ GetRadius()

function IXLightBase GetRadius ( )

获取光源影响半径

Returns
number 光源影响半径

◆ GetType()

function IXLightBase GetType ( )

获取光源类型

Returns
number 光源类型

◆ Init()

function IXLightManager Init ( )

初始化

Returns
boolean 是否初始化成功

◆ IsCastShadow()

function IXLightBase IsCastShadow ( )

是否投射阴影

Returns
boolean 是否投射阴影

◆ IsEnable()

function IXLightBase IsEnable ( )

获取光源是否开启

Returns
boolean 光源是否开启

◆ new() [1/3]

function XPointLightDesc new ( )

@type XCOLORBASE

XPointLightDesc_new00

Returns
XPointLightDesc

@type number @type XVECTOR3 @type XVECTOR3 @type number @type number @type number @type number XSpotLightDesc_new00

Returns
XSpotLightDesc

◆ new() [2/3]

function XPointLightDesc new ( _clrColorVal  ,
_fLuminance  ,
_vPos  ,
_fRadius  ,
_fFallOffExponent   
)

XPointLightDesc_new01

Parameters
_clrColorValXCOLORBASE
_fLuminancenumber
_vPosXVECTOR3
_fRadiusnumber
_fFallOffExponentnumber
Returns
XPointLightDesc

◆ new() [3/3]

function XSpotLightDesc new ( _clrColorVal  ,
_fLuminance  ,
_vPos  ,
_vDir  ,
_fRadius  ,
_fFallOffExponent  ,
_fConeInnerAngle  ,
_fConeOuterAngle   
)

XSpotLightDesc_new01

Parameters
_clrColorValXCOLORBASE
_fLuminancenumber
_vPosXVECTOR3
_vDirXVECTOR3
_fRadiusnumber
_fFallOffExponentnumber
_fConeInnerAnglenumber
_fConeOuterAnglenumber
Returns
XSpotLightDesc

◆ Release()

function IXLightManager Release ( )

释放资源

Returns
void

◆ ReleaseLight()

function IXLightManager ReleaseLight ( pLight  )

释放对应的光源资源

Parameters
pLightIXLightBase 要释放的光源对象指针
Returns
void

◆ SetColorValue()

function IXLightBase SetColorValue ( clrColorVal  )

设置光源颜色

Parameters
clrColorValXCOLORBASE 光源颜色
Returns
void

◆ SetConeInnerAngle()

function IXSpotLight SetConeInnerAngle ( fAngle  )

设置聚光源内锥角

Parameters
fAnglenumber 聚光源内锥角大小
Returns
void

◆ SetConeOuterAngle()

function IXSpotLight SetConeOuterAngle ( fAngle  )

设置聚光源外锥角

Parameters
fAnglenumber 聚光源外锥角大小
Returns
void

◆ SetDir()

function IXSpotLight SetDir ( vDir  )

设置方向光方向

Parameters
vDirXVECTOR3 方向光方向向量
Returns
void

◆ SetFallOffExponent()

function IXPointLight SetFallOffExponent ( fFallOffExponent  )

可以设置光源衰减值

Parameters
fFallOffExponentnumber 光源衰减值
Returns
void

◆ SetLuminance()

function IXLightBase SetLuminance ( fLuminance  )

设置光照强度

Parameters
fLuminancenumber 光照强度
Returns
void

◆ SetPos()

function IXPointLight SetPos ( vPos  )

设置点光源位置

Parameters
vPosXVECTOR3 点光源位置
Returns
void

◆ SetRadius()

function IXPointLight SetRadius ( fRadius  )

设置点光源影响半径

Parameters
fRadiusnumber 点光源影响半径
Returns
void

Variable Documentation

◆ clrColorVal

XPointLightDesc clrColorVal = {}

@type XCOLORBASE

◆ fFallOffExponent

XPointLightDesc fFallOffExponent = 0

@type number

◆ fLuminance

XPointLightDesc fLuminance = 0

@type number

◆ fRadius

XPointLightDesc fRadius = 0

@type number

◆ vPos

XPointLightDesc vPos = {}

@type XVECTOR3

◆ XLT_DIRECTION

XLT_DIRECTION = 0

◆ XLT_ENV

XLT_ENV = 0

◆ XLT_NUM

XLT_NUM = 0

◆ XLT_POINT

XLT_POINT = 0

◆ XLT_SPOT

XLT_SPOT = 0

◆ XPointLightDesc