cone shadows done
This commit is contained in:
@@ -223,6 +223,12 @@ void ObjectBase::setVisible(bool v) {
|
||||
}
|
||||
|
||||
|
||||
void ObjectBase::setCastShadows(bool on) {
|
||||
cast_shadow = on;
|
||||
if (type_ == glLight) ((Light *)this)->apply();
|
||||
}
|
||||
|
||||
|
||||
void ObjectBase::rotateZ(GLfloat a) {
|
||||
raw_matrix = false;
|
||||
trans.setRotationZ(trans.rotationZ() + a);
|
||||
@@ -587,23 +593,12 @@ void AimedObject::orbitXY(const float & a) {
|
||||
void AimedObject::transformChanged() {}
|
||||
|
||||
|
||||
Light::Light(): AimedObject(), shadow_map(nullptr, 1, true) {
|
||||
type_ = glLight;
|
||||
light_type = Omni;
|
||||
intensity = 1.;
|
||||
angle_start = angle_end = 180.;
|
||||
decay_linear = decay_quadratic = decay_start = 0.;
|
||||
decay_const = decay_end = 1.;
|
||||
setDirection(0, 0, -1.);
|
||||
}
|
||||
|
||||
|
||||
Light::Light(const QVector3D & p, const QColor & c, float i): AimedObject(), shadow_map(nullptr, 1, true) {
|
||||
Light::Light(const QVector3D & p, const QColor & c, float i): AimedObject(), shadow_map(nullptr, 0, true, GL_R32F) {
|
||||
type_ = glLight;
|
||||
light_type = Omni;
|
||||
intensity = i;
|
||||
color_ = c;
|
||||
angle_start = angle_end = 180.;
|
||||
angle_start = angle_end = 90.;
|
||||
decay_linear = decay_quadratic = decay_start = 0.;
|
||||
decay_const = decay_end = 1.;
|
||||
setPos(p);
|
||||
|
||||
Reference in New Issue
Block a user