mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-17 11:00:38 +02:00
Added material assignment in model view, citybuilder, and transalte scale and offset window to model view.
This commit is contained in:
@@ -15,6 +15,7 @@ This file is part of the IceTech GPL Source Code.
|
||||
class idDeclModelDef;
|
||||
class idDeclModelDefInterface;
|
||||
class idRenderModel;
|
||||
class idMaterial;
|
||||
class idAnim;
|
||||
class idMD5Anim;
|
||||
class idJointMat;
|
||||
@@ -23,6 +24,7 @@ class idJointMat;
|
||||
#define ID_MODELVIEW_DECLCOMBO 0x7A60
|
||||
#define ID_MODELVIEW_REFRESH 0x7A61
|
||||
#define ID_MODELVIEW_SHOWSKELETON 0x7A62
|
||||
#define ID_MODELVIEW_SHOWPLAYERMESH 0x7A7F
|
||||
#define ID_MODELVIEW_MESHTREE 0x7A63
|
||||
#define ID_MODELVIEW_ANIMLIST 0x7A64
|
||||
#define ID_MODELVIEW_RENDER 0x7A65
|
||||
@@ -36,6 +38,21 @@ class idJointMat;
|
||||
#define ID_MODELVIEW_TIMETEXT 0x7A6D
|
||||
#define ID_MODELVIEW_TRANSPORT 0x7A6E
|
||||
#define ID_MODELVIEW_REIMPORT 0x7A6F
|
||||
#define ID_MODELVIEW_FILE_IMPORTSTATICMESH 0x7A70
|
||||
#define ID_MODELVIEW_FILE_EXPORTMD5STATIC 0x7A72
|
||||
#define ID_MODELVIEW_SURFACEMATS 0x7A73
|
||||
#define ID_MODELVIEW_SETMATERIAL 0x7A74
|
||||
#define ID_MODELVIEW_CLEARMATERIAL 0x7A75
|
||||
#define ID_MODELVIEW_TRANSFORM_TX 0x7A76
|
||||
#define ID_MODELVIEW_TRANSFORM_TY 0x7A77
|
||||
#define ID_MODELVIEW_TRANSFORM_TZ 0x7A78
|
||||
#define ID_MODELVIEW_TRANSFORM_RX 0x7A79
|
||||
#define ID_MODELVIEW_TRANSFORM_RY 0x7A7A
|
||||
#define ID_MODELVIEW_TRANSFORM_RZ 0x7A7B
|
||||
#define ID_MODELVIEW_TRANSFORM_SX 0x7A7C
|
||||
#define ID_MODELVIEW_TRANSFORM_SY 0x7A7D
|
||||
#define ID_MODELVIEW_TRANSFORM_SZ 0x7A7E
|
||||
#define ID_MODELVIEW_INVERTNORMALS 0x7A80
|
||||
|
||||
#define WM_MODELVIEW_ANIMTIME_CHANGED (WM_APP + 0x260)
|
||||
|
||||
@@ -57,12 +74,14 @@ public:
|
||||
BOOL Create(CWnd* pParent, UINT nID);
|
||||
|
||||
void SetModelDecl(const idDeclModelDef* modelDecl);
|
||||
void SetStandaloneModel(idRenderModel* model, const char* displayName);
|
||||
void SetAnimation(const idMD5Anim* anim, int animLengthMS, int numFrames, const char* displayName);
|
||||
void SetAnimationTimeMS(int timeMS);
|
||||
void PlayAnimation();
|
||||
void PauseAnimation();
|
||||
void StopAnimation();
|
||||
void SetShowSkeleton(BOOL showSkeleton);
|
||||
void SetShowPlayerMesh(BOOL showPlayerMesh);
|
||||
void SetActive(BOOL active);
|
||||
void FocusRenderWindow();
|
||||
|
||||
@@ -71,6 +90,16 @@ public:
|
||||
int GetAnimationFrames() const;
|
||||
BOOL HasAnimation() const;
|
||||
BOOL IsPlaying() const;
|
||||
idRenderModel* CurrentModel() const;
|
||||
const idMaterial* SurfaceMaterialForSurface(int surfaceNum, const idMaterial* fallback) const;
|
||||
const idMaterial* SurfaceMaterialOverride(int surfaceNum) const;
|
||||
void SetSurfaceMaterialOverride(int surfaceNum, const idMaterial* material);
|
||||
void ClearSurfaceMaterialOverride(int surfaceNum);
|
||||
void ClearSurfaceMaterialOverrides();
|
||||
void SetStaticTransform(const idVec3& translate, const idVec3& rotate, const idVec3& scale);
|
||||
void ResetStaticTransform();
|
||||
bool InvertCurrentModelNormals();
|
||||
bool WriteCurrentMD5Static(const char* fileName) const;
|
||||
|
||||
private:
|
||||
HDC m_hDC;
|
||||
@@ -79,19 +108,31 @@ private:
|
||||
const idDeclModelDefInterface* m_modelDecl;
|
||||
idRenderModel* m_model;
|
||||
idRenderModel* m_cachedDynamicModel;
|
||||
const idDeclModelDefInterface* m_playerModelDecl;
|
||||
idRenderModel* m_playerModel;
|
||||
idRenderModel* m_cachedPlayerModel;
|
||||
|
||||
idJointMat* m_joints;
|
||||
idJointMat* m_playerJoints;
|
||||
int m_numJoints;
|
||||
int m_numPlayerJoints;
|
||||
BOOL m_haveAnimFrame;
|
||||
BOOL m_havePlayerFrame;
|
||||
|
||||
const idMD5Anim* m_anim;
|
||||
int m_animLengthMS;
|
||||
int m_animFrames;
|
||||
int m_animTimeMS;
|
||||
CString m_animDisplayName;
|
||||
CString m_standaloneDisplayName;
|
||||
idList<const idMaterial*> m_surfaceMaterialOverrides;
|
||||
idVec3 m_staticTranslate;
|
||||
idVec3 m_staticRotate;
|
||||
idVec3 m_staticScale;
|
||||
DWORD m_lastTick;
|
||||
|
||||
BOOL m_showSkeleton;
|
||||
BOOL m_showPlayerMesh;
|
||||
BOOL m_active;
|
||||
BOOL m_playing;
|
||||
BOOL m_dragging;
|
||||
@@ -107,19 +148,25 @@ private:
|
||||
void InitGL();
|
||||
void ShutdownGL();
|
||||
void FreeJointBuffer();
|
||||
void FreePlayerJointBuffer();
|
||||
void AllocateJointBuffer();
|
||||
void ResetCachedDynamicModel();
|
||||
void ResetCachedPlayerModel();
|
||||
void ResolveModelFromGameEdit();
|
||||
void ResolvePlayerReferenceModel();
|
||||
void UpdateAnimationFrame(BOOL forceResetCachedModel);
|
||||
void UpdatePlayerReferenceFrame(BOOL forceResetCachedModel);
|
||||
void NotifyAnimationTimeChanged();
|
||||
void FitCameraToModel();
|
||||
idVec3 PlayerReferenceOffset(idRenderModel* drawModel) const;
|
||||
void StepAnimation();
|
||||
|
||||
void DrawScene();
|
||||
void SetupCamera(const CRect& client);
|
||||
void DrawGrid();
|
||||
void DrawModel();
|
||||
void DrawRenderModel(idRenderModel* model, bool wireOnly);
|
||||
void DrawPlayerReferenceModel(idRenderModel* drawModel);
|
||||
void DrawRenderModel(idRenderModel* model, bool wireOnly, bool useMaterialOverrides = true, bool applyStaticTransform = true);
|
||||
void DrawSkeleton();
|
||||
void DrawOverlayText();
|
||||
|
||||
@@ -159,9 +206,19 @@ private:
|
||||
CButton m_btnRefresh;
|
||||
CButton m_btnReimport;
|
||||
CButton m_chkSkeleton;
|
||||
CButton m_chkPlayerMesh;
|
||||
CButton m_btnInvertNormals;
|
||||
CStatic m_lblMesh;
|
||||
CStatic m_lblStaticTransform;
|
||||
CStatic m_lblTransformCols[3];
|
||||
CStatic m_lblTransformRows[3];
|
||||
CEdit m_editTransform[3][3];
|
||||
CStatic m_lblSurfaceMaterials;
|
||||
CStatic m_lblAnim;
|
||||
CTreeCtrl m_treeMesh;
|
||||
CListBox m_listSurfaceMaterials;
|
||||
CButton m_btnSetSurfaceMaterial;
|
||||
CButton m_btnClearSurfaceMaterial;
|
||||
CListBox m_listAnims;
|
||||
CModelRenderWnd m_wndRender;
|
||||
CStatic m_transportPanel;
|
||||
@@ -173,20 +230,34 @@ private:
|
||||
HWND m_hMenuBar;
|
||||
|
||||
const idDeclModelDefInterface* m_modelDecl;
|
||||
idRenderModel* m_importedModel;
|
||||
CString m_importedModelPath;
|
||||
bool m_importedIsOBJ;
|
||||
bool m_importedIsMD5Static;
|
||||
BOOL m_active;
|
||||
bool m_inLayout;
|
||||
bool m_updatingTimeline;
|
||||
bool m_updatingStaticTransform;
|
||||
int m_timelineLengthMS;
|
||||
CPtrArray m_animItems;
|
||||
|
||||
private:
|
||||
void ApplyDarkTheme();
|
||||
void RedrawDarkControls();
|
||||
void ClearAnimationItems();
|
||||
void PopulateModelDecls();
|
||||
void LoadSelectedModelDecl();
|
||||
void ClearImportedModel();
|
||||
CString GetSelectedModelDeclFileName();
|
||||
void SetModelDecl(const idDeclModelDef* modelDecl);
|
||||
void PopulateStandaloneModelTree(idRenderModel* model, const char* displayName);
|
||||
void PopulateMeshTree();
|
||||
bool CurrentPreviewModelIsStatic() const;
|
||||
void ResetStaticTransformControls();
|
||||
void UpdateStaticTransformControls();
|
||||
void ReadStaticTransformControls();
|
||||
void PopulateSurfaceMaterialList();
|
||||
idRenderModel* CurrentPreviewModel() const;
|
||||
void PopulateAnimationList();
|
||||
void SelectAnimationItem(int itemIndex);
|
||||
void SelectModelDeclByName(const char* declName);
|
||||
@@ -206,11 +277,19 @@ protected:
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnDeclChanged();
|
||||
afx_msg void OnAnimChanged();
|
||||
afx_msg void OnSurfaceMaterialChanged();
|
||||
afx_msg void OnStaticTransformChanged();
|
||||
afx_msg void OnSetSurfaceMaterial();
|
||||
afx_msg void OnClearSurfaceMaterial();
|
||||
afx_msg void OnRefresh();
|
||||
afx_msg void OnReimportModel();
|
||||
afx_msg void OnNewMD5Decl();
|
||||
afx_msg void OnImportStaticMesh();
|
||||
afx_msg void OnExportMD5Static();
|
||||
afx_msg void OnAddAnimationFile();
|
||||
afx_msg void OnShowSkeleton();
|
||||
afx_msg void OnShowPlayerMesh();
|
||||
afx_msg void OnInvertNormals();
|
||||
afx_msg void OnPlay();
|
||||
afx_msg void OnPause();
|
||||
afx_msg void OnStop();
|
||||
|
||||
Reference in New Issue
Block a user