本文整理汇总了C++中TransformComponent::setRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformComponent::setRotation方法的具体用法?C++ TransformComponent::setRotation怎么用?C++ TransformComponent::setRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformComponent
的用法示例。
在下文中一共展示了TransformComponent::setRotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addMap
Actor* addMap()
{
Actor* sphere = new Actor;
TransformComponent* trans = new TransformComponent();
trans->setPos(vec3(0, -0.01, 0));
Rotation rot;
rot.setEulerAngles(vec3(0, 0.785, 0));
trans->setRotation(rot);
sphere->addComponent(trans);
glDebug();
sphere->addComponent(new StaticMeshStaticPhysicsComponent(AssetManager::getBasePath() + "Data/Model/mappa4.obj"));
glDebug();
MeshGraphicComponent* mesh = new MeshGraphicComponent(AssetManager::getBasePath() + "Data/Model/mappa4.obj");
glDebug();
mesh->setTextureMatrix(mat2(scale(mat4(1), vec3(10))));
glDebug();
Material *mat = new Material();
glDebug();
mat->setDiffuse(AssetManager::getBasePath() + "Data/Texture/floor1_d.png");
mat->setNormal(AssetManager::getBasePath() + "Data/Texture/floor1_n.png");
mat->setSpecular(AssetManager::getBasePath() + "Data/Texture/floor1_s.png");
mat->setShininess(20);
glDebug();
mesh->addMaterial(mat);
glDebug();
sphere->addComponent(mesh);
glDebug();
return sphere;
}
示例2: TransformComponent
Actor* addAxis3()
{
Actor* actor = new Actor;
TransformComponent* trans = new TransformComponent();
trans->setPos(vec3(-5, 0, 5));
Rotation rot;
rot.setNormalDirection(vec3(1, 0, 0));
trans->setRotation(rot);
actor->addComponent(trans);
MeshGraphicComponent* mesh = new MeshGraphicComponent(AssetManager::getBasePath() + "Data/Model/axis.obj");
Material *mat = new Material();
mat->setDiffuse("#FF0000");
mesh->addMaterial(mat);
Material *mat1 = new Material();
mat1->setDiffuse("#00FF00");
mesh->addMaterial(mat1);
mesh->addMaterial(mat1);
Material *mat2 = new Material();
mat2->setDiffuse("#0000FF");
mesh->addMaterial(mat2);
actor->addComponent(mesh);
return actor;
}
示例3: update
void PhysComponent::update()
{
if (m_Obj->hasComponent("Transform")) {
TransformComponent* tc = (TransformComponent*)m_Obj->getComponent("Transform");
b2Vec2 pos = m_Body->GetPosition();
tc->setPosition((double)pos.x, (double)pos.y);
tc->setRotation( m_Body->GetAngle() * (180.0f / (float)Gosu::pi));
}
}