Example #1
0
    SpotLight(const PropertyList &props) :
        Emitter()
    {
        //set the arguments
        m_position =  props.getPoint("position");
        m_intensity = props.getColor("Intensity");
        bool useLookAt = props.getBoolean("useLookAt", true);
        if(useLookAt){
            Vector3f lookPT = props.getPoint("lookAt", Point3f(0.0f, 0.0f, 0.0f));
            m_direction = (lookPT - m_position).normalized();
        } else {
            m_direction = props.getVector("direction");
        }
        m_theta = props.getFloat("theta");
        m_cosFalloffStart = props.getFloat("falloff");

    }