void PointingMove (PointingEvent *e) { // Drag the object if (IsHeeding (e)) { IncRotation (WrangleRay (Feld () -> Up ()), IntersectionDiff (e, Loc ()) . x / 200); IncRotation (WrangleRay (Feld () -> Over ()), - IntersectionDiff (e, Loc ()) . y / 200); } }
void CameraClass::Frame(int xMouse, int yMouse, bool w, bool a, bool s, bool d) { float step = .5, mag; D3DXVECTOR3 at(0.0f, 0.0f, 0.0f); float x = static_cast<float>(xMouse); float y = static_cast<float>(yMouse); IncRotation(y / 5.0f, x / 5.0f, 0); if (w) { at += m_direction; } if (s) { at -= m_direction; } if (a) { at -= m_right; } if (d) { at += m_right; } //m_positionX += step * at.x; //m_positionY += step * at.y; //m_positionZ += step * at.z; m_position += step * at; }
void FingerMove (PointingEvent *e) { IncRotation (WrangleRay (Feld () -> Up ()), (e -> PhysOrigin () . x - e -> PrevOrigin () . x) / 250); IncRotation (WrangleRay (Feld () -> Over ()), -(e -> PhysOrigin () . y - e -> PrevOrigin () . y) / 250); }