fix transforms for items with non-default registration point

This commit is contained in:
ZappoMan 2015-06-11 09:34:56 -07:00
parent 55ede2b398
commit 47888b4671
3 changed files with 4 additions and 4 deletions

View file

@ -33,7 +33,7 @@ void RenderableBoxEntityItem::render(RenderArgs* args) {
Q_ASSERT(args->_batch);
gpu::Batch& batch = *args->_batch;
batch.setModelTransform(getTransform()); // we want to include the scale as well
batch.setModelTransform(getTransformToCenter()); // we want to include the scale as well
DependencyManager::get<DeferredLightingEffect>()->renderSolidCube(batch, 1.0f, cubeColor);
RenderableDebugableEntityItem::render(this, args);

View file

@ -24,7 +24,7 @@ void RenderableDebugableEntityItem::renderBoundingBox(EntityItem* entity, Render
float puffedOut, glm::vec4& color) {
Q_ASSERT(args->_batch);
gpu::Batch& batch = *args->_batch;
batch.setModelTransform(entity->getTransform()); // we want to include the scale as well
batch.setModelTransform(entity->getTransformToCenter()); // we want to include the scale as well
DependencyManager::get<DeferredLightingEffect>()->renderWireCube(batch, 1.0f + puffedOut, color);
}
@ -33,7 +33,7 @@ void RenderableDebugableEntityItem::render(EntityItem* entity, RenderArgs* args)
Q_ASSERT(args->_batch);
gpu::Batch& batch = *args->_batch;
batch.setModelTransform(entity->getTransform()); // we want to include the scale as well
batch.setModelTransform(entity->getTransformToCenter()); // we want to include the scale as well
auto nodeList = DependencyManager::get<NodeList>();
const QUuid& myNodeID = nodeList->getSessionUUID();

View file

@ -39,7 +39,7 @@ void RenderableSphereEntityItem::render(RenderArgs* args) {
Q_ASSERT(args->_batch);
gpu::Batch& batch = *args->_batch;
batch.setModelTransform(getTransform()); // use a transform with scale, rotation, registration point and translation
batch.setModelTransform(getTransformToCenter()); // use a transform with scale, rotation, registration point and translation
DependencyManager::get<DeferredLightingEffect>()->renderSolidSphere(batch, 0.5f, SLICES, STACKS, sphereColor);
RenderableDebugableEntityItem::render(this, args);