Exemplo n.º 1
0
//===========================================================================
void cSpotLight::updateShadowMap()
{
    // sanity check
    if ((!m_enabled) || (m_shadowMap == NULL)) { return; }

    // update shadow map
    cVector3d tmp0 = getGlobalPos();
    cVector3d tmp1 = cAdd(getGlobalPos(), getGlobalRot().getCol0());
    cVector3d tmp2 = getGlobalRot().getCol2();
    
    m_shadowMap->updateMap(m_worldParent,
                           tmp0,
                           tmp1,
                           tmp2,
                           m_cutOffAngleDEG,
                           m_shadowNearClippingPlane,
                           m_shadowFarClippingPlane);
}
Exemplo n.º 2
0
void
RangeSlider::mouseClicked(MouseButton b, StateEvent ev, GuiObject* receiver)
{
    if ((ev == GW1K_PRESSED) && ((receiver == this) || (receiver == rangeBar_)))
    {
        Point p = WManager::getInstance()->getMousePos() - getGlobalPos();
        int hdlWidth = lHandle_->getSize().x;
        int dl = std::abs(lHandle_->getPos().x + hdlWidth / 2 - p.x);
        int dr = std::abs(rHandle_->getPos().x + hdlWidth / 2 - p.x);
        WiBox* closestHandle = dl <= dr ? lHandle_ : rHandle_;
        setHandlePos(closestHandle, Point(p.x - hdlWidth / 2, 1));
        restoreConsistency();
        calculateValues();
        informActionListeners(this);
    }
}