mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-06 01:56:08 +08:00
remove functions to directly manipulate the object; reordering rotation overloads
This commit is contained in:
parent
cc8cb4092d
commit
564377e17a
@ -111,71 +111,6 @@ bool TransformationMatrix::inverse(TransformationMatrix &inverse) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransformationMatrix::translate(double x, double y, double z)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_translation(x, y, z);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::translate(Vectorf3 const &vector)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_translation(vector.x, vector.y, vector.z);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::translateXY(Vectorf const &vector)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_translation(vector.x, vector.y, 0.0);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::scale(double factor)
|
|
||||||
{
|
|
||||||
this->scale(factor, factor, factor);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::scale(double x, double y, double z)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_scale(x, y, z);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::scale(Vectorf3 const &vector)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_scale(vector.x, vector.y, vector.z);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::mirror(const Axis &axis)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_mirror(axis);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::mirror(const Vectorf3 & normal)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_mirror(normal);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::rotate(double angle_rad, const Axis & axis)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_rotation(angle_rad, axis);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::rotate(double angle_rad, const Vectorf3 & axis)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_rotation(angle_rad, axis);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::rotate(double q1, double q2, double q3, double q4)
|
|
||||||
{
|
|
||||||
TransformationMatrix mat = mat_rotation(q1, q2, q3, q4);
|
|
||||||
this->applyLeft(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
void TransformationMatrix::applyLeft(const TransformationMatrix &left)
|
void TransformationMatrix::applyLeft(const TransformationMatrix &left)
|
||||||
{
|
{
|
||||||
TransformationMatrix temp = multiply(left, *this);
|
TransformationMatrix temp = multiply(left, *this);
|
||||||
|
@ -35,35 +35,6 @@ public:
|
|||||||
/// returns the inverse of the matrix
|
/// returns the inverse of the matrix
|
||||||
bool inverse(TransformationMatrix &inverse) const;
|
bool inverse(TransformationMatrix &inverse) const;
|
||||||
|
|
||||||
/// performs translation
|
|
||||||
void translate(double x, double y, double z);
|
|
||||||
void translate(Vectorf3 const &vector);
|
|
||||||
void translateXY(Vectorf const &vector);
|
|
||||||
|
|
||||||
/// performs uniform scale
|
|
||||||
void scale(double factor);
|
|
||||||
|
|
||||||
/// performs per-axis scale
|
|
||||||
void scale(double x, double y, double z);
|
|
||||||
|
|
||||||
/// performs per-axis scale via vector
|
|
||||||
void scale(Vectorf3 const &vector);
|
|
||||||
|
|
||||||
/// performs mirroring along given axis
|
|
||||||
void mirror(const Axis &axis);
|
|
||||||
|
|
||||||
/// performs mirroring along given axis
|
|
||||||
void mirror(const Vectorf3 &normal);
|
|
||||||
|
|
||||||
/// performs rotation around given axis
|
|
||||||
void rotate(double angle_rad, const Axis &axis);
|
|
||||||
|
|
||||||
/// performs rotation around arbitrary axis
|
|
||||||
void rotate(double angle_rad, const Vectorf3 &axis);
|
|
||||||
|
|
||||||
/// performs rotation defined by unit quaternion
|
|
||||||
void rotate(double q1, double q2, double q3, double q4);
|
|
||||||
|
|
||||||
/// multiplies the parameter-matrix from the left (this=left*this)
|
/// multiplies the parameter-matrix from the left (this=left*this)
|
||||||
void applyLeft(const TransformationMatrix &left);
|
void applyLeft(const TransformationMatrix &left);
|
||||||
|
|
||||||
@ -97,12 +68,12 @@ public:
|
|||||||
/// generates a rotation matrix around coodinate axis
|
/// generates a rotation matrix around coodinate axis
|
||||||
static TransformationMatrix mat_rotation(double angle_rad, const Axis &axis);
|
static TransformationMatrix mat_rotation(double angle_rad, const Axis &axis);
|
||||||
|
|
||||||
/// generates a rotation matrix defined by unit quaternion q1*i + q2*j + q3*k + q4
|
|
||||||
static TransformationMatrix mat_rotation(double q1, double q2, double q3, double q4);
|
|
||||||
|
|
||||||
/// generates a rotation matrix around arbitrary axis
|
/// generates a rotation matrix around arbitrary axis
|
||||||
static TransformationMatrix mat_rotation(double angle_rad, const Vectorf3 &axis);
|
static TransformationMatrix mat_rotation(double angle_rad, const Vectorf3 &axis);
|
||||||
|
|
||||||
|
/// generates a rotation matrix defined by unit quaternion q1*i + q2*j + q3*k + q4
|
||||||
|
static TransformationMatrix mat_rotation(double q1, double q2, double q3, double q4);
|
||||||
|
|
||||||
/// generates a rotation matrix by specifying a vector (origin) that is to be rotated
|
/// generates a rotation matrix by specifying a vector (origin) that is to be rotated
|
||||||
/// to be colinear with another vector (target)
|
/// to be colinear with another vector (target)
|
||||||
static TransformationMatrix mat_rotation(Vectorf3 origin, Vectorf3 target);
|
static TransformationMatrix mat_rotation(Vectorf3 origin, Vectorf3 target);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user