camera fixes

git-svn-id: svn://db.shs.com.ru/libs@603 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
2019-10-02 14:18:39 +00:00
parent 30517fa7f3
commit b7e9fd6cf9
4 changed files with 362 additions and 98 deletions

View File

@@ -97,10 +97,39 @@ void Camera::assign(const Camera & c) {
angles_ = c.angles_;
angle_limit_lower_xy = c.angle_limit_lower_xy;
angle_limit_upper_xy = c.angle_limit_upper_xy;
mirror_x = c.mirror_x;
mirror_y = c.mirror_y;
depth_start = c.depth_start;
depth_end = c.depth_end;
buildTransform();
}
GLObjectBase * Camera::clone(bool withChildren) {
Camera * o = new Camera(*this);
//GLObjectBase::clone(withChildren);
o->is_init = false;
o->name_ = name_ + "_copy";
o->view_ = nullptr;
o->children_.clear();
if (withChildren) {
for (int i = 0; i < children_.size(); ++i)
o->addChild(children_[i]->clone(withChildren));
}
o->pos_ = pos_;
o->aim_ = aim_;
o->fov_ = fov_;
o->angles_ = angles_;
o->angle_limit_lower_xy = angle_limit_lower_xy;
o->angle_limit_upper_xy = angle_limit_upper_xy;
o->mirror_x = mirror_x;
o->mirror_y = mirror_y;
o->depth_start = depth_start;
o->depth_end = depth_end;
return o;
}
void Camera::panZ(const float & a) {
QVector3D dv = aim_ - pos_;
float tl = QVector2D(dv.x(), dv.y()).length();