29 #include "../../idlib/precompiled.h"
32 #include "../../sys/win32/rc/AFEditor_resource.h"
57 for (
int i = 0; modelTypes[
i].
name;
i++ ) {
58 if ( modelTypes[
i].type == type ) {
59 return modelTypes[
i].
name;
66 for (
int i = 0; modelTypes[
i].
name;
i++ ) {
68 return modelTypes[
i].
type;
129 , constraintDlg(
NULL)
142 , m_selfCollision(false)
143 , m_linearFriction(0)
144 , m_angularFriction(0)
145 , m_contactFriction(0)
150 EnableToolTips(
TRUE );
167 CDialog::DoDataExchange( pDX );
266 int showBone, showOther;
362 if (
file->
bodies[j]->jointName.Icmp( jointName ) == 0 ) {
366 if ( j < file->bodies.Num() ) {
385 if (
file->
bodies[i]->jointName.Icmp(
"origin" ) == 0 ) {
390 if ( i < file->bodies.Num() ) {
461 if (
file->
bodies[i]->name.Icmp( name ) == 0 ) {
560 if ( GetStyle() & WS_VISIBLE ) {
627 idLexer src( str, str.GetLength(),
"inertiaScale" );
629 for (
int i = 0;
i < 3;
i++ ) {
630 for (
int j = 0;
j < 3;
j++ ) {
650 if ( str.GetLength() != 0 ) {
655 if ( str.GetLength() != 0 ) {
688 CDialog::OnInitDialog();
692 for (
int i = 0; modelTypes[
i].
name;
i++ ) {
711 CDialog::OnToolHitTest( point, pTI );
716 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipNotify)
717 ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipNotify)
781 if ( bShow &&
body ) {
786 CDialog::OnShowWindow( bShow, nStatus );
806 res = nameDlg.DoModal();
826 CString
name, newName;
838 if ( nameDlg.DoModal() == IDOK ) {
862 if ( MessageBox(
"Are you sure you want to delete this body and all attached constraints ?",
"Delete Body", MB_YESNO | MB_ICONQUESTION ) == IDYES ) {
903 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
904 if ( pNMUpDown->iDelta < 0 ) {
936 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
937 if ( pNMUpDown->iDelta < 0 ) {
969 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
970 if ( pNMUpDown->iDelta < 0 ) {
1004 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1005 if ( pNMUpDown->iDelta < 0 ) {
1036 UpdateData(
FALSE );
1051 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1101 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1102 if ( pNMUpDown->iDelta < 0 ) {
1108 UpdateData(
FALSE );
1123 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1124 if ( pNMUpDown->iDelta < 0 ) {
1130 UpdateData(
FALSE );
1145 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1146 if ( pNMUpDown->iDelta < 0 ) {
1152 UpdateData(
FALSE );
1185 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1186 if ( pNMUpDown->iDelta < 0 ) {
1193 UpdateData(
FALSE );
1208 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1209 if ( pNMUpDown->iDelta < 0 ) {
1216 UpdateData(
FALSE );
1231 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1232 if ( pNMUpDown->iDelta < 0 ) {
1239 UpdateData(
FALSE );
1270 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1286 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
1302 LPNMUPDOWN pNMUpDown =
reinterpret_cast<LPNMUPDOWN
>(pNMHDR);
afx_msg void OnBnClickedRadioOriginBonecenter()
BOOL DefaultOnToolTipNotify(const toolTip_t *toolTips, UINT id, NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_RADIO_MODIFY_POSITION
idAFVector contactMotorDirection
afx_msg void OnDeltaposSpinCmDensity(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnEnChangeEditCmNumsides()
#define IDC_STATIC_CM_HEIGHT
afx_msg void OnEnChangeEditFrictionDirection()
void DeleteBody(const char *name)
afx_msg void OnEnChangeEditCmWidth()
#define IDC_EDIT_AF_VECTOR_Y
afx_msg void OnDeltaposSpinAngularfriction(NMHDR *pNMHDR, LRESULT *pResult)
virtual void AF_UpdateEntities(const char *fileName)
afx_msg void OnCbnSelchangeComboBodies()
afx_msg void OnDeltaposSpinAnglesRoll(NMHDR *pNMHDR, LRESULT *pResult)
idCVarSystem * cvarSystem
#define IDC_EDIT_ANGLES_ROLL
#define IDC_SPIN_CM_NUMSIDES
idMat3 mat3_identity(idVec3(1, 0, 0), idVec3(0, 1, 0), idVec3(0, 0, 1))
#define IDC_EDIT_CM_LENGTH
#define IDC_RADIO_ORIGIN_JOINT
afx_msg void OnBnClickedButtonRenamebody()
void GetName(CString &str)
int SetSafeComboBoxSelection(CComboBox *combo, const char *string, int skip)
static int ContentsFromString(const char *str)
const char * ModelTypeToString(int type)
afx_msg void OnBnClickedRadioModifyBoth()
CONST PIXELFORMATDESCRIPTOR UINT
const char * ToString(int precision=2) const
afx_msg void OnDeltaposSpinCmNumsides(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_COMBO_BONE_JOINT1
afx_msg void OnBnClickedCheckSelfcollision()
#define IDC_STATIC_ANGLES_ROLL
#define IDC_BUTTON_DELETEBODY
#define IDC_EDIT_CM_HEIGHT
#define IDC_COMBO_MODIFIEDJOINT
afx_msg void OnEnChangeEditAnglesPitch()
#define IDC_EDIT_AF_VECTOR_Z
#define IDC_EDIT_LINEARFRICTION
afx_msg void OnOnCbnSelchangeComboOriginJoint()
#define IDC_SPIN_CM_LENGTH
#define IDC_CHECK_SELFCOLLISION
#define IDC_EDIT_ANGLES_YAW
#define IDC_RADIO_MODIFY_ORIENTATION
void SetComboBox(CComboBox *combo)
#define IDC_RADIO_ORIGIN_COORDINATES
#define IDC_SPIN_AF_VECTOR_Y
const char * GetName(void) const
afx_msg void OnDeltaposSpinContactfriction(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnCbnSelchangeComboBoneJoint2()
#define IDC_SPIN_ANGLES_YAW
afx_msg void OnBnClickedRadioOriginJoint()
afx_msg void OnOnCbnSelchangeComboOriginBoneCenterJoint1()
afx_msg void OnEnChangeEditAfVectorY()
virtual void SetCVarString(const char *name, const char *value, int flags=0)=0
afx_msg void OnEnChangeEditClipmask()
#define IDC_SPIN_AF_VECTOR_Z
GLuint GLuint GLsizei GLenum type
idAFVector frictionDirection
afx_msg void OnDeltaposSpinCmHeight(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_SPIN_CM_WIDTH
afx_msg void OnCbnSelchangeComboModifiedjoint()
afx_msg void OnCbnSelchangeComboCmType()
#define IDC_COMBO_ORIGIN_JOINT
void ValidateCollisionModelLength(bool update)
virtual void DoDataExchange(CDataExchange *pDX)
afx_msg void OnDeltaposSpinAnglesYaw(NMHDR *pNMHDR, LRESULT *pResult)
void LoadBody(const char *name)
int Icmp(const char *text) const
afx_msg void OnEnChangeEditCmInertiascale()
declAFJointMod_t jointMod
#define IDC_EDIT_CM_DENSITY
#define IDC_EDIT_CM_WIDTH
#define IDC_COMBO_ORIGIN_BONECENTER_JOINT1
afx_msg void OnEnChangeEditContainedjoints()
#define IDC_SPIN_CM_HEIGHT
afx_msg void OnDeltaposSpinAnglesPitch(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_EDIT_ANGLES_PITCH
#define IDC_SPIN_ANGLES_PITCH
#define IDC_RADIO_ORIGIN_BONECENTER
afx_msg void OnBnClickedButtonDeletebody()
virtual const char * GetJointName(jointHandle_t handle) const =0
#define IDC_COMBO_BONE_JOINT2
#define IDC_SPIN_AF_VECTOR_X
const idVec3 & ToVec3(void) const
void NewBody(const char *name)
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus)
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
#define IDC_EDIT_CM_NUMSIDES
const char * GetDataPtr(void) const
virtual int OnToolHitTest(CPoint point, TOOLINFO *pTI) const
afx_msg void OnBnClickedButtonNewbody()
static float AngleNormalize360(float angle)
afx_msg void OnEnChangeEditCmLength()
#define IDC_SPIN_ANGLES_ROLL
#define IDC_BUTTON_RENAMEBODY
afx_msg void OnDeltaposSpinLinearfriction(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_SPIN_ANGULARFRICTION
void LoadFile(idDeclAF *af)
#define IDC_STATIC_ANGLES_PITCH
#define IDC_BUTTON_CM_BROWSE
int DefaultOnToolHitTest(const toolTip_t *toolTips, const CDialog *dialog, CPoint point, TOOLINFO *pTI)
afx_msg void OnBnClickedRadioModifyOrientation()
CEdit m_frictionDirection
#define IDC_EDIT_CM_INERTIASCALE
#define IDC_EDIT_CONTAINEDJOINTS
afx_msg void OnBnClickedRadioModifyPosition()
virtual idRenderModel * ANIM_GetModelFromName(const char *modelName)
#define IDC_EDIT_CLIPMASK
static const char * ContentsToString(const int contents, idStr &str)
afx_msg void OnEnChangeEditCmHeight()
int UnsetSafeComboBoxSelection(CComboBox *combo, CString &string)
afx_msg void OnEnChangeEditAfVectorX()
virtual int WriteFloatString(const char *fmt,...) id_attribute((format(printf
afx_msg void OnEnChangeEditAnglesRoll()
afx_msg void OnDeltaposSpinAfVectorX(NMHDR *pNMHDR, LRESULT *pResult)
bool EditControlEnterHit(CEdit *edit)
#define IDC_RADIO_MODIFY_BOTH
void InitCollisionModelType(void)
#define IDC_COMBO_ORIGIN_BONECENTER_JOINT2
#define IDC_SPIN_CONTACTFRICTION
void InitModifiedJointList(void)
traceModel_t StringToModelType(const char *str)
void LoadFile(idDeclAF *af)
void ValidateCollisionModelDensity(bool update)
#define IDC_EDIT_AF_VECTOR_X
void SetName(CString &str)
afx_msg void OnOnCbnSelchangeComboOriginBoneCenterJoint2()
int GetSafeComboBoxSelection(CComboBox *combo, CString &string, int skip)
#define IDC_EDIT_CONTACTMOTORDIRECTION
#define IDC_BUTTON_NEWBODY
DialogAFConstraint * constraintDlg
void AFDialogSetFileModified(void)
CComboBox m_comboModifiedJoint
CEdit m_contactMotorDirection
CEdit m_editContainedJoints
CComboBox cm_originBoneCenterJoint2
afx_msg void OnEnChangeEditAngularfriction()
idList< idDeclAF_Body * > bodies
#define IDC_EDIT_CONTENTS
#define IDC_STATIC_CM_LENGTH
CComboBox cm_comboBoneJoint2
#define IDC_EDIT_ANGULARFRICTION
virtual BOOL OnInitDialog()
#define IDC_SPIN_LINEARFRICTION
afx_msg void OnEnChangeEditAfVectorZ()
void InitJointLists(void)
float EditSpinFloat(CEdit *edit, bool up)
const char * c_str(void) const
CComboBox cm_originBoneCenterJoint1
void ValidateCollisionModelHeight(bool update)
enum idAFVector::@48 type
virtual int NumJoints(void) const =0
afx_msg void OnDeltaposSpinCmLength(NMHDR *pNMHDR, LRESULT *pResult)
#define IDD_DIALOG_AF_BODY
afx_msg void OnDeltaposSpinCmWidth(NMHDR *pNMHDR, LRESULT *pResult)
#define IDC_EDIT_FRICTIONDIRECTION
void RenameBody(const char *oldName, const char *newName)
#define IDC_STATIC_ANGLES_YAW
afx_msg void OnEnChangeEditAnglesYaw()
static toolTip_t toolTips[]
afx_msg void OnEnChangeEditContents()
#define IDC_SPIN_CM_DENSITY
afx_msg void OnCbnSelchangeComboBoneJoint1()
#define IDC_COMBO_CM_TYPE
afx_msg void OnDeltaposSpinAfVectorY(NMHDR *pNMHDR, LRESULT *pResult)
void ValidateCollisionModelNumSides(bool update)
#define IDC_EDIT_CONTACTFRICTION
afx_msg void OnBnClickedRadioOriginCoordinates()
void ValidateCollisionModelWidth(bool update)
void InitNewRenameDeleteButtons(void)
afx_msg void OnEnChangeEditContactfriction()
afx_msg void OnDeltaposSpinAfVectorZ(NMHDR *pNMHDR, LRESULT *pResult)
afx_msg void OnEnChangeEditLinearfriction()
afx_msg void OnEnChangeEditContactMotorDirection()
float EditVerifyFloat(CEdit *edit, bool allowNegative)
afx_msg void OnEnChangeEditCmDensity()
CComboBox cm_comboBoneJoint1