Exemple #1
0
void ATOM_LightNode::setLightType (int type)
{
	if (type != _light->getLightType ())
	{
		_light->setLightType ((ATOM_Light::LightType)type);

		onTransformChanged ();
	}
}
void Plate::setIntermediateRoll(float radians) {
    intermediatePitch = 0;
    intermediateYaw = 0;
    float newRot = Math::nearestRightAngle(radians);
    if(intermediateRoll != newRot) {
        intermediateRoll = newRot;
        mOrientation = glm::angleAxis(intermediateRoll, glm::vec3(0.f, 0.f, 1.f)) * mFinalizedOrienation;
        onTransformChanged();
    }
}
void Plate::setLocation(Vec3 location, float snapSize) {
    uint32_t newIntegralX = (uint32_t) std::floor(Math::nearestMultiple(location.x, snapSize) * 12.f + 0.5);
    uint32_t newIntegralY = (uint32_t) std::floor(Math::nearestMultiple(location.y, snapSize) * 12.f + 0.5);
    uint32_t newIntegralZ = (uint32_t) std::floor(Math::nearestMultiple(location.z, snapSize) * 12.f + 0.5);
    
    if(mIntegralX != newIntegralX || mIntegralY != newIntegralY || mIntegralZ != newIntegralZ) {
        mIntegralX = newIntegralX;
        mIntegralY = newIntegralY;
        mIntegralZ = newIntegralZ;
        mLocation = Vec3((float) mIntegralX, (float) mIntegralY, (float) mIntegralZ);
        mLocation /= 12.f;
        onTransformChanged();
    }
}
void TransformsGui::addWidget(TransformWidget *transformWidget)
{
    if (!transformWidgetList.isEmpty()) { // only if there is already another TransformWidget
        TransformWidget *previousTw = transformWidgetList.last();
        connect(previousTw,SIGNAL(updated()),transformWidget,SLOT(updatingFrom()));
    }

    transformWidgetList.append(transformWidget); // updating the list

    // Adding the widget to the gui
    ui->scrollAreaWidgetContents->layout()->addWidget(transformWidget);
    connect(transformWidget, SIGNAL(error(QString,QString)),logger, SLOT(logError(QString,QString)));
    connect(transformWidget, SIGNAL(warning(QString,QString)),logger, SLOT(logWarning(QString,QString)));
    connect(transformWidget, SIGNAL(status(QString,QString)),logger, SLOT(logStatus(QString,QString)));
    connect(transformWidget,SIGNAL(transfoRequest(TransformWidget*)),this,SLOT(processNewTransformation(TransformWidget*)));
    connect(transformWidget,SIGNAL(deletionRequest(TransformWidget*)), this, SLOT(processDeletionRequest(TransformWidget*)));
    connect(transformWidget, SIGNAL(transformChanged()), this, SLOT(onTransformChanged()),Qt::QueuedConnection);
    connect(transformWidget, SIGNAL(tryNewName(QString)), this, SLOT(onNameChangeRequest(QString)));

    emit entriesChanged();
}
Exemple #5
0
void SceneComponent::setScale(sf::Vector2f const& scale)
{
	mTransformable.setScale(scale);
	onTransformChanged();
}
Exemple #6
0
void SceneComponent::rotate(float rotation)
{
	mTransformable.rotate(rotation);
	onTransformChanged();
}
Exemple #7
0
void SceneComponent::setRotation(float rotation)
{
	mTransformable.setRotation(rotation);
	onTransformChanged();
}
Exemple #8
0
void SceneComponent::move(sf::Vector2f const& movement)
{
	mTransformable.move(movement);
	onTransformChanged();
}
Exemple #9
0
void SceneComponent::setPosition(sf::Vector2f const& position)
{
	mTransformable.setPosition(position);
	onTransformChanged();
}
Exemple #10
0
void Camera::onAttached()
{
	dImpl->_transformChangedCallbackId = getSceneNode()->getTransform()->addChangedCallback(std::bind(&Camera::onTransformChanged, this, std::placeholders::_1));
	
	onTransformChanged(*getSceneNode()->getTransform());
}