AVLight::AVLight(bool isOn, int intensity, float hRot, float vRot, float distToOrigin)
    : m_isOn(isOn),
      m_intensity(intensity),
      m_hRotation(hRot),
      m_vRotation(vRot),
      m_distanceToOrigin(distToOrigin)
{
    calculateTransformation();
}
AVLight::AVLight()
{
    m_isOn = false;
    m_intensity = 0;
    m_hRotation = 0.0;
    m_vRotation = 0.0;
    m_distanceToOrigin = 10.0;

    calculateTransformation();
}
Example #3
0
void Tracker::registerChangedAngle(double angle){
	lock.lockForRead();
	{
		// Let each movement tracker calculate it's no position by itself...
		QList<MovementTracker*>::const_iterator i = movementTrackers->constBegin();
		while (i != movementTrackers->constEnd()) {
			(*i)->registerChangedAngle(angle);
			i++;
		}

		// Register this movement in the log
		registerMovementInLog(calculateTransformation());
	}
	lock.unlock();
	emit moved(this->getX(), this->getY(), this->getRotation());
}
Example #4
0
Trafo2D Tracker::getTransformation(){

	QReadLocker locker(&lock);

	return calculateTransformation();
}
void AVLight::setDistanceToOrigin(float value)
{
    m_distanceToOrigin = value;
    calculateTransformation();
}
void AVLight::setHRotation(float value)
{
    m_hRotation = value;
    calculateTransformation();
}
Example #7
0
AReViBalloon::AReViBalloon(ArCW &arCW, string text, double height, double width, double posX, double posY, double posZ, double /*oriZ*/)
	:	Object3D(arCW)
{
	setTransient(false);
	/* Instanciations */
	_mesh = Mesh3D::NEW();
	_shape = Shape3D::NEW();
	cerr << height << " "<<width << endl;
	_ctexture = CairoTexture::NEW(1024*height, 1024* width);
	_textManager=CairoTextManager::NEW(_ctexture);
	_textManager->setFontSize(200);

	/* Configuration */ 
	_ctexture->setLineWidth(12);
	_ctexture->setLineCap(CairoTexture::LINE_CAP_ROUND);

	double sx = height / 2;
	double sy = width / 2;

	/* Création mesh */
	_mesh->accessVertices().push_back(Util3D::Dbl3(-sx,-sy,0));
	_mesh->accessVertices().push_back(Util3D::Dbl3(+sx,-sy,0));
	_mesh->accessVertices().push_back(Util3D::Dbl3(+sx,+sy,0));
	_mesh->accessVertices().push_back(Util3D::Dbl3(-sx,+sy,0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(0.0,0.0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(1.0,0.0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(1.0,1.0));
	_mesh->accessTextures().push_back(Util3D::Dbl2(0.0,1.0));
	_mesh->accessVertexFaces().push_back(Util3D::Face(0,1,3));
	_mesh->accessVertexFaces().push_back(Util3D::Face(1,2,3));
	_mesh->computeDefaultNormals(true);
	if (!_mesh->applyChanges(true)) 
		cerr << "ERREUR MESH ...." << endl;

	/* Orientation correcte mesh */
	ArRef<Transform3D> tr = calculateTransformation (1.57,1.57,0);

	_mesh->writeTransformation(tr);

	/* Lien entre objets */
	_shape->addRootPart(_mesh);
	_mesh->setTexture(_ctexture);
	_mesh->setTextureRepeat(false,false);
	
	/*----Dessin de la bulle et du texte----*/
	_text = text;

	/*-------Lien avec la shape--------*/
	setShape(_shape); 
	_shape->setBillboard(true,false);
	
	/*--------Placement de la bulle au-dessus du personnage----------*/
	translate(posX,posY,posZ);
	
	_light=Light3D::NEW();
	_light->setDirectional(false);
//	_light->setLocation(shared_dynamic_cast<AReViWindow3D>(AReViMascaretApplication::getInstance()->accessWindow())->getAReViViewer());
//	_light->attachTo(shared_dynamic_cast<AReViWindow3D>(AReViMascaretApplication::getInstance()->accessWindow())->getAReViViewer());
    vector< shared_ptr<IEHA::Window3D> > windows = AReViMascaretApplication::getInstance()->getWindows();
    for(int i = 0; i < windows.size(); i++)
    {
        _light->setLocation(shared_dynamic_cast<AReViWindow3D>(windows[i])->getAReViViewer());
        _light->attachTo(shared_dynamic_cast<AReViWindow3D>(windows[i])->getAReViViewer());
    }

	/*--------Affichage de la bulle------*/
	show();

}