Ray Light 函数

详细描述

函数

RayLight AllocRayLight ( BaseDocument *doc, BaseObject *op)
void  FreeRayLight ( RayLight *&lgt)
Bool   IlluminateRayLight ( RayLight *rl, 向量 *color, Vector64 *light_vector, const Vector64 &p, const Vector64 &n)

Function Documentation

◆  AllocRayLight()

RayLight * AllocRayLight ( BaseDocument doc ,
BaseObject op  
)

Allocates a ray light for op . Destroy the allocated ray light with FreeRayLight() .

参数
[in] doc The document containing the object op . The caller owns the pointed document.
[in] op The object to allocate the ray light for. The caller owns the pointed object.
返回
The allocated ray light, or nullptr if the allocation failed.

◆  FreeRayLight()

void FreeRayLight ( RayLight *&  lgt )

Destructs ray lights allocated with AllocRayLight() .

参数
[in,out] lgt The ray light to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  IlluminateRayLight()

Bool IlluminateRayLight ( RayLight rl ,
向量 color ,
Vector64 light_vector ,
const Vector64 p ,
const Vector64 n  
)

Calculates the illumination for a ray light.

参数
[in] rl The ray light to use for the calculation. The caller owns the pointed ray light.
[out] color Assigned the calculated color.
[out] light_vector Assigned the calculated light color.
[in] p The point for the illumination.
[in] n The normal for the illumination.
返回
true if successful, otherwise false .