git-svn-id: svn://db.shs.com.ru/libs@54 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-12-01 15:26:28 +00:00
parent 5ca76b651b
commit c8ceb3e328
13 changed files with 818 additions and 47 deletions

View File

@@ -210,7 +210,7 @@ void GLObjectBase::render(int * id, QMap<int, GLObjectBase * > * ids, int sh_id_
Light::Light(): GLObjectBase(), shadow_map(1, true, GL_R16F) {
Light::Light(): GLObjectBase(), shadow_map(0, true, GL_R16F) {
type_ = GLObjectBase::Light;
light_type = Omni;
intensity = 1.;
@@ -221,7 +221,7 @@ Light::Light(): GLObjectBase(), shadow_map(1, true, GL_R16F) {
}
Light::Light(const QVector3D & p, const QColor & c, GLdouble i): GLObjectBase(), shadow_map(1, true, GL_R16F) {
Light::Light(const QVector3D & p, const QColor & c, GLdouble i): GLObjectBase(), shadow_map(0, true, GL_R16F) {
type_ = GLObjectBase::Light;
light_type = Omni;
pos_ = p;
@@ -261,10 +261,20 @@ void Light::draw(QGLShaderProgram * prog, bool simplest) {
bool l = glIsEnabled(GL_LIGHTING);
glDisable(GL_LIGHTING);
glPointSize(8.);
glBegin(GL_POINTS);
glColor3f(0., 0., 0.);
glBegin(GL_POINTS);
glVertex3f(0., 0., 0.);
glEnd();
double s = 10;
if (light_type != Omni) {
glBegin(GL_LINES);
QVector4D dir = QVector4D(direction);
if (raw_matrix)
dir = transform().inverted() * dir;
glVertex3f(0., 0., 0.);
glVertex3f(dir.x() * s, dir.y() * s, dir.z() * s);
glEnd();
}
if (l) glEnable(GL_LIGHTING);
}