small refactoring
This commit is contained in:
21
glcamera.cpp
21
glcamera.cpp
@@ -24,7 +24,6 @@ Camera::Camera() {
|
||||
type_ = glCamera;
|
||||
fov_ = 60.;
|
||||
roll_ = 0.;
|
||||
//setRotationX(90.f);
|
||||
depth_start = 0.1f;
|
||||
mirror_x = mirror_y = false;
|
||||
}
|
||||
@@ -36,20 +35,6 @@ QMatrix4x4 Camera::offsetMatrix() const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
void Camera::localTransform(QMatrix4x4 & m) {
|
||||
return;
|
||||
if (parent_)
|
||||
m *= parent_->worldTransform();
|
||||
QMatrix4x4 ret;
|
||||
//qDebug() << "local camera";
|
||||
ret.translate(0., 0., -distance());
|
||||
ret.rotate(angles_.y(), 1., 0., 0.);
|
||||
ret.rotate(angles_.x(), 0., 1., 0.);
|
||||
ret.rotate(angles_.z(), 0., 0., 1.);
|
||||
//m *= ret.inverted();
|
||||
}
|
||||
*/
|
||||
|
||||
void Camera::assign(const Camera & c) {
|
||||
trans = c.trans;
|
||||
@@ -64,9 +49,8 @@ void Camera::assign(const Camera & c) {
|
||||
|
||||
ObjectBase * Camera::clone(bool withChildren) {
|
||||
Camera * o = new Camera(*this);
|
||||
//GLObjectBase::clone(withChildren);
|
||||
o->is_init = false;
|
||||
o->name_ = name_;// + "_copy";
|
||||
o->name_ = name_;
|
||||
o->scene_ = nullptr;
|
||||
o->children_.clear();
|
||||
if (withChildren) {
|
||||
@@ -91,9 +75,6 @@ QMatrix4x4 Camera::viewMatrix() const {
|
||||
ret.translate(0., 0., -distance());
|
||||
ret.rotate(-roll_, 0., 0., 1.);
|
||||
ret *= trans.matrixRotateScale().inverted();
|
||||
//ret.rotate(angles_.y(), 1., 0., 0.);
|
||||
//ret.rotate(angles_.x(), 0., 1., 0.);
|
||||
//pm.translate(-aim_);
|
||||
if (parent_) {
|
||||
QMatrix4x4 pmat = parent_->worldTransform();
|
||||
offset_ = pmat.column(3).toVector3D();
|
||||
|
||||
Reference in New Issue
Block a user