|
@@ -123,13 +123,8 @@ void UGEEntity::setColor(const QColor &color)
|
123
|
123
|
|
124
|
124
|
Vector3D UGEEntity::getRealPoint(const Vector3D &pos)
|
125
|
125
|
{
|
126
|
|
- Matrix3x3 scale;
|
127
|
|
- scale.setScalar(0, 0, _scale.getX());
|
128
|
|
- scale.setScalar(1, 1, _scale.getY());
|
129
|
|
- scale.setScalar(2, 2, _scale.getZ());
|
130
|
|
- Vector3D p = scale.multMatrix(pos);
|
131
|
|
- Matrix3x3 rot = getRotationMatrix(_rotation);
|
132
|
|
- return (rot.multMatrix(p) + _position);
|
|
126
|
+ Matrix3x3 trans = getTransformationMatrix();
|
|
127
|
+ return (trans.multMatrix(pos) + _position);
|
133
|
128
|
}
|
134
|
129
|
|
135
|
130
|
ColorVector3D UGEEntity::getRealPoint(const ColorVector3D &pos)
|
|
@@ -142,9 +137,23 @@ TextureVector3D UGEEntity::getRealPoint(const TextureVector3D &pos)
|
142
|
137
|
return TextureVector3D(pos.getTextureCoord(), getRealPoint((ColorVector3D)pos));
|
143
|
138
|
}
|
144
|
139
|
|
145
|
|
-Matrix3x3 UGEEntity::getRotationMatrix(const Vector3D &rotation)
|
|
140
|
+Matrix3x3 UGEEntity::getTransformationMatrix() const
|
|
141
|
+{
|
|
142
|
+ return getRotationMatrix().multMatrix(getScaleMatrix());
|
|
143
|
+}
|
|
144
|
+
|
|
145
|
+Matrix3x3 UGEEntity::getScaleMatrix() const
|
|
146
|
+{
|
|
147
|
+ Matrix3x3 scale;
|
|
148
|
+ scale.setScalar(0, 0, _scale.getX());
|
|
149
|
+ scale.setScalar(1, 1, _scale.getY());
|
|
150
|
+ scale.setScalar(2, 2, _scale.getZ());
|
|
151
|
+ return scale;
|
|
152
|
+}
|
|
153
|
+
|
|
154
|
+Matrix3x3 UGEEntity::getRotationMatrix() const
|
146
|
155
|
{
|
147
|
|
- Vector3D r = Tools::degreeToRad(rotation);
|
|
156
|
+ Vector3D r = Tools::degreeToRad(_rotation);
|
148
|
157
|
|
149
|
158
|
Matrix3x3 mx;
|
150
|
159
|
mx.setToIdentity();
|