LLMatrix4::LLMatrix4(const F32 angle, const LLVector4 &vec) { initRotation(LLQuaternion(angle, vec)); mMatrix[3][0] = 0.f; mMatrix[3][1] = 0.f; mMatrix[3][2] = 0.f; mMatrix[3][3] = 1.f; }
void applyTransforms(struct trans *tlist, struct GENode *glist) { struct trans *ptl = tlist; struct GENode *pgl = NULL; struct transMatrix m, aux; struct homoCoord start; struct homoCoord end; while(NULL != ptl) { pgl = glist; while(NULL != pgl) { switch(pgl->el.type) { case LINE: initHomoVector(&start, pgl->el.data.line.st.x, pgl->el.data.line.st.y); initHomoVector(&end, pgl->el.data.line.en.x, pgl->el.data.line.en.y); break; default: break; } switch(ptl->tType) { case TRANSLATION: initTranslation(&m, ptl->data.t.tx, ptl->data.t.ty); break; case SCALING: initScale(&m, ptl->data.s.sx, ptl->data.s.sy); if (!(ptl->data.s.px == 0 && ptl->data.s.py == 0)) { initTranslation(&aux, -1*ptl->data.s.px, -1*ptl->data.s.py); matrixProduct(&m, m, aux); initTranslation(&aux, ptl->data.s.px, ptl->data.s.py); matrixProduct(&m, m, aux); } break; case ROTATION: initRotation(&m, ptl->data.r.u); if (!(ptl->data.s.px == 0 && ptl->data.s.py == 0)) { initTranslation(&aux, -1*ptl->data.r.px, -1*ptl->data.r.py); matrixProduct(&m, m, aux); initTranslation(&aux, ptl->data.s.px, ptl->data.s.py); matrixProduct(&m, m, aux); } break; default: break; } matrixVectorProduct(&start, m, start); matrixVectorProduct(&end, m, end); twoDCoord(&pgl->el.data.line.st, start); twoDCoord(&pgl->el.data.line.en, end); pgl = pgl->next; } ptl = ptl->next; } }
LLMatrix4::LLMatrix4(const F32 roll, const F32 pitch, const F32 yaw) { LLMatrix3 mat(roll, pitch, yaw); initRotation(LLQuaternion(mat)); mMatrix[3][0] = 0.f; mMatrix[3][1] = 0.f; mMatrix[3][2] = 0.f; mMatrix[3][3] = 1.f; }
void AmmoView::die(Int2 pos) { Ammo::die(pos); if(type==BULLET || type==HEAVY_BULLET || type==LIGHT_BULLET) changeAnimation(1,false); else if(type==GRENADE) { initRotation(); changeAnimation(1,false); sounds[GRENADE]->play(); } }
void NAMESPACE::Trackball::buttonPressed(uint button, uint x, uint y) { if (button == LIBSL_LEFT_BUTTON) { m_Status = m_Status | ROTATING; initRotation(x, y); } else if (button == LIBSL_MIDDLE_BUTTON) { m_Status = m_Status | ZOOMING; initZoom(x, y); } else if (button == LIBSL_RIGHT_BUTTON) { m_Status = m_Status | TRANSLATING; initTranslation(x, y); } }
/** * Process the mouse press event. * Send out movement initialization signals. */ void InputController3DMove::mousePressEvent(QMouseEvent *event) { if (event->buttons() & Qt::MidButton) { emit initZoom(event->x(),event->y()); m_isButtonPressed=true; } else if (event->buttons() & Qt::LeftButton) { emit initRotation(event->x(),event->y()); m_isButtonPressed=true; } else if(event->buttons() & Qt::RightButton) { emit initTranslation(event->x(),event->y()); m_isButtonPressed=true; } }
AmmoView::AmmoView() :Ammo(),MyDrawable() { Int2 tmp_siz; if(type==BULLET || type==HEAVY_BULLET || type==LIGHT_BULLET) tmp_siz = Int2(50,12); if(type==FLAME) tmp_siz = Int2(300,150); if(type==GRENADE) tmp_siz = Int2(25,45); body.setOrigin(size.x/2,size.y/2); body.setSize(Vector2f(tmp_siz.x,tmp_siz.y)); initRotation(); loadRessources(); initRessources(); updateIntRect(); }
LLMatrix4::LLMatrix4(const LLQuaternion &q) { *this = initRotation(q); }
Quat::Quat(float inx, float iny, float inz, float inw) { initRotation(Vec3(inx,iny,inz), inw); }
Quat::Quat(const Vec3& axis, float angle) { initRotation(axis, angle); }
void ARAPTerm::build() { initRotation(); buildA(); buildb(); }