46 this->Transform::operator=(trans);
51 for (
int i=0; i<16; ++i)
53 matrix[0] = matrix[5] = matrix[10] = matrix[15] = 1.0;
59 matrix[12] = translationVector.
GetX();
60 matrix[13] = translationVector.
GetY();
61 matrix[14] = translationVector.
GetZ();
67 matrix[5] = cos(radians);
68 matrix[9] = -sin(radians);
69 matrix[6] = sin(radians);
70 matrix[10] = cos(radians);
76 matrix[0] = cos(radians);
77 matrix[8] = sin(radians);
78 matrix[2] = -sin(radians);
79 matrix[10] = cos(radians);
85 matrix[0] = cos(radians);
86 matrix[4] = -sin(radians);
87 matrix[1] = sin(radians);
88 matrix[5] = cos(radians);
111 + matrix[8]*point.
GetZ() + matrix[12]*point.
GetW(),
112 matrix[1]*point.
GetX() + matrix[5]*point.
GetY()
113 + matrix[9]*point.
GetZ() + matrix[13]*point.
GetW(),
114 matrix[2]*point.
GetX() + matrix[6]*point.
GetY()
115 + matrix[10]*point.
GetZ() + matrix[14]*point.
GetW(),
116 matrix[3]*point.
GetX() + matrix[7]*point.
GetY()
117 + matrix[11]*point.
GetZ() + matrix[15]*point.
GetW());
123 for (
int i=0; i < 16; ++i)
125 matrix[i%4] *t.
matrix[i/4*4] +matrix[(i%4)+4] *t.
matrix[i/4*4+1]
126 + matrix[(i%4)+8]*t.
matrix[i/4*4+2]+matrix[(i%4)+12]*t.
matrix[i/4*4+3];
132 this->SceneNode::operator=(t);
133 for (
int i=0; i < 16; ++i)
140 for (
int i=0; i < 16; ++i)
146 CopyMatrix(t * (*
this));
152 matrix[0]*ptPoint->
GetX()
153 + matrix[4]*ptPoint->
GetY()
154 + matrix[8]*ptPoint->
GetZ()
155 + matrix[12]*ptPoint->
GetW(),
156 matrix[1]*ptPoint->
GetX()
157 + matrix[5]*ptPoint->
GetY()
158 + matrix[9]*ptPoint->
GetZ()
159 + matrix[13]*ptPoint->
GetW(),
160 matrix[2]*ptPoint->
GetX()
161 + matrix[6]*ptPoint->
GetY()
162 + matrix[10]*ptPoint->
GetZ()
163 + matrix[14]*ptPoint->
GetW(),
164 matrix[3]*ptPoint->
GetX()
165 + matrix[7]*ptPoint->
GetY()
166 + matrix[11]*ptPoint->
GetZ()
167 + matrix[15]*ptPoint->
GetW()
181 if (Zero(refVec.
GetZ()))
184 this->MakeIdentity();
192 if (refVec.
GetZ() < 0)
196 this->MakeYRotation(anguloY);
197 vetTemp = (*this) * refVec;
200 if (vetTemp.
GetY() < 0)
205 this->CopyMatrix(tTemp * (*
this));
208 this->CopyMatrix(tTemp * (*
this));
211 this->CopyMatrix(tTemp * (*
this));
213 this->CopyMatrix(tTemp * (*
this));
221 this->MakeTranslation(-refPoint);
223 this->CopyMatrix(tTemp * (*
this));
225 this->CopyMatrix(tTemp * (*
this));
230 result->
SetX(matrix[0]);
231 result->
SetY(matrix[1]);
232 result->
SetZ(matrix[2]);
233 result->
SetW(matrix[3]);
238 result->
SetX(matrix[4]);
239 result->
SetY(matrix[5]);
240 result->
SetZ(matrix[6]);
241 result->
SetW(matrix[7]);
246 result->
SetX(matrix[8]);
247 result->
SetY(matrix[9]);
248 result->
SetZ(matrix[10]);
249 result->
SetW(matrix[11]);
254 result->
SetX(matrix[12]);
255 result->
SetY(matrix[13]);
256 result->
SetZ(matrix[14]);
257 result->
SetW(matrix[15]);
266 glMultMatrixd(matrix);
268 list<VART::SceneNode*>::const_iterator iter = childList.begin();
269 for (; iter != childList.end(); ++iter)
270 result &= (*iter)->DrawOGL();
280 list<VART::SceneNode*>::const_iterator iter;
283 glMultMatrixd(matrix);
285 for (iter = childList.begin(); iter != childList.end(); ++iter)
286 (*iter)->DrawForPicking();
289 cerr <<
"Error! Transform::DrawForPicking not implemented for non-OpenGL systems!" << endl;
301 bool initBBox =
false;
302 list<VART::SceneNode*>::const_iterator iter;
306 for (iter = childList.begin(); iter != childList.end(); ++iter) {
341 list<VART::SceneNode*>::const_iterator iter;
345 for (iter = childList.begin(); iter != childList.end(); ++iter) {
364 for (
int i=0; i < 16; ++i)
366 if (std::isnan(matrix[i]))
377 output.setf(ios::showpoint|ios::fixed);
382 output << setw(12) << t.
matrix[i+j*4] <<
" ";
385 output.unsetf(ios::showpoint|ios::fixed);
double AngleTo(const Point4D &p) const
Computes the angle up to p.
Base class for objects that compose a scene graph.
Points and vectors using homogeneous coordinates.
Header file for V-ART class "GraphicObj".
void Normalize()
Normalizes the point/vector.
void ComputeRecursiveBoundingBox()
Computes the recursive bounding box.
void ToggleVisibility()
Toggles the object's visibility.
void CopyGeometryFrom(const BoundingBox &box)
Copies geometry data from other bounding box.
std::ostream & operator<<(std::ostream &output, const Joint::DofID &dofId)
void MergeWith(const BoundingBox &box)
Merges a bounding with another, expanding it.
Axis aligned bounding box.
void ToggleRecVisibility()
Toggles the recursive object's visibility.
An scene node that is associated with a shape.
Header file for V-ART class "BoundingBox".
void ApplyTransform(const Transform &trans)
Applies transformation to a BoundingBox.
void SetXYZW(double x, double y, double z, double w)
const BoundingBox & GetRecursiveBoundingBox() const
Returns the recursive bounding box.