Example #1
0
    PerspectiveSensor::PerspectiveSensor(const AttributeList& attributes)
    {
        m_imageSize.x() = attributes.getInteger("imageWidth", 800);
        m_imageSize.y() = attributes.getInteger("imageHeight", 600);
        m_fov = attributes.getFloat("fov", 70);
        m_nearClip = attributes.getFloat("nearClip", 1e-4f);
        m_farClip = attributes.getFloat("farClip", 1e4f);

        m_invImageSize = m_imageSize.cast<float>().cwiseInverse();

        m_cameraToWorld = attributes.getTransform("toWorld", Transform());
    }