mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 20:36:38 +02:00
Update cube, line, and sphere overlays to use batches
This commit is contained in:
parent
0b4d4c24d4
commit
8241a2170b
3 changed files with 222 additions and 130 deletions
|
@ -35,13 +35,6 @@ void Cube3DOverlay::render(RenderArgs* args) {
|
||||||
return; // do nothing if we're not visible
|
return; // do nothing if we're not visible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float glowLevel = getGlowLevel();
|
|
||||||
Glower* glower = NULL;
|
|
||||||
if (glowLevel > 0.0f) {
|
|
||||||
glower = new Glower(glowLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
float alpha = getAlpha();
|
float alpha = getAlpha();
|
||||||
xColor color = getColor();
|
xColor color = getColor();
|
||||||
const float MAX_COLOR = 255.0f;
|
const float MAX_COLOR = 255.0f;
|
||||||
|
@ -49,91 +42,162 @@ void Cube3DOverlay::render(RenderArgs* args) {
|
||||||
|
|
||||||
//glDisable(GL_LIGHTING);
|
//glDisable(GL_LIGHTING);
|
||||||
|
|
||||||
// TODO: handle registration point??
|
// TODO: handle registration point??
|
||||||
glm::vec3 position = getPosition();
|
glm::vec3 position = getPosition();
|
||||||
glm::vec3 center = getCenter();
|
glm::vec3 center = getCenter();
|
||||||
glm::vec3 dimensions = getDimensions();
|
glm::vec3 dimensions = getDimensions();
|
||||||
glm::quat rotation = getRotation();
|
glm::quat rotation = getRotation();
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
glTranslatef(position.x, position.y, position.z);
|
|
||||||
glm::vec3 axis = glm::axis(rotation);
|
|
||||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
|
||||||
glPushMatrix();
|
|
||||||
glm::vec3 positionToCenter = center - position;
|
|
||||||
glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
|
|
||||||
if (_isSolid) {
|
|
||||||
if (_borderSize > 0) {
|
|
||||||
// Draw a cube at a larger size behind the main cube, creating
|
|
||||||
// a border effect.
|
|
||||||
// Disable writing to the depth mask so that the "border" cube will not
|
|
||||||
// occlude the main cube. This means the border could be covered by
|
|
||||||
// overlays that are further back and drawn later, but this is good
|
|
||||||
// enough for the use-case.
|
|
||||||
glDepthMask(GL_FALSE);
|
|
||||||
glPushMatrix();
|
|
||||||
glScalef(dimensions.x * _borderSize, dimensions.y * _borderSize, dimensions.z * _borderSize);
|
|
||||||
|
|
||||||
if (_drawOnHUD) {
|
auto batch = args->_batch;
|
||||||
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, glm::vec4(1.0f, 1.0f, 1.0f, alpha));
|
|
||||||
} else {
|
|
||||||
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, glm::vec4(1.0f, 1.0f, 1.0f, alpha));
|
|
||||||
}
|
|
||||||
|
|
||||||
glPopMatrix();
|
if (batch) {
|
||||||
glDepthMask(GL_TRUE);
|
Transform transform;
|
||||||
}
|
transform.setTranslation(position);
|
||||||
|
transform.setRotation(rotation);
|
||||||
|
if (_isSolid) {
|
||||||
|
// if (_borderSize > 0) {
|
||||||
|
// // Draw a cube at a larger size behind the main cube, creating
|
||||||
|
// // a border effect.
|
||||||
|
// // Disable writing to the depth mask so that the "border" cube will not
|
||||||
|
// // occlude the main cube. This means the border could be covered by
|
||||||
|
// // overlays that are further back and drawn later, but this is good
|
||||||
|
// // enough for the use-case.
|
||||||
|
// transform.setScale(dimensions * _borderSize);
|
||||||
|
// batch->setModelTransform(transform);
|
||||||
|
// DependencyManager::get<GeometryCache>()->renderSolidCube(*batch, 1.0f, glm::vec4(1.0f, 1.0f, 1.0f, alpha));
|
||||||
|
// }
|
||||||
|
|
||||||
|
transform.setScale(dimensions);
|
||||||
|
batch->setModelTransform(transform);
|
||||||
|
|
||||||
|
DependencyManager::get<DeferredLightingEffect>()->renderSolidCube(*batch, 1.0f, cubeColor);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (getIsDashedLine()) {
|
||||||
|
transform.setScale(1.0f);
|
||||||
|
batch->setModelTransform(transform);
|
||||||
|
|
||||||
|
glm::vec3 halfDimensions = dimensions / 2.0f;
|
||||||
|
glm::vec3 bottomLeftNear(-halfDimensions.x, -halfDimensions.y, -halfDimensions.z);
|
||||||
|
glm::vec3 bottomRightNear(halfDimensions.x, -halfDimensions.y, -halfDimensions.z);
|
||||||
|
glm::vec3 topLeftNear(-halfDimensions.x, halfDimensions.y, -halfDimensions.z);
|
||||||
|
glm::vec3 topRightNear(halfDimensions.x, halfDimensions.y, -halfDimensions.z);
|
||||||
|
|
||||||
|
glm::vec3 bottomLeftFar(-halfDimensions.x, -halfDimensions.y, halfDimensions.z);
|
||||||
|
glm::vec3 bottomRightFar(halfDimensions.x, -halfDimensions.y, halfDimensions.z);
|
||||||
|
glm::vec3 topLeftFar(-halfDimensions.x, halfDimensions.y, halfDimensions.z);
|
||||||
|
glm::vec3 topRightFar(halfDimensions.x, halfDimensions.y, halfDimensions.z);
|
||||||
|
|
||||||
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomLeftNear, bottomRightNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomRightNear, bottomRightFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomRightFar, bottomLeftFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomLeftFar, bottomLeftNear, cubeColor);
|
||||||
|
|
||||||
|
geometryCache->renderDashedLine(*batch, topLeftNear, topRightNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, topRightNear, topRightFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, topRightFar, topLeftFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, topLeftFar, topLeftNear, cubeColor);
|
||||||
|
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomLeftNear, topLeftNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomRightNear, topRightNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomLeftFar, topLeftFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(*batch, bottomRightFar, topRightFar, cubeColor);
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
|
||||||
if (_drawOnHUD) {
|
|
||||||
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, cubeColor);
|
|
||||||
} else {
|
|
||||||
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, cubeColor);
|
|
||||||
}
|
|
||||||
glPopMatrix();
|
|
||||||
} else {
|
} else {
|
||||||
glLineWidth(_lineWidth);
|
transform.setScale(dimensions);
|
||||||
|
batch->setModelTransform(transform);
|
||||||
if (getIsDashedLine()) {
|
DependencyManager::get<DeferredLightingEffect>()->renderWireCube(*batch, 1.0f, cubeColor);
|
||||||
glm::vec3 halfDimensions = dimensions / 2.0f;
|
|
||||||
glm::vec3 bottomLeftNear(-halfDimensions.x, -halfDimensions.y, -halfDimensions.z);
|
|
||||||
glm::vec3 bottomRightNear(halfDimensions.x, -halfDimensions.y, -halfDimensions.z);
|
|
||||||
glm::vec3 topLeftNear(-halfDimensions.x, halfDimensions.y, -halfDimensions.z);
|
|
||||||
glm::vec3 topRightNear(halfDimensions.x, halfDimensions.y, -halfDimensions.z);
|
|
||||||
|
|
||||||
glm::vec3 bottomLeftFar(-halfDimensions.x, -halfDimensions.y, halfDimensions.z);
|
|
||||||
glm::vec3 bottomRightFar(halfDimensions.x, -halfDimensions.y, halfDimensions.z);
|
|
||||||
glm::vec3 topLeftFar(-halfDimensions.x, halfDimensions.y, halfDimensions.z);
|
|
||||||
glm::vec3 topRightFar(halfDimensions.x, halfDimensions.y, halfDimensions.z);
|
|
||||||
|
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
|
||||||
|
|
||||||
geometryCache->renderDashedLine(bottomLeftNear, bottomRightNear, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(bottomRightNear, bottomRightFar, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(bottomRightFar, bottomLeftFar, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(bottomLeftFar, bottomLeftNear, cubeColor);
|
|
||||||
|
|
||||||
geometryCache->renderDashedLine(topLeftNear, topRightNear, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(topRightNear, topRightFar, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(topRightFar, topLeftFar, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(topLeftFar, topLeftNear, cubeColor);
|
|
||||||
|
|
||||||
geometryCache->renderDashedLine(bottomLeftNear, topLeftNear, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(bottomRightNear, topRightNear, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(bottomLeftFar, topLeftFar, cubeColor);
|
|
||||||
geometryCache->renderDashedLine(bottomRightFar, topRightFar, cubeColor);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
|
||||||
DependencyManager::get<GeometryCache>()->renderWireCube(1.0f, cubeColor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
glPopMatrix();
|
}
|
||||||
glPopMatrix();
|
} else {
|
||||||
|
float glowLevel = getGlowLevel();
|
||||||
|
Glower* glower = NULL;
|
||||||
|
if (glowLevel > 0.0f) {
|
||||||
|
glower = new Glower(glowLevel);
|
||||||
|
}
|
||||||
|
|
||||||
if (glower) {
|
glPushMatrix();
|
||||||
delete glower;
|
glTranslatef(position.x, position.y, position.z);
|
||||||
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
|
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||||
|
glPushMatrix();
|
||||||
|
glm::vec3 positionToCenter = center - position;
|
||||||
|
glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
|
||||||
|
if (_isSolid) {
|
||||||
|
if (_borderSize > 0) {
|
||||||
|
// Draw a cube at a larger size behind the main cube, creating
|
||||||
|
// a border effect.
|
||||||
|
// Disable writing to the depth mask so that the "border" cube will not
|
||||||
|
// occlude the main cube. This means the border could be covered by
|
||||||
|
// overlays that are further back and drawn later, but this is good
|
||||||
|
// enough for the use-case.
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
glPushMatrix();
|
||||||
|
glScalef(dimensions.x * _borderSize, dimensions.y * _borderSize, dimensions.z * _borderSize);
|
||||||
|
|
||||||
|
if (_drawOnHUD) {
|
||||||
|
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, glm::vec4(1.0f, 1.0f, 1.0f, alpha));
|
||||||
|
} else {
|
||||||
|
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, glm::vec4(1.0f, 1.0f, 1.0f, alpha));
|
||||||
|
}
|
||||||
|
|
||||||
|
glPopMatrix();
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
glPushMatrix();
|
||||||
|
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
||||||
|
if (_drawOnHUD) {
|
||||||
|
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, cubeColor);
|
||||||
|
} else {
|
||||||
|
DependencyManager::get<GeometryCache>()->renderSolidCube(1.0f, cubeColor);
|
||||||
|
}
|
||||||
|
glPopMatrix();
|
||||||
|
} else {
|
||||||
|
glLineWidth(_lineWidth);
|
||||||
|
|
||||||
|
if (getIsDashedLine()) {
|
||||||
|
glm::vec3 halfDimensions = dimensions / 2.0f;
|
||||||
|
glm::vec3 bottomLeftNear(-halfDimensions.x, -halfDimensions.y, -halfDimensions.z);
|
||||||
|
glm::vec3 bottomRightNear(halfDimensions.x, -halfDimensions.y, -halfDimensions.z);
|
||||||
|
glm::vec3 topLeftNear(-halfDimensions.x, halfDimensions.y, -halfDimensions.z);
|
||||||
|
glm::vec3 topRightNear(halfDimensions.x, halfDimensions.y, -halfDimensions.z);
|
||||||
|
|
||||||
|
glm::vec3 bottomLeftFar(-halfDimensions.x, -halfDimensions.y, halfDimensions.z);
|
||||||
|
glm::vec3 bottomRightFar(halfDimensions.x, -halfDimensions.y, halfDimensions.z);
|
||||||
|
glm::vec3 topLeftFar(-halfDimensions.x, halfDimensions.y, halfDimensions.z);
|
||||||
|
glm::vec3 topRightFar(halfDimensions.x, halfDimensions.y, halfDimensions.z);
|
||||||
|
|
||||||
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
|
||||||
|
geometryCache->renderDashedLine(bottomLeftNear, bottomRightNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(bottomRightNear, bottomRightFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(bottomRightFar, bottomLeftFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(bottomLeftFar, bottomLeftNear, cubeColor);
|
||||||
|
|
||||||
|
geometryCache->renderDashedLine(topLeftNear, topRightNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(topRightNear, topRightFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(topRightFar, topLeftFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(topLeftFar, topLeftNear, cubeColor);
|
||||||
|
|
||||||
|
geometryCache->renderDashedLine(bottomLeftNear, topLeftNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(bottomRightNear, topRightNear, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(bottomLeftFar, topLeftFar, cubeColor);
|
||||||
|
geometryCache->renderDashedLine(bottomRightFar, topRightFar, cubeColor);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
||||||
|
DependencyManager::get<GeometryCache>()->renderWireCube(1.0f, cubeColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
glPopMatrix();
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
|
if (glower) {
|
||||||
|
delete glower;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,41 +37,57 @@ void Line3DOverlay::render(RenderArgs* args) {
|
||||||
return; // do nothing if we're not visible
|
return; // do nothing if we're not visible
|
||||||
}
|
}
|
||||||
|
|
||||||
float glowLevel = getGlowLevel();
|
|
||||||
Glower* glower = NULL;
|
|
||||||
if (glowLevel > 0.0f) {
|
|
||||||
glower = new Glower(glowLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
|
|
||||||
glDisable(GL_LIGHTING);
|
|
||||||
glLineWidth(_lineWidth);
|
|
||||||
|
|
||||||
float alpha = getAlpha();
|
float alpha = getAlpha();
|
||||||
xColor color = getColor();
|
xColor color = getColor();
|
||||||
const float MAX_COLOR = 255.0f;
|
const float MAX_COLOR = 255.0f;
|
||||||
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
glm::vec4 colorv4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
||||||
|
|
||||||
glm::vec3 position = getPosition();
|
auto batch = args->_batch;
|
||||||
glm::quat rotation = getRotation();
|
|
||||||
|
|
||||||
glTranslatef(position.x, position.y, position.z);
|
if (batch) {
|
||||||
glm::vec3 axis = glm::axis(rotation);
|
Transform transform;
|
||||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
transform.setTranslation(_position);
|
||||||
|
transform.setRotation(_rotation);
|
||||||
|
batch->setModelTransform(transform);
|
||||||
|
|
||||||
if (getIsDashedLine()) {
|
if (getIsDashedLine()) {
|
||||||
// TODO: add support for color to renderDashedLine()
|
// TODO: add support for color to renderDashedLine()
|
||||||
DependencyManager::get<GeometryCache>()->renderDashedLine(_position, _end, colorv4, _geometryCacheID);
|
DependencyManager::get<GeometryCache>()->renderDashedLine(*batch, _position, _end, colorv4, _geometryCacheID);
|
||||||
|
} else {
|
||||||
|
DependencyManager::get<GeometryCache>()->renderLine(*batch, _start, _end, colorv4, _geometryCacheID);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
DependencyManager::get<GeometryCache>()->renderLine(_start, _end, colorv4, _geometryCacheID);
|
float glowLevel = getGlowLevel();
|
||||||
}
|
Glower* glower = NULL;
|
||||||
glEnable(GL_LIGHTING);
|
if (glowLevel > 0.0f) {
|
||||||
|
glower = new Glower(glowLevel);
|
||||||
|
}
|
||||||
|
|
||||||
glPopMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
if (glower) {
|
glDisable(GL_LIGHTING);
|
||||||
delete glower;
|
glLineWidth(_lineWidth);
|
||||||
|
|
||||||
|
glm::vec3 position = getPosition();
|
||||||
|
glm::quat rotation = getRotation();
|
||||||
|
|
||||||
|
glTranslatef(position.x, position.y, position.z);
|
||||||
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
|
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||||
|
|
||||||
|
if (getIsDashedLine()) {
|
||||||
|
// TODO: add support for color to renderDashedLine()
|
||||||
|
DependencyManager::get<GeometryCache>()->renderDashedLine(_position, _end, colorv4, _geometryCacheID);
|
||||||
|
} else {
|
||||||
|
DependencyManager::get<GeometryCache>()->renderLine(_start, _end, colorv4, _geometryCacheID);
|
||||||
|
}
|
||||||
|
glEnable(GL_LIGHTING);
|
||||||
|
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
|
if (glower) {
|
||||||
|
delete glower;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,33 +39,45 @@ void Sphere3DOverlay::render(RenderArgs* args) {
|
||||||
const float MAX_COLOR = 255.0f;
|
const float MAX_COLOR = 255.0f;
|
||||||
glm::vec4 sphereColor(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
glm::vec4 sphereColor(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha);
|
||||||
|
|
||||||
glDisable(GL_LIGHTING);
|
auto batch = args->_batch;
|
||||||
|
|
||||||
glm::vec3 position = getPosition();
|
|
||||||
glm::vec3 center = getCenter();
|
|
||||||
glm::vec3 dimensions = getDimensions();
|
|
||||||
glm::quat rotation = getRotation();
|
|
||||||
|
|
||||||
float glowLevel = getGlowLevel();
|
if (batch) {
|
||||||
Glower* glower = NULL;
|
Transform transform;
|
||||||
if (glowLevel > 0.0f) {
|
transform.setTranslation(_position);
|
||||||
glower = new Glower(glowLevel);
|
transform.setRotation(_rotation);
|
||||||
}
|
transform.setScale(_dimensions);
|
||||||
|
|
||||||
|
batch->setModelTransform(transform);
|
||||||
|
DependencyManager::get<GeometryCache>()->renderSphere(*batch, 1.0f, SLICES, SLICES, sphereColor, _isSolid);
|
||||||
|
} else {
|
||||||
|
glDisable(GL_LIGHTING);
|
||||||
|
|
||||||
|
glm::vec3 position = getPosition();
|
||||||
|
glm::vec3 center = getCenter();
|
||||||
|
glm::vec3 dimensions = getDimensions();
|
||||||
|
glm::quat rotation = getRotation();
|
||||||
|
|
||||||
|
float glowLevel = getGlowLevel();
|
||||||
|
Glower* glower = NULL;
|
||||||
|
if (glowLevel > 0.0f) {
|
||||||
|
glower = new Glower(glowLevel);
|
||||||
|
}
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
glTranslatef(position.x, position.y, position.z);
|
|
||||||
glm::vec3 axis = glm::axis(rotation);
|
|
||||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glm::vec3 positionToCenter = center - position;
|
glTranslatef(position.x, position.y, position.z);
|
||||||
glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||||
DependencyManager::get<GeometryCache>()->renderSphere(1.0f, SLICES, SLICES, sphereColor, _isSolid);
|
glPushMatrix();
|
||||||
|
glm::vec3 positionToCenter = center - position;
|
||||||
|
glTranslatef(positionToCenter.x, positionToCenter.y, positionToCenter.z);
|
||||||
|
glScalef(dimensions.x, dimensions.y, dimensions.z);
|
||||||
|
DependencyManager::get<GeometryCache>()->renderSphere(1.0f, SLICES, SLICES, sphereColor, _isSolid);
|
||||||
|
glPopMatrix();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
glPopMatrix();
|
|
||||||
|
if (glower) {
|
||||||
if (glower) {
|
delete glower;
|
||||||
delete glower;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue