Code Search for Developers
 
 
  

arcball.h from Boson at Krugle


Show arcball.h syntax highlighted

#ifndef GFXARCBALL_INCLUDED // -*- C++ -*-
#define GFXARCBALL_INCLUDED
#if !defined(__GNUC__)
#  pragma once
#endif

/************************************************************************

  Arcball rotation control.
  
  $Id: arcball.h 5690 2005-02-14 14:21:56Z rivol $

 ************************************************************************/

#include "baseball.h"

class Arcball : public Baseball
{
private:
    Vec2 ball_ctr;
    double ball_radius;

    Quat q_now, q_down, q_drag;	// Quaternions describing rotation
    Vec3 v_from, v_to;		//

    bool is_dragging;

protected:
    Vec3 proj_to_sphere(const Vec2&);
    void update();


public:
    Arcball();

    virtual void update_animation();
    virtual bool mouse_down(int *where, int which);
    virtual bool mouse_up(int *where, int which);
    virtual bool mouse_drag(int *where, int *last, int which);

    virtual void apply_transform();
    virtual void get_transform(Vec3 & c, Vec3 &t, Quat & q);
    virtual void set_transform(const Vec3 & c, const Vec3 & t, const Quat & q); 

    virtual void write(std::ostream&);
    virtual void read(std::istream&);
};



// GFXARCBALL_INCLUDED
#endif




See more files for this project here

Boson

Boson is an OpenGL real-time strategy game. It is designed to run on Unix (Linux) computers, and is built on top of the KDE, Qt and kdegames libraries.

Project homepage: http://sourceforge.net/projects/boson
Programming language(s): C,C++
License: other

  arcball.h
  array.h
  baseball.h
  geom3d.h
  geom4d.h
  gfx.h
  gl.h
  glext.h
  gltools.h
  gui.h
  intvec.h
  mat2.h
  mat3.h
  mat4.h
  mfc.h
  quat.h
  raster.h
  script.h
  symmat3.h
  symmat4.h
  trackball.h
  vec2.h
  vec3.h
  vec4.h
  wintools.h