本文整理汇总了C++中TransformComponent::GetRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ TransformComponent::GetRotation方法的具体用法?C++ TransformComponent::GetRotation怎么用?C++ TransformComponent::GetRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TransformComponent
的用法示例。
在下文中一共展示了TransformComponent::GetRotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JunctionQueue
JunctionQueue *GraphicSystem::Process(Entity *entity) {
TransformComponent *transform = (TransformComponent*)(entity->GetComponent(Component::ComponentType::Transform));
GraphicsComponent *graphics = (GraphicsComponent*)(entity->GetComponent(Component::ComponentType::Graphics));
graphics->SetPos(transform->GetX(), transform->GetY());
graphics->SetRotation(transform->GetRotation());
graphics->Draw(_window);
return new JunctionQueue();
}
示例2: Finalize
void BulletBodyComponent::Finalize( const BulletBodyComponentDefinition &definition )
{
BulletWorldComponent *pBulletWorldComponent = GetWorld()->GetComponents().GetFirst<BulletWorldComponent>();
HELIUM_ASSERT( pBulletWorldComponent );
HELIUM_ASSERT( definition.m_BodyDefinition );
TransformComponent *pTransform = GetComponentCollection()->GetFirst<TransformComponent>();
HELIUM_ASSERT( pTransform );
m_Body.Initialize(
*pBulletWorldComponent->GetBulletWorld(),
*definition.m_BodyDefinition,
pTransform ? pTransform->GetPosition() : Simd::Vector3::Zero,
pTransform ? pTransform->GetRotation() : Simd::Quat::IDENTITY);
btVector3 velocity;
ConvertToBullet(definition.m_InitialVelocity, velocity);
m_Body.GetBody()->setLinearVelocity(velocity);
m_Body.GetBody()->setUserPointer( this );
m_AssignedGroups = definition.m_AssignedGroups;
m_TrackPhysicalContactGroupMask = definition.m_TrackPhysicalContactGroupMask;
}
示例3: Draw
void GraphicsComponent::Draw(SpriteBatch* spriteBatch)
{
TransformComponent* transformComponent = owner->GetComponent<TransformComponent>(TransformComponent::name);
sprite->Draw(spriteBatch, transformComponent->GetPosition(), transformComponent->GetRotation(), transformComponent->GetScale());
}