git-svn-id: svn://db.shs.com.ru/libs@42 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -40,7 +40,7 @@ public:
|
||||
QString name() const {return name_;}
|
||||
void setName(const QString & name) {name_ = name;}
|
||||
//virtual GLuint hList() {return list;}
|
||||
virtual void init() {calculateBoundingBox(); vbo.init(); vbo.rebuffer(); material_.reflection.create(); /*qDebug() << "init" << vbo.buffer_;*/ is_init = true;}
|
||||
virtual void init() {calculateBoundingBox(); vbo.init(); vbo.rebuffer(); /*material_.reflection.create();*/ /*qDebug() << "init" << vbo.buffer_;*/ is_init = true;}
|
||||
virtual void draw(bool simplest = false);
|
||||
virtual void update() {}
|
||||
bool isInit() const {return is_init;}
|
||||
@@ -99,37 +99,39 @@ public:
|
||||
double posZ() const {return pos_.z();}
|
||||
QVector3D worldPos() const {return (itransform_ * QVector4D(0, 0, 0, 1.)).toVector3D();}
|
||||
|
||||
void rotateX(GLdouble a) {angles_.setX(angles_.x() + a); buildTransform();}
|
||||
void rotateY(GLdouble a) {angles_.setY(angles_.y() + a); buildTransform();}
|
||||
void rotateZ(GLdouble a) {angles_.setZ(angles_.z() + a); while (angles_.z() < -360.) angles_.setZ(angles_.z() + 360.); while (angles_.z() > 360.) angles_.setZ(angles_.z() - 360.); buildTransform();}
|
||||
void setRotationX(GLdouble a) {angles_.setX(a); buildTransform();}
|
||||
void setRotationY(GLdouble a) {angles_.setY(a); buildTransform();}
|
||||
void setRotationZ(GLdouble a) {angles_.setZ(a); while (angles_.z() < -360.) angles_.setZ(angles_.z() + 360.); while (angles_.z() > 360.) angles_.setZ(angles_.z() - 360.); buildTransform();}
|
||||
void setRotation(const QVector3D & a) {angles_= a; buildTransform();}
|
||||
void resetRotation() {angles_ = QVector3D(0., 0., 0.); buildTransform();}
|
||||
|
||||
QVector3D rotation() const {return angles_;}
|
||||
double rotationX() const {return angles_.x();}
|
||||
double rotationY() const {return angles_.y();}
|
||||
double rotationZ() const {return angles_.z();}
|
||||
void rotateX(GLdouble a) {raw_matrix = false; angles_.setX(angles_.x() + a); buildTransform();}
|
||||
void rotateY(GLdouble a) {raw_matrix = false; angles_.setY(angles_.y() + a); buildTransform();}
|
||||
void rotateZ(GLdouble a) {raw_matrix = false; angles_.setZ(angles_.z() + a); while (angles_.z() < -360.) angles_.setZ(angles_.z() + 360.); while (angles_.z() > 360.) angles_.setZ(angles_.z() - 360.); buildTransform();}
|
||||
void setRotationX(GLdouble a) {raw_matrix = false; angles_.setX(a); buildTransform();}
|
||||
void setRotationY(GLdouble a) {raw_matrix = false; angles_.setY(a); buildTransform();}
|
||||
void setRotationZ(GLdouble a) {raw_matrix = false; angles_.setZ(a); while (angles_.z() < -360.) angles_.setZ(angles_.z() + 360.); while (angles_.z() > 360.) angles_.setZ(angles_.z() - 360.); buildTransform();}
|
||||
void setRotation(const QVector3D & a) {raw_matrix = false; angles_= a; buildTransform();}
|
||||
void resetRotation() {raw_matrix = false; angles_ = QVector3D(0., 0., 0.); buildTransform();}
|
||||
|
||||
QVector3D scale() {return scale_;}
|
||||
double scaleX() {return scale_.x();}
|
||||
double scaleY() {return scale_.y();}
|
||||
double scaleZ() {return scale_.z();}
|
||||
void scale(const QVector3D & sv) {scale_ *= sv; buildTransform();}
|
||||
void scale(GLdouble sx, GLdouble sy, GLdouble sz) {scale(QVector3D(sx, sy, sz)); buildTransform();}
|
||||
void scale(GLdouble sx, GLdouble sy) {scale(QVector3D(sx, sy, sy)); buildTransform();}
|
||||
void scale(GLdouble sx) {scale(QVector3D(sx, sx, sx)); buildTransform();}
|
||||
void scaleX(GLdouble a) {scale_.setX(scale_.x() + a); buildTransform();}
|
||||
void scaleY(GLdouble a) {scale_.setY(scale_.y() + a); buildTransform();}
|
||||
void scaleZ(GLdouble a) {scale_.setZ(scale_.z() + a); buildTransform();}
|
||||
void setScale(const QVector3D & a) {scale_ = a; buildTransform();}
|
||||
void setScale(GLdouble a) {scale_ = QVector3D(a, a, a); buildTransform();}
|
||||
void setScaleX(GLdouble a) {scale_.setX(a); buildTransform();}
|
||||
void setScaleY(GLdouble a) {scale_.setY(a); buildTransform();}
|
||||
void setScaleZ(GLdouble a) {scale_.setZ(a); buildTransform();}
|
||||
void resetScale() {scale_ = QVector3D(1., 1., 1.); buildTransform();}
|
||||
void scale(const QVector3D & sv) {raw_matrix = false; scale_ *= sv; buildTransform();}
|
||||
void scale(GLdouble sx, GLdouble sy, GLdouble sz) {raw_matrix = false; scale(QVector3D(sx, sy, sz)); buildTransform();}
|
||||
void scale(GLdouble sx, GLdouble sy) {raw_matrix = false; scale(QVector3D(sx, sy, sy)); buildTransform();}
|
||||
void scale(GLdouble sx) {raw_matrix = false; scale(QVector3D(sx, sx, sx)); buildTransform();}
|
||||
void scaleX(GLdouble a) {raw_matrix = false; scale_.setX(scale_.x() + a); buildTransform();}
|
||||
void scaleY(GLdouble a) {raw_matrix = false; scale_.setY(scale_.y() + a); buildTransform();}
|
||||
void scaleZ(GLdouble a) {raw_matrix = false; scale_.setZ(scale_.z() + a); buildTransform();}
|
||||
void setScale(const QVector3D & a) {raw_matrix = false; scale_ = a; buildTransform();}
|
||||
void setScale(GLdouble a) {raw_matrix = false; scale_ = QVector3D(a, a, a); buildTransform();}
|
||||
void setScaleX(GLdouble a) {raw_matrix = false; scale_.setX(a); buildTransform();}
|
||||
void setScaleY(GLdouble a) {raw_matrix = false; scale_.setY(a); buildTransform();}
|
||||
void setScaleZ(GLdouble a) {raw_matrix = false; scale_.setZ(a); buildTransform();}
|
||||
void resetScale() {raw_matrix = false; scale_ = QVector3D(1., 1., 1.); buildTransform();}
|
||||
|
||||
QMatrix4x4 transform() {return mat_;}
|
||||
void setTransform(const QMatrix4x4 & t);
|
||||
|
||||
bool isAcceptLight() const {return accept_light;}
|
||||
void setAcceptLight(bool yes) {accept_light = yes;}
|
||||
@@ -164,7 +166,7 @@ public:
|
||||
|
||||
QVector3D pos_h;
|
||||
QVector<Vector3d> points, puvws;
|
||||
QVector<Vector3i> faces, uvws;
|
||||
QVector<Vector3i> faces, uvws, norms;
|
||||
QVector<Vector3d> normals;
|
||||
|
||||
//QVector<GLfloat> d_vertices, d_normals, d_uvs;
|
||||
@@ -180,7 +182,7 @@ protected:
|
||||
void checkPass();
|
||||
|
||||
int pass_; // Pass
|
||||
bool is_init, is_tex_loaded, accept_light, accept_fog, /*write_depth_,*/ visible_, cast_shadow, rec_shadow, select_, selected_;
|
||||
bool is_init, is_tex_loaded, accept_light, accept_fog, /*write_depth_,*/ visible_, cast_shadow, rec_shadow, select_, selected_, raw_matrix;
|
||||
double line_width;
|
||||
Type type_;
|
||||
GeomPrimitives geom_prim;
|
||||
@@ -190,7 +192,7 @@ protected:
|
||||
QVector3D pos_, angles_, scale_;
|
||||
QList<GLObjectBase * > children_;
|
||||
QList<GLuint> textures;
|
||||
QMatrix4x4 itransform_;
|
||||
QMatrix4x4 itransform_, mat_;
|
||||
//QColor color_;
|
||||
QString name_;
|
||||
GLenum blend_src, blend_dest;
|
||||
|
||||
Reference in New Issue
Block a user