git-svn-id: svn://db.shs.com.ru/libs@54 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user