• R/O
  • SSH
  • HTTPS

vima19: Commit


Commit MetaInfo

Revisão50 (tree)
Hora2020-04-02 01:49:20
Autorhgtterry

Mensagem de Log

Vima19 Motions 01/04/20

Mudança Sumário

Diff

--- Anim19_OSDN/VM_Genisis3D.cpp (revision 49)
+++ Anim19_OSDN/VM_Genisis3D.cpp (revision 50)
@@ -126,6 +126,31 @@
126126 }
127127
128128 // *************************************************************************
129+// * GetMotion ( Terry Bernie ) *
130+// *************************************************************************
131+bool VM_Genisis3D::GetMotion(char *mMotionName)
132+{
133+ geMotion* Motion = NULL;
134+ float StartTime = 0;
135+ float EndTime = 0;
136+
137+ strcpy(MotionName, mMotionName);
138+
139+ Motion = geActor_GetMotionByName(ActorDef_Memory, MotionName);
140+ if (Motion == NULL)
141+ {
142+ return 0;
143+ }
144+
145+ geMotion_GetTimeExtents(Motion, &StartTime, &EndTime);
146+ FrameSpeed = EndTime;
147+
148+ App->CL_Vm_Motions->Current_StartTime = StartTime;
149+ App->CL_Vm_Motions->Current_EndTime = EndTime;
150+ return 1;
151+}
152+
153+// *************************************************************************
129154 // * GetDefaultBones Terry Bernie *
130155 // *************************************************************************
131156 bool VM_Genisis3D::GetDefaultBones(void)
--- Anim19_OSDN/VM_Genisis3D.h (revision 49)
+++ Anim19_OSDN/VM_Genisis3D.h (revision 50)
@@ -44,6 +44,8 @@
4444
4545 void LoadActor(void);
4646
47+ bool GetMotion(char *mMotionName);
48+
4749 char MotionName[255];
4850 float m_CurrentPose;
4951 float AnimationSpeed;
--- Anim19_OSDN/VM_Motions.cpp (revision 49)
+++ Anim19_OSDN/VM_Motions.cpp (revision 50)
@@ -6,6 +6,8 @@
66
77 VM_Motions::VM_Motions()
88 {
9+ Current_StartTime = 0;
10+ Current_EndTime = 0;
911 }
1012
1113
@@ -12,3 +14,45 @@
1214 VM_Motions::~VM_Motions()
1315 {
1416 }
17+
18+
19+// *************************************************************************
20+// * Play_SelectedMotion Terry Bernie *
21+// *************************************************************************
22+void VM_Motions::Play_SelectedMotion(void)
23+{
24+ //------------------------------------------------------- RF Model
25+ if (App->CL_Vm_Model->Model_Loaded == 0) { return; }
26+ if (App->CL_Vm_Model->MotionCount == 0) { return; }
27+
28+ if (App->CL_Vm_Model->Model_Type == LoadedFile_Actor)
29+ {
30+ App->CL_Vm_Genesis3D->m_CurrentPose = 0; // Reset to frame 0;
31+
32+ bool test = App->CL_Vm_Genesis3D->GetMotion(App->CL_Vm_Genesis3D->MotionName);
33+ if (test == 0)
34+ {
35+ App->Say("Can not Find Motion");
36+ return;
37+ }
38+
39+ App->Cl19_Ogre->RenderListener->PlayActive = 1;
40+
41+ //App->CL_Motions->PlayButtonActive = 1;
42+ //App->CL_Motions->TogglePlayBmp();
43+ }
44+
45+ //------------------------------------------------------- Ogre3D Model
46+ //if (App->CL_Model_Data->ItsAnOgreModel == 1)
47+ //{
48+ // App->Cl_Ogre->OgreListener->Animate_State = App->Cl_Ogre->OgreModel_Ent->getAnimationState(SelectedMotion);
49+ // App->Cl_Ogre->OgreListener->Animate_State->setEnabled(true);
50+ // App->Cl_Ogre->OgreListener->Animate_Ogre = 1;
51+ // OgreMotionIsPlaying = 1;
52+
53+ // App->CL_Motions->AnimationExtract_Mesh(1); // Get Default Pose Mesh
54+ // App->Cl_Ogre->OgreListener->Animate_Ogre = 1;
55+ // App->CL_Motions->PlayButtonActive = 1;
56+ // App->CL_Motions->TogglePlayBmp();
57+ //}
58+}
\ No newline at end of file
--- Anim19_OSDN/VM_Motions.h (revision 49)
+++ Anim19_OSDN/VM_Motions.h (revision 50)
@@ -4,5 +4,11 @@
44 public:
55 VM_Motions();
66 ~VM_Motions();
7+
8+ void Play_SelectedMotion(void);
9+
10+
11+ float Current_StartTime;
12+ float Current_EndTime;
713 };
814
--- Anim19_OSDN/VM_TopBar.cpp (revision 49)
+++ Anim19_OSDN/VM_TopBar.cpp (revision 50)
@@ -609,11 +609,11 @@
609609
610610 case WM_COMMAND:
611611 {
612- //if (LOWORD(wParam) == IDC_SHOWTEXTURED) // 1st Person
613- //{
614- //
615- // return TRUE;
616- //}
612+ if (LOWORD(wParam) == IDC_TBPLAY) // Play Motion
613+ {
614+ App->CL_Vm_Motions->Play_SelectedMotion();
615+ return TRUE;
616+ }
617617
618618 return FALSE;
619619 }
Show on old repository browser