Open Search
    Ray Light

    Detailed Description

    Functions

    RayLightAllocRayLight (BaseDocument *doc, BaseObject *op)
     
    void FreeRayLight (RayLight *&lgt)
     
    Bool IlluminateRayLight (RayLight *rl, Vector *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().

    Parameters
    [in]docThe document containing the object op. The caller owns the pointed document.
    [in]opThe object to allocate the ray light for. The caller owns the pointed object.
    Returns
    The allocated ray light, or nullptr if the allocation failed.

    ◆ FreeRayLight()

    void FreeRayLight ( RayLight *&  lgt)

    Destructs ray lights allocated with AllocRayLight().

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

    ◆ IlluminateRayLight()

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

    Calculates the illumination for a ray light.

    Parameters
    [in]rlThe ray light to use for the calculation. The caller owns the pointed ray light.
    [out]colorAssigned the calculated color.
    [out]light_vectorAssigned the calculated light color.
    [in]pThe point for the illumination.
    [in]nThe normal for the illumination.
    Returns
    true if successful, otherwise false.