Exemplo n.º 1
0
    void SurfaceAnd::add(const std::shared_ptr<Surface>& surface)
    {
        registerTo(surface);
        _surfs.push_back(surface);

        stampCurrentUpdate();
    }
Exemplo n.º 2
0
    void PhysicalSurface::setOuterMaterial(const std::shared_ptr<Material>& mat)
    {
        swapChild(_outerMat, mat);
        _outerMat = mat;

        stampCurrentUpdate();
    }
Exemplo n.º 3
0
    void PhysicalSurface::setCoating(const std::shared_ptr<Coating>& coating)
    {
        swapChild(_coating, coating);
        _coating = coating;

        stampCurrentUpdate();
    }
Exemplo n.º 4
0
    void StageSet::setBackdrop(const std::shared_ptr<Backdrop>& backdrop)
    {
        swapChild(_backdrop, backdrop);
        _backdrop = backdrop;

        stampCurrentUpdate();
    }
Exemplo n.º 5
0
    void StageSet::setAmbientMaterial(const std::shared_ptr<Material>& ambientMaterial)
    {
        swapChild(_ambientMaterial, ambientMaterial);
        _ambientMaterial = ambientMaterial;

        stampCurrentUpdate();
    }
Exemplo n.º 6
0
    void SurfaceShell::transform(const Transform& transform)
    {
        _invTransform = _invTransform * transform.inv();
        _mvTransform = transform.mat() * _mvTransform;
        _normalTransform = glm::transpose(glm::inverse(glm::dmat3(_mvTransform)));

        stampCurrentUpdate();
    }
Exemplo n.º 7
0
    void Disk::transform(const Transform& transform)
    {
        _transform = transform.mat() * _transform;
        _invTransform = _invTransform * glm::inverse(transform.mat());
        _transformN = glm::transpose(glm::inverse(glm::dmat3(_transform))) * _normal;

        stampCurrentUpdate();
    }
Exemplo n.º 8
0
    void Sphere::transform(const Transform& transform)
    {
        _center = glm::dvec3(transform.mat() * glm::dvec4(_center, 1.0));

        glm::dvec4 unit = glm::dvec4(1.0, 0.0, 0.0, 0.0);
        _radius *= glm::length(transform.mat() * unit);
        _radius2 = _radius*_radius;

        stampCurrentUpdate();
    }
Exemplo n.º 9
0
    void ProceduralSun::setSunDirection(const glm::dvec3& dir)
    {
        _sunDirection = dir;
        _sunSideward = glm::normalize(glm::cross(SKY_UP, _sunDirection));
        _sunUpward = glm::normalize(glm::cross(_sunSideward, _sunDirection));

        double dayHeight = _sunDirection.z - MIN_SUN_HEIGHT;
        double dayRatio = glm::max(0.0, dayHeight / (1.0 - MIN_SUN_HEIGHT));

        _sunColor = _sunIntensity * kelvinToRgb(glm::mix(2000, 6400, dayRatio));
        _skylineColor = kelvinToRgb(glm::mix(3000, 8000, dayRatio));
        _haloColor = kelvinToRgb(glm::mix(3000, 6600, dayRatio));
        _groundColor = glm::dvec3(glm::mix(0.01, 0.5, dayRatio));

        _halowIntensity = glm::mix(0.10, 1.0, 1.0 - cellar::fast_pow(1.0 - dayRatio, 4.0));
        _diffuseIntens = glm::mix(0.01, 1.0, 1.0 - cellar::fast_pow(1.0 - dayRatio, 4.0));

        stampCurrentUpdate();
    }
Exemplo n.º 10
0
    void ProceduralSun::setGroundHeight(double height)
    {
        _groundHeight = height;

        stampCurrentUpdate();
    }
Exemplo n.º 11
0
    void ProceduralSun::setSkyColor(const glm::dvec3& color)
    {
        _skyColor = color;

        stampCurrentUpdate();
    }
Exemplo n.º 12
0
    void ProceduralSun::setSunIntensity(double intensity)
    {
        _sunIntensity = intensity;

        stampCurrentUpdate();
    }
Exemplo n.º 13
0
 StageSetNode::StageSetNode()
 {
     stampCurrentUpdate();
 }
Exemplo n.º 14
0
    void Quadric::transform(const Transform& transform)
    {
        _q = glm::transpose(transform.inv()) * _q * transform.inv();

        stampCurrentUpdate();
    }