Exemplo n.º 1
0
Boat::Boat()
{
	mT = 0;
	mTV = 0.1;
	MatrixTransform* modelTransform = new MatrixTransform();
	mPat->addChild(modelTransform);
	
	//load a boat model
	MatrixTransform* n = Util::loadModel("jetski.3DS", 1.0/12 / 4, -90);
	
	if(n)
	{
//		Util::setTint(n, Vec4(1, 0, 0, 1));
		//the texture doesn't apply automatically for some reason, so let's do it manually
		Image* image = osgDB::readImageFile(Util::findDataFile("jetski.jpg"));
		Texture2D* tex = new Texture2D(image);
		n->getOrCreateStateSet()->setTextureAttributeAndModes(0, tex);
	}
	
	modelTransform->addChild(n);
}