30 #define MIN(a,b) (((a) < (b)) ? (a) : (b)) 34 #define MAX(a,b) (((a) > (b)) ? (a) : (b)) 84 glMatrixMode(GL_PROJECTION);
92 glMatrixMode(GL_PROJECTION);
101 glRotatef((
float) -
m_angleEl, (
float)elevationVector.
x, (
float)elevationVector.
y, (
float)elevationVector.
z);
108 glMatrixMode(GL_PROJECTION);
119 glRotatef((
float) -
m_angleEl, (
float)elevationVector.
x, (
float)elevationVector.
y, (
float)elevationVector.
z);
138 from.
x += _direction[0];
from.
y += _direction[1];
from.
z += _direction[2];
139 to.
x += _direction[0];
to.
y += _direction[1];
to.
z += _direction[2];
359 to +=
up * _distance;
365 to -=
up * _distance;
541 NxReal s = sin(_angle),
c = cos(_angle);
689 retValue.
x = retValue.
y = retValue.
z = 0;
692 retValueTmp.
x = retValueTmp.
y = retValueTmp.
z = 0;
695 GLfloat winX, winY, winZ;
697 GLdouble mvmatrix[16], projmatrix[16];
698 glGetDoublev(GL_MODELVIEW_MATRIX, mvmatrix);
699 glGetDoublev(GL_PROJECTION_MATRIX, projmatrix);
700 glGetIntegerv(GL_VIEWPORT, viewport);
701 winX = (float)display.
x;
702 winY = (
float)display.
y;
703 winZ = (float)display.
z;
704 gluUnProject(winX, winY, winZ, mvmatrix, projmatrix, viewport, &retValue.
x, &retValue.
y, &retValue.
z);
712 retValue.
x = retValue.
y = retValue.
z = 0;
716 GLdouble mvmatrix[16], projmatrix[16];
717 glGetDoublev(GL_MODELVIEW_MATRIX, mvmatrix);
718 glGetDoublev(GL_PROJECTION_MATRIX, projmatrix);
719 glGetIntegerv(GL_VIEWPORT, viewport);
720 gluProject(world.
x, world.
y, world.
z, mvmatrix, projmatrix, viewport, &retValue.
x, &retValue.
y, &retValue.
z);
727 GLdouble viewport[4];
728 glGetDoublev(GL_VIEWPORT, viewport);
739 GLdouble viewport[4];
740 glGetDoublev(GL_VIEWPORT, viewport);
742 retValue.
x = ((viewport[2] + viewport[0]) / 2.0 * (
double)sizeX);
743 retValue.
y = ((viewport[3] + viewport[1]) / 2.0 * (
double)sizeY);
788 if ((w <= 0) && (h <= 0))
794 GLdouble viewport[4];
795 glGetDoublev(GL_VIEWPORT, viewport);
796 double minSizeViewport =
MIN(viewport[2], viewport[3]);
797 double maxSizeBoundingBox =
MAX(w, h);
void setMinMaxCurrentLeftRight(NxReal _minLeftRight, NxReal _maxLeftRight, NxReal _currentLeftRight)
void getTranslation(double &x, double &y, double &z)
void rotateRightLockDst()
void setAllMinMaxCurrent(NxReal _angle)
void setTranslation(double x, double y, double z)
void azimuth(NxReal _angle)
NxVec3 getCenter(int sizeX, int sizeY)
NxReal stepAngleLeftRight
void rotate(NxReal angle, const NxVec3 &axe)
void setModeLock(bool _modeLockUpDown, bool _modeLockLeftRight, bool _modeLockSide)
static NxVec3 worldToDisplay(NxVec3 world)
void getPosition(double &x, double &y, double &z)
void calculateStepVectors()
void setDefaultZoomFactor(double defaultZoomFactor)
void setFrom(NxReal *_from)
void setMinMaxCurrentUpDown(NxReal _minUpDown, NxReal _maxUpDown, NxReal _currentUpDown)
static NxVec3 displayToWorld(NxVec3 display)
void setDistanceFromToLockTo(NxReal _distanceFromTo)
void setAllAngleStep(NxReal _angle)
NxReal magnitudeStepFront
void setDistanceFromToLockFrom(NxReal _distanceFromTo)
void setAngleStep(NxReal _stepAngleUpDown, NxReal _stepAngleLeftRight, NxReal _stepAngleSide)
void setSize(int w, int h)
const NxReal * get() const
void resetZoom(int w=-1, int h=-1)
void rotateRightLockSrc()
void cross(const NxVec3 &left, const NxVec3 &right)
void zoom(double zoomFactor)
void elevation(NxReal _angle)
void setCameraType(CameraType eCameraType)
void move(NxReal *_direction)
void rotateUpLockSrcKeepUpAndFront()
void setDistanceStep(NxReal _magnitudeStepUp, NxReal _magnitudeStepFront, NxReal _magnitudeStepLeft)
OGLCamera(NxReal *_from, NxReal *_to, NxReal *_up, int w, int h, CameraType eCameraType)
void setMinMaxCurrentSide(NxReal _minSide, NxReal _maxSide, NxReal _currentSide)
void rotateDownLockSrcKeepUpAndFront()
NxReal distance(const NxVec3 &) const
double m_defaultZoomFactor
void getViewPort(double *vp)