doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DialogAFConstraintBallAndSocket.cpp
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #include "../../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "../../sys/win32/rc/AFEditor_resource.h"
33 
34 #include "DialogAF.h"
35 #include "DialogAFConstraint.h"
37 
38 
39 // DialogAFConstraintBallAndSocket dialog
40 
42  { IDC_RADIO_ANCHOR_JOINT, "use the position of a joint for the anchor" },
43  { IDC_COMBO_ANCHOR_JOINT, "anchor joint name" },
44  { IDC_RADIO_ANCHOR_COORDINATES, "use absolute coordinates for the anchor" },
45  { IDC_EDIT_ANCHOR_X, "anchor x-coordinate" },
46  { IDC_EDIT_ANCHOR_Y, "anchor y-coordinate" },
47  { IDC_EDIT_ANCHOR_Z, "anchor z-coordinate" },
48  { IDC_RADIO_BAS_LIMIT_NONE, "no joint limit" },
49  { IDC_RADIO_BAS_LIMIT_CONE, "cone shaped joint limit" },
50  { IDC_RADIO_BAS_LIMIT_PYRAMID, "pyramid shaped joint limit" },
51  { IDC_EDIT_BAS_LIMIT_CONE_ANGLE, "cone angle" },
52  { IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE1, "first pyramid angle" },
53  { IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE2, "second pyramid angle" },
54  { IDC_EDIT_BAS_LIMIT_ROLL, "roll angle" },
55  { IDC_RADIO_BAS_LIMIT_BONE, "use a bone for the orientation of the limit" },
56  { IDC_RADIO_BAS_LIMIT_ANGLES, "use angles to set the orientation of the limit" },
57  { IDC_COMBO_BAS_LIMIT_JOINT1, "bone start joint" },
58  { IDC_COMBO_BAS_LIMIT_JOINT2, "bone end joint" },
59  { IDC_EDIT_BAS_LIMIT_PITCH, "pitch angle" },
60  { IDC_EDIT_BAS_LIMIT_YAW, "yaw angle" },
61  { IDC_RADIO_BAS_LIMIT_AXIS_BONE, "use a bone for the limit axis" },
62  { IDC_RADIO_BAS_LIMIT_AXIS_ANGLES, "use angles to set the orientation of the limit axis" },
63  { IDC_COMBO_BAS_LIMIT_AXIS_JOINT1, "bone start joint" },
64  { IDC_COMBO_BAS_LIMIT_AXIS_JOINT2, "bone end joint" },
65  { IDC_EDIT_BAS_LIMIT_AXIS_PITCH, "pitch angle" },
66  { IDC_EDIT_BAS_LIMIT_AXIS_YAW, "yaw angle" },
67  { 0, NULL }
68 };
69 
70 IMPLEMENT_DYNAMIC(DialogAFConstraintBallAndSocket, CDialog)
71 
72 /*
73 ================
74 DialogAFConstraintBallAndSocket::DialogAFConstraintBallAndSocket
75 ================
76 */
78  : CDialog(DialogAFConstraintBallAndSocket::IDD, pParent)
79  , m_anchor_x(0)
80  , m_anchor_y(0)
81  , m_anchor_z(0)
82  , m_coneAngle(30.0f)
83  , m_pyramidAngle1(30.0f)
84  , m_pyramidAngle2(30.0f)
85  , m_limitPitch(0)
86  , m_limitYaw(0)
87  , m_limitRoll(0)
88  , m_limitAxisPitch(0)
89  , m_limitAxisYaw(0)
90  , constraint(NULL)
91  , file(NULL)
92 {
93  Create( IDD_DIALOG_AF_CONSTRAINT_BALLANDSOCKET, pParent );
94  EnableToolTips( TRUE );
95 }
96 
97 /*
98 ================
99 DialogAFConstraintBallAndSocket::~DialogAFConstraintBallAndSocket
100 ================
101 */
103 }
104 
105 /*
106 ================
107 DialogAFConstraintBallAndSocket::DoDataExchange
108 ================
109 */
111  CDialog::DoDataExchange(pDX);
112  //{{AFX_DATA_MAP(DialogAFConstraintBallAndSocket)
113  DDX_Control(pDX, IDC_COMBO_ANCHOR_JOINT, m_comboAnchorJoint);
114  DDX_Text(pDX, IDC_EDIT_ANCHOR_X, m_anchor_x);
115  DDX_Text(pDX, IDC_EDIT_ANCHOR_Y, m_anchor_y);
116  DDX_Text(pDX, IDC_EDIT_ANCHOR_Z, m_anchor_z);
122  DDX_Text(pDX, IDC_EDIT_BAS_LIMIT_PITCH, m_limitPitch);
123  DDX_Text(pDX, IDC_EDIT_BAS_LIMIT_YAW, m_limitYaw);
124  DDX_Text(pDX, IDC_EDIT_BAS_LIMIT_ROLL, m_limitRoll);
129  //}}AFX_DATA_MAP
130 }
131 
132 /*
133 ================
134 DialogAFConstraintBallAndSocket::InitJointLists
135 ================
136 */
138  m_comboAnchorJoint.ResetContent();
139  m_comboLimitJoint1.ResetContent();
140  m_comboLimitJoint2.ResetContent();
141  m_comboLimitAxisJoint1.ResetContent();
142  m_comboLimitAxisJoint2.ResetContent();
143 
144  if ( !file ) {
145  return;
146  }
147 
149  if ( !model ) {
150  return;
151  }
152 
153  int numJoints = model->NumJoints();
154  for ( int i = 0; i < numJoints; i++ ) {
155  const char *jointName = model->GetJointName( (jointHandle_t) i );
156  m_comboAnchorJoint.AddString( jointName );
157  m_comboLimitJoint1.AddString( jointName );
158  m_comboLimitJoint2.AddString( jointName );
159  m_comboLimitAxisJoint1.AddString( jointName );
160  m_comboLimitAxisJoint2.AddString( jointName );
161  }
162 }
163 
164 /*
165 ================
166 DialogAFConstraintBallAndSocket::LoadFile
167 ================
168 */
170  file = af;
171  constraint = NULL;
172  InitJointLists();
173 }
174 
175 /*
176 ================
177 DialogAFConstraintBallAndSocket::SaveFile
178 ================
179 */
181  SaveConstraint();
182 }
183 
184 /*
185 ================
186 DialogAFConstraintBallAndSocket::LoadConstraint
187 ================
188 */
190  int i, s1, s2;
191  idAngles angles;
192 
193  constraint = c;
194 
195  // anchor
202  }
203  else {
205  }
207 
208  // limit
211  }
214  }
215  else {
217  }
219 
224  angles = constraint->limitAxis.ToVec3().ToAngles();
225  m_limitPitch = angles.pitch;
226  m_limitYaw = angles.yaw;
227 
230  }
231  else {
233  }
237 
238  // limit axis
241  angles = constraint->shaft[0].ToVec3().ToAngles();
242  m_limitAxisPitch = angles.pitch;
243  m_limitAxisYaw = angles.yaw;
246  }
247  else {
250  }
252 
253  // update displayed values
254  UpdateData( FALSE );
255 }
256 
257 /*
258 ================
259 DialogAFConstraintBallAndSocket::SaveConstraint
260 ================
261 */
263  int s1, s2;
264  CString str;
265  idAngles angles;
266 
267  if ( !file || !constraint ) {
268  return;
269  }
270  UpdateData( TRUE );
271 
272  // anchor
274  constraint->anchor.joint1 = str;
278 
279  // limit
282  }
283  else {
285  }
288  angles.pitch = m_limitPitch;
289  angles.yaw = m_limitYaw;
290  angles.roll = 0.0f;
291  constraint->limitAxis.ToVec3() = angles.ToForward();
293  constraint->limitAxis.joint1 = str;
295  constraint->limitAxis.joint2 = str;
296 
297  // limit axis
300  constraint->shaft[0].joint1 = str;
302  constraint->shaft[0].joint2 = str;
303  }
304  else {
306  }
307 
309 }
310 
311 /*
312 ================
313 DialogAFConstraintBallAndSocket::UpdateFile
314 ================
315 */
317  SaveConstraint();
318  if ( file ) {
320  }
321 }
322 
323 /*
324 ================
325 DialogAFConstraintBallAndSocket::OnToolHitTest
326 ================
327 */
328 int DialogAFConstraintBallAndSocket::OnToolHitTest( CPoint point, TOOLINFO* pTI ) const {
329  CDialog::OnToolHitTest( point, pTI );
330  return DefaultOnToolHitTest( toolTips, this, point, pTI );
331 }
332 
333 
334 BEGIN_MESSAGE_MAP(DialogAFConstraintBallAndSocket, CDialog)
335  ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
336  ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
337  ON_BN_CLICKED(IDC_RADIO_ANCHOR_JOINT, OnBnClickedRadioAnchorJoint)
338  ON_BN_CLICKED(IDC_RADIO_ANCHOR_COORDINATES, OnBnClickedRadioAnchorCoordinates)
339  ON_CBN_SELCHANGE(IDC_COMBO_ANCHOR_JOINT, OnCbnSelchangeComboAnchorJoint)
340  ON_EN_CHANGE(IDC_EDIT_ANCHOR_X, OnEnChangeEditAnchorX)
341  ON_EN_CHANGE(IDC_EDIT_ANCHOR_Y, OnEnChangeEditAnchorY)
342  ON_EN_CHANGE(IDC_EDIT_ANCHOR_Z, OnEnChangeEditAnchorZ)
343  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR_X, OnDeltaposSpinAnchorX)
344  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR_Y, OnDeltaposSpinAnchorY)
345  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_ANCHOR_Z, OnDeltaposSpinAnchorZ)
346  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_NONE, OnBnClickedRadioBasLimitNone)
347  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_CONE, OnBnClickedRadioBasLimitCone)
348  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_PYRAMID, OnBnClickedRadioBasLimitPyramid)
349  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_CONE_ANGLE, OnEnChangeEditBasLimitConeAngle)
350  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_CONE_ANGLE, OnDeltaposSpinBasLimitConeAngle)
351  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE1, OnEnChangeEditBasLimitPyramidAngle1)
352  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_PYRAMID_ANGLE1, OnDeltaposSpinBasLimitPyramidAngle1)
353  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE2, OnEnChangeEditBasLimitPyramidAngle2)
354  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_PYRAMID_ANGLE2, OnDeltaposSpinBasLimitPyramidAngle2)
355  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_ROLL, OnEnChangeEditBasLimitRoll)
356  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_ROLL, OnDeltaposSpinBasLimitRoll)
357  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_BONE, OnBnClickedRadioBasLimitBone)
358  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_ANGLES, OnBnClickedRadioBasLimitAngles)
359  ON_CBN_SELCHANGE(IDC_COMBO_BAS_LIMIT_JOINT1, OnCbnSelchangeComboBasLimitJoint1)
360  ON_CBN_SELCHANGE(IDC_COMBO_BAS_LIMIT_JOINT2, OnCbnSelchangeComboBasLimitJoint2)
361  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_PITCH, OnEnChangeEditBasLimitPitch)
362  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_PITCH, OnDeltaposSpinBasLimitPitch)
363  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_YAW, OnEnChangeEditBasLimitYaw)
364  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_YAW, OnDeltaposSpinBasLimitYaw)
365  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_AXIS_BONE, OnBnClickedRadioBasLimitAxisBone)
366  ON_BN_CLICKED(IDC_RADIO_BAS_LIMIT_AXIS_ANGLES, OnBnClickedRadioBasLimitAxisAngles)
367  ON_CBN_SELCHANGE(IDC_COMBO_BAS_LIMIT_AXIS_JOINT1, OnCbnSelchangeComboBasLimitAxisJoint1)
368  ON_CBN_SELCHANGE(IDC_COMBO_BAS_LIMIT_AXIS_JOINT2, OnCbnSelchangeComboBasLimitAxisJoint2)
369  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_AXIS_PITCH, OnEnChangeEditBasLimitAxisPitch)
370  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_AXIS_PITCH, OnDeltaposSpinBasLimitAxisPitch)
371  ON_EN_CHANGE(IDC_EDIT_BAS_LIMIT_AXIS_YAW, OnEnChangeEditBasLimitAxisYaw)
372  ON_NOTIFY(UDN_DELTAPOS, IDC_SPIN_BAS_LIMIT_AXIS_YAW, OnDeltaposSpinBasLimitAxisYaw)
373 END_MESSAGE_MAP()
374 
375 
376 // DialogAFConstraintBallAndSocket message handlers
377 
378 BOOL DialogAFConstraintBallAndSocket::OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ) {
379  return DefaultOnToolTipNotify( toolTips, id, pNMHDR, pResult );
380 }
381 
383  if ( IsDlgButtonChecked( IDC_RADIO_ANCHOR_JOINT ) ) {
384  if ( constraint ) {
386  UpdateFile();
387  }
388  }
389 }
390 
392  if ( IsDlgButtonChecked( IDC_RADIO_ANCHOR_COORDINATES ) ) {
393  if ( constraint ) {
395  UpdateFile();
396  }
397  }
398 }
399 
401  UpdateFile();
402 }
403 
405  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_X ) ) ) {
406  UpdateFile();
407  }
408  else {
409  m_anchor_x = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_X ) );
410  }
411 }
412 
414  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Y ) ) ) {
415  UpdateFile();
416  }
417  else {
418  m_anchor_y = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Y ) );
419  }
420 }
421 
423  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Z ) ) ) {
424  UpdateFile();
425  }
426  else {
427  m_anchor_z = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_ANCHOR_Z ) );
428  }
429 }
430 
431 void DialogAFConstraintBallAndSocket::OnDeltaposSpinAnchorX(NMHDR *pNMHDR, LRESULT *pResult) {
432  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
433  if ( pNMUpDown->iDelta < 0 ) {
434  m_anchor_x += 1.0f;
435  }
436  else {
437  m_anchor_x -= 1.0f;
438  }
439  UpdateData( FALSE );
440  UpdateFile();
441  *pResult = 0;
442 }
443 
444 void DialogAFConstraintBallAndSocket::OnDeltaposSpinAnchorY(NMHDR *pNMHDR, LRESULT *pResult) {
445  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
446  if ( pNMUpDown->iDelta < 0 ) {
447  m_anchor_y += 1.0f;
448  }
449  else {
450  m_anchor_y -= 1.0f;
451  }
452  UpdateData( FALSE );
453  UpdateFile();
454  *pResult = 0;
455 }
456 
457 void DialogAFConstraintBallAndSocket::OnDeltaposSpinAnchorZ(NMHDR *pNMHDR, LRESULT *pResult) {
458  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
459  if ( pNMUpDown->iDelta < 0 ) {
460  m_anchor_z += 1.0f;
461  }
462  else {
463  m_anchor_z -= 1.0f;
464  }
465  UpdateData( FALSE );
466  UpdateFile();
467  *pResult = 0;
468 }
469 
471  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_NONE ) ) {
472  if ( constraint ) {
474  UpdateFile();
475  }
476  }
477 }
478 
480  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_CONE ) ) {
481  if ( constraint ) {
483  UpdateFile();
484  }
485  }
486 }
487 
489  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_PYRAMID ) ) {
490  if ( constraint ) {
492  UpdateFile();
493  }
494  }
495 }
496 
498  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_CONE_ANGLE ) ) ) {
499  UpdateFile();
500  }
501  else {
502  m_coneAngle = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_CONE_ANGLE ), false );
503  }
504 }
505 
507  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
508  if ( pNMUpDown->iDelta < 0 ) {
509  m_coneAngle += 1.0f;
510  }
511  else if ( m_coneAngle > 0.0f ) {
512  m_coneAngle -= 1.0f;
513  }
514  UpdateData( FALSE );
515  UpdateFile();
516  *pResult = 0;
517 }
518 
520  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE1 ) ) ) {
521  UpdateFile();
522  }
523  else {
524  m_pyramidAngle1 = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE1 ), false );
525  }
526 }
527 
529  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
530  if ( pNMUpDown->iDelta < 0 ) {
531  m_pyramidAngle1 += 1.0f;
532  }
533  else if ( m_pyramidAngle1 > 0.0f ) {
534  m_pyramidAngle1 -= 1.0f;
535  }
536  UpdateData( FALSE );
537  UpdateFile();
538  *pResult = 0;
539 }
540 
542  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE2 ) ) ) {
543  UpdateFile();
544  }
545  else {
546  m_pyramidAngle2 = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE2 ), false );
547  }
548 }
549 
551  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
552  if ( pNMUpDown->iDelta < 0 ) {
553  m_pyramidAngle2 += 1.0f;
554  }
555  else if ( m_pyramidAngle2 > 0.0f ) {
556  m_pyramidAngle2 -= 1.0f;
557  }
558  UpdateData( FALSE );
559  UpdateFile();
560  *pResult = 0;
561 }
562 
564  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_ROLL ) ) ) {
565  UpdateFile();
566  }
567  else {
568  m_limitRoll = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_ROLL ) );
569  }
570 }
571 
572 void DialogAFConstraintBallAndSocket::OnDeltaposSpinBasLimitRoll(NMHDR *pNMHDR, LRESULT *pResult) {
573  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
574  if ( pNMUpDown->iDelta < 0 ) {
575  m_limitRoll += 1.0f;
576  }
577  else {
578  m_limitRoll -= 1.0f;
579  }
580  UpdateData( FALSE );
581  UpdateFile();
582  *pResult = 0;
583 }
584 
586  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_BONE ) ) {
587  if ( constraint ) {
589  UpdateFile();
590  }
591  }
592 }
593 
595  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_ANGLES ) ) {
596  if ( constraint ) {
598  UpdateFile();
599  }
600  }
601 }
602 
604  CString str;
607  UpdateFile();
608 }
609 
611  CString str;
614  UpdateFile();
615 }
616 
618  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_PITCH ) ) ) {
619  UpdateFile();
620  }
621  else {
622  m_limitPitch = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_PITCH ) );
623  }
624 }
625 
627  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
628  if ( pNMUpDown->iDelta < 0 ) {
629  m_limitPitch += 1.0f;
630  }
631  else {
632  m_limitPitch -= 1.0f;
633  }
634  UpdateData( FALSE );
635  UpdateFile();
636  *pResult = 0;
637 }
638 
640  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_YAW ) ) ) {
641  UpdateFile();
642  }
643  else {
644  m_limitYaw = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_YAW ) );
645  }
646 }
647 
648 void DialogAFConstraintBallAndSocket::OnDeltaposSpinBasLimitYaw(NMHDR *pNMHDR, LRESULT *pResult) {
649  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
650  if ( pNMUpDown->iDelta < 0 ) {
651  m_limitYaw += 1.0f;
652  }
653  else {
654  m_limitYaw -= 1.0f;
655  }
656  UpdateData( FALSE );
657  UpdateFile();
658  *pResult = 0;
659 }
660 
662  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_AXIS_BONE ) ) {
663  if ( constraint ) {
665  UpdateFile();
666  }
667  }
668 }
669 
671  if ( IsDlgButtonChecked( IDC_RADIO_BAS_LIMIT_AXIS_ANGLES ) ) {
672  if ( constraint ) {
674  UpdateFile();
675  }
676  }
677 }
678 
680  CString str;
683  UpdateFile();
684 }
685 
687  CString str;
690  UpdateFile();
691 }
692 
694  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_AXIS_PITCH ) ) ) {
695  UpdateFile();
696  }
697  else {
699  }
700 }
701 
703  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
704  if ( pNMUpDown->iDelta < 0 ) {
705  m_limitAxisPitch += 1.0f;
706  }
707  else {
708  m_limitAxisPitch -= 1.0f;
709  }
710  UpdateData( FALSE );
711  UpdateFile();
712  *pResult = 0;
713 }
714 
716  if ( EditControlEnterHit( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_AXIS_YAW ) ) ) {
717  UpdateFile();
718  }
719  else {
720  m_limitAxisYaw = EditVerifyFloat( (CEdit *) GetDlgItem( IDC_EDIT_BAS_LIMIT_AXIS_YAW ) );
721  }
722 }
723 
725  LPNMUPDOWN pNMUpDown = reinterpret_cast<LPNMUPDOWN>(pNMHDR);
726  if ( pNMUpDown->iDelta < 0 ) {
727  m_limitAxisYaw += 1.0f;
728  }
729  else {
730  m_limitAxisYaw -= 1.0f;
731  }
732  UpdateData( FALSE );
733  UpdateFile();
734  *pResult = 0;
735 }
afx_msg void OnDeltaposSpinAnchorX(NMHDR *pNMHDR, LRESULT *pResult)
jointHandle_t
Definition: Model.h:156
BOOL DefaultOnToolTipNotify(const toolTip_t *toolTips, UINT id, NMHDR *pNMHDR, LRESULT *pResult)
Definition: StdAfx.cpp:104
#define IDC_EDIT_BAS_LIMIT_ROLL
afx_msg void OnDeltaposSpinBasLimitPyramidAngle2(NMHDR *pNMHDR, LRESULT *pResult)
virtual void AF_UpdateEntities(const char *fileName)
Definition: AFEntity.cpp:2856
#define IDC_RADIO_BAS_LIMIT_AXIS_ANGLES
#define IDC_SPIN_BAS_LIMIT_CONE_ANGLE
idAFVector anchor
Definition: DeclAF.h:125
#define IDC_EDIT_BAS_LIMIT_AXIS_PITCH
int SetSafeComboBoxSelection(CComboBox *combo, const char *string, int skip)
Definition: StdAfx.cpp:319
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
#define IDC_EDIT_ANCHOR_X
#define IDC_SPIN_BAS_LIMIT_ROLL
#define IDC_COMBO_BAS_LIMIT_JOINT1
float z
Definition: Vector.h:320
#define IDC_COMBO_BAS_LIMIT_AXIS_JOINT1
#define IDD_DIALOG_AF_CONSTRAINT_BALLANDSOCKET
const char * GetName(void) const
Definition: DeclManager.h:140
virtual int OnToolHitTest(CPoint point, TOOLINFO *pTI) const
afx_msg void OnDeltaposSpinBasLimitAxisPitch(NMHDR *pNMHDR, LRESULT *pResult)
float x
Definition: Vector.h:318
int i
Definition: process.py:33
#define BOOL
Definition: mprintf.c:71
#define IDC_RADIO_BAS_LIMIT_BONE
#define IDC_EDIT_ANCHOR_Z
afx_msg void OnDeltaposSpinAnchorY(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_EDIT_BAS_LIMIT_PITCH
idGameEdit * gameEdit
Definition: GameEdit.cpp:668
#define IDC_RADIO_BAS_LIMIT_AXIS_BONE
#define IDC_RADIO_BAS_LIMIT_CONE
virtual const char * GetJointName(jointHandle_t handle) const =0
afx_msg void OnDeltaposSpinBasLimitPyramidAngle1(NMHDR *pNMHDR, LRESULT *pResult)
idStr joint1
Definition: DeclAF.h:68
idAngles ToAngles(void) const
Definition: Vector.cpp:130
const idVec3 & ToVec3(void) const
Definition: DeclAF.h:78
const GLubyte * c
Definition: glext.h:4677
idVec3 ToForward(void) const
Definition: Angles.cpp:117
#define IDC_EDIT_BAS_LIMIT_CONE_ANGLE
#define IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE1
virtual void DoDataExchange(CDataExchange *pDX)
#define NULL
Definition: Lib.h:88
afx_msg void OnDeltaposSpinBasLimitRoll(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_EDIT_BAS_LIMIT_YAW
float y
Definition: Vector.h:319
#define IDC_SPIN_BAS_LIMIT_PYRAMID_ANGLE2
#define IDC_SPIN_ANCHOR_Y
#define IDC_SPIN_BAS_LIMIT_PITCH
int DefaultOnToolHitTest(const toolTip_t *toolTips, const CDialog *dialog, CPoint point, TOOLINFO *pTI)
Definition: StdAfx.cpp:75
#define IDC_RADIO_BAS_LIMIT_NONE
#define IDC_EDIT_BAS_LIMIT_PYRAMID_ANGLE2
float roll
Definition: Angles.h:55
virtual idRenderModel * ANIM_GetModelFromName(const char *modelName)
int UnsetSafeComboBoxSelection(CComboBox *combo, CString &string)
Definition: StdAfx.cpp:366
float pitch
Definition: Angles.h:53
#define IDC_COMBO_BAS_LIMIT_AXIS_JOINT2
#define IDC_SPIN_ANCHOR_X
bool EditControlEnterHit(CEdit *edit)
Definition: StdAfx.cpp:154
#define IDC_EDIT_ANCHOR_Y
#define IDC_RADIO_BAS_LIMIT_PYRAMID
#define IDC_SPIN_BAS_LIMIT_PYRAMID_ANGLE1
int GetSafeComboBoxSelection(CComboBox *combo, CString &string, int skip)
Definition: StdAfx.cpp:341
#define IDC_COMBO_BAS_LIMIT_JOINT2
afx_msg void OnDeltaposSpinAnchorZ(NMHDR *pNMHDR, LRESULT *pResult)
idAFVector limitAxis
Definition: DeclAF.h:134
void AFDialogSetFileModified(void)
Definition: DialogAF.cpp:613
float yaw
Definition: Angles.h:54
float limitAngles[3]
Definition: DeclAF.h:135
tuple f
Definition: idal.py:89
afx_msg void OnDeltaposSpinBasLimitYaw(NMHDR *pNMHDR, LRESULT *pResult)
idStr model
Definition: DeclAF.h:172
#define IDC_RADIO_ANCHOR_JOINT
enum idDeclAF_Constraint::@49 limit
#define IDC_RADIO_BAS_LIMIT_ANGLES
#define IDC_SPIN_ANCHOR_Z
#define IDC_SPIN_BAS_LIMIT_AXIS_YAW
const char * c_str(void) const
Definition: Str.h:487
#define FALSE
Definition: mprintf.c:70
enum idAFVector::@48 type
virtual int NumJoints(void) const =0
afx_msg void OnDeltaposSpinBasLimitAxisYaw(NMHDR *pNMHDR, LRESULT *pResult)
#define TRUE
Definition: mprintf.c:69
#define IDC_COMBO_ANCHOR_JOINT
#define IDC_SPIN_BAS_LIMIT_AXIS_PITCH
idAFVector shaft[2]
Definition: DeclAF.h:127
#define IDC_RADIO_ANCHOR_COORDINATES
#define IDC_EDIT_BAS_LIMIT_AXIS_YAW
afx_msg void OnDeltaposSpinBasLimitPitch(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnDeltaposSpinBasLimitConeAngle(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_SPIN_BAS_LIMIT_YAW
float EditVerifyFloat(CEdit *edit, bool allowNegative)
Definition: StdAfx.cpp:175
idStr joint2
Definition: DeclAF.h:69