28 #include "../../idlib/precompiled.h"
44 m_bBmpCreated (
FALSE),
45 m_bImageChange (
TRUE),
46 m_bBackgroundBitmapUsed (FALSE),
55 m_bFrontVector (FALSE),
56 m_dSensitivity (20.0),
57 m_procVectorChanging (
NULL),
58 m_procVectorChanged (NULL)
61 for (
int i=0;
i<3;
i++) {
62 m_dVec[
i] = DefaultVec[
i];
66 rotationQuat.Set( 0.0
f, 0.0
f, 0.0
f, 1.0
f );
82 CDC *pDC = CDC::FromHandle (lpDrawItemStruct->hDC);
84 if (!
m_bSelected && lpDrawItemStruct->itemState & ODS_SELECTED) {
87 !(lpDrawItemStruct->itemState & ODS_SELECTED) &&
88 (lpDrawItemStruct->itemState & ODS_FOCUS) &&
93 m_bHasFocus = lpDrawItemStruct->itemState & ODS_FOCUS;
94 m_bSelected = lpDrawItemStruct->itemState & ODS_SELECTED;
124 double vx = double(xf) / double(
m_iRadius),
126 vz = sqrt (1.0 - vx*vx - vy*vy);
145 for (
int i=0;
i<3;
i++)
146 m_dVec[
i] = DefaultVec[
i];
156 rx = m_dVec[0] - (dx * RV),
157 ry = m_dVec[1] - (dy * RV),
158 rz = m_dVec[2] - (dz * RV);
181 return RGB(BYTE(r),BYTE(
g),BYTE(
b));
188 m_iWidth = lpDrawItemStruct->rcItem.right - lpDrawItemStruct->rcItem.left;
189 m_iHeight = lpDrawItemStruct->rcItem.bottom - lpDrawItemStruct->rcItem.top;
192 m_dcMem.CreateCompatibleDC (pDC);
202 if (dExp < 1.0 || dExp > 200.0)
213 if (XRot == 0.0 && YRot == 0.0) {
217 double cx = cos(XRot),
242 for (
int i=0;
i<3;
i++)
244 cs.Format (
"%+1.5f",
m_dVec[i]);
245 pCtl[
i]->SetWindowText (cs);
277 m_dVec[nAxis]=d > 1.0 ? 1.0 : -1.0;
311 if (!
m_bmpBack.LoadBitmap (uBackgroundBitmapID))
331 m_dcMem.SetPixelV (
i,
j, RGB (BYTE(r),BYTE(
g),BYTE(
b)));
342 int iTmpWidth = tmpBitmap.bmWidth,
343 iTmpHeight = tmpBitmap.bmHeight;
345 DCtmp.CreateCompatibleDC (&
m_dcMem);
350 m_dcMem.SetPixelV (
i,
j, DCtmp.GetPixel (
i % iTmpWidth,
j % iTmpHeight));
380 if ( CWnd::GetCapture() !=
this ) {
384 float curX = (
float )( 2 * point.x - 64 ) / 64;
385 float curY = (
float )( 2 * point.y - 64 ) / 64;
387 idVec3 to( -curX, -curY, 0.0
f );
395 float phi = 2.0f * asin ( len ) ;
398 axis *= sin( phi / 2.0
f );
399 idQuat rot( axis.
z, axis.
y, axis.
x, cos( phi / 2.0
f ) );
414 float curX = (
float )( 2 * point.x - 64 ) / 64;
415 float curY = (
float )( 2 * point.y - 64 ) / 64;
void SetRadius(UINT uRadius)
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
BOOL SetBackgroundImage(UINT uBackgroundBitmapID)
CONST PIXELFORMATDESCRIPTOR UINT
idMat3 ToMat3(void) const
VectorCtlCallbackProc m_procVectorChanging
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
BOOL SetSensitivity(UINT uSens)
void Set(const float x, const float y, const float z)
static float ClampFloat(float min, float max, float value)
void InitBitmap(LPDRAWITEMSTRUCT lpDrawItemStruct, CDC *pDC)
BOOL SetSpecularExponent(double dExp)
idVec3 Cross(const idVec3 &a) const
#define DEFAULT_START_BACKGROUND_COLOR
void SetCenter(UINT uHorizPos, UINT uVertPos)
void SetVector(double dx, double dy, double dz)
void SetBackgroundColor(COLORREF clrStart, COLORREF clrEnd)
COLORREF m_clrBackgroundStart
void OnMouseDrag(int, int)
void BuildImage(LPDRAWITEMSTRUCT lpDrawItemStruct)
double m_dSpecularExponent
void SetAxisControl(int nXCtl, int nYCtl, int nZCtl)
VectorCtlCallbackProc m_procVectorChanged
void SetAxis(double d, int nAxis)
void RotateByXandY(double XRot, double YRot)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
COLORREF m_clrBackgroundEnd
GLdouble GLdouble GLdouble r
void ProjectSelfOntoSphere(const float radius)
void Redraw(BOOL bErase=FALSE)
MFnDagNode * GetParent(MFnDagNode *joint)
#define DEFAULT_END_BACKGROUND_COLOR
void UpdateAxisControls()
COLORREF CalcLight(double dx, double dy, double dz)
void ClearBackgroundBitmap()
BOOL m_bBackgroundBitmapUsed
afx_msg void OnMouseMove(UINT nFlags, CPoint point)