#include <ExCModel.h>
Inheritance diagram for ExCModel:

Public Methods | |
| ExCModel () | |
| ~ExCModel () | |
| void | Draw (void) |
| void | NextFrame (void) |
| void | PreviousFrame (void) |
| void | SetCurrentFrame (int frame) |
| void | SetInterpolationPourcentage (float inter) |
| float | GetInterpolationPourcentage (void) |
| void | SetManagerTexture (ExManagerTexture *Texture) |
| virtual void | StopRun (void) |
| virtual void | StartRun (void) |
| virtual void | StartAction (std::string Action) |
| virtual void | StopAction (void) |
| void | Forward (void) |
| void | Process (std::string Action) |
Protected Attributes | |
| ExManagerTexture * | ManagerTexture |
| int | m_CurrentFrames |
| int | m_NextFrame |
| int | m_numFrames |
| float | m_InterpolationPourcentage |
| bool | m_Transition |
| float | m_Interpolation |
| int | m_KeyFrameStartAction |
| int | m_KeyFrameStopAction |
| std::string | m_CurrentAction |
|
|
Definition at line 26 of file ExCModel.cpp. References ExCModel(), and Guard. Referenced by ExCModel(), and ~ExCModel().
00027 {
00028 Guard(ExCModel::ExCModel())
00029 UnGuard
00030 }
|
|
|
Definition at line 32 of file ExCModel.cpp. References ExCModel(), and Guard.
|
|
|
Reimplemented from ExCObject. Reimplemented in ExCModel3DS, ExCModelASC, ExCModelMD2, ExCModelMD3, and ExCModelOBJ. Definition at line 45 of file ExCModel.cpp. References DegreesToRadians(), Draw(), GetCrossProduct(), ExCVec3D::GetX(), ExCVec3D::GetY(), ExCVec3D::GetZ(), Guard, ExCObject3D::m_AngleX, ExCObject3D::m_AngleY, ExCObject3D::m_AngleZ, ExCObject3D::m_Position, ExCObject3D::m_Target, ExCObject3D::m_Up, ExCVec3D::SetX(), ExCVec3D::SetY(), and ExCVec3D::SetZ(). Referenced by ExCModelMD2::Draw(), ExCModelASC::Draw(), ExCModel3DS::Draw(), and Draw().
00046 {
00047 Guard(void ExCModel::Draw(void))
00048 //move objet to position
00049 glRotatef(-90,1,0,0);//just for align with 3ds max cord
00050 glTranslatef(m_Position.GetX(),m_Position.GetY(),m_Position.GetZ());
00051 //rotate object
00052 glRotatef(m_AngleX,1,0,0);
00053 glRotatef(m_AngleY,0,1,0);
00054 glRotatef(m_AngleZ,0,0,1);
00055
00056 //m_AngleX-=90;
00057 if(m_AngleX<0){m_AngleX=360-m_AngleX;}
00058 if(m_AngleX>359)m_AngleX=0;
00059 if(m_AngleY<0)m_AngleY=359;
00060 if(m_AngleY>359)m_AngleY=0;
00061 if(m_AngleZ<0)m_AngleZ=359;
00062 if(m_AngleZ>359)m_AngleZ=0;
00063
00064 float cosY,cosP,cosR;
00065 float sinY,sinP,sinR;
00066
00067 cosY=cosf(DegreesToRadians(m_AngleY));
00068 cosP=cosf(DegreesToRadians(m_AngleX));
00069 cosR=cosf(DegreesToRadians(m_AngleZ));
00070
00071 sinY=sinf(DegreesToRadians(m_AngleY));
00072 sinP=sinf(DegreesToRadians(m_AngleX));
00073 sinR=sinf(DegreesToRadians(m_AngleZ));
00074
00075 ExCVec3D fwd,side,vtmp;
00076
00077 fwd.SetX(sinY*cosP);
00078 fwd.SetY(sinP);
00079 fwd.SetZ(cosP*-cosY);
00080
00081 m_Up.SetX((-cosY*sinR)-(sinY*sinP*cosR));
00082 m_Up.SetY(cosP*cosR);
00083 m_Up.SetZ((-sinY*sinR)-(sinP*cosR*-cosY));
00084
00085 //m_Position=m_Position+((m_Target-m_Position)*m_speed);
00086 side=GetCrossProduct(fwd,m_Up);
00087
00088 /*
00089 vtmp=side;
00090 side=fwd;
00091 fwd=vtmp;
00092 */
00093
00094
00095 m_Target=fwd+m_Position;
00096 //Draw force vector
00097 /*glDisable(GL_LIGHTING);
00098 glLineWidth(20);
00099 glColor3f(0,0,1);
00100 glBegin(GL_LINES);
00101 glVertex3f(0,0,0);
00102 glVertex3f(m_Up.GetX()*5,m_Up.GetY()*5,m_Up.GetZ()*5);
00103 glEnd();
00104
00105 glColor3f(0,1,0);
00106 glBegin(GL_LINES);
00107 glVertex3f(0,0,0);
00108 glVertex3f(fwd.GetX()*5,fwd.GetY()*5,fwd.GetZ()*5);
00109 glEnd();
00110
00111 glColor3f(1,0,0);
00112 glBegin(GL_LINES);
00113 glVertex3f(0,0,0);
00114 glVertex3f(side.GetX()*5,side.GetY()*5,side.GetZ()*5);
00115 glEnd();
00116
00117
00118 glColor3f(1,1,1);
00119 glBegin(GL_LINES);
00120 glVertex3f(0,0,0);
00121 glVertex3f(m_Target.GetX(),m_Target.GetY(),m_Target.GetZ());
00122 glEnd();*/
00123 /*glColor3f(0.5,0,0.5);
00124 glBegin(GL_LINES);
00125 glVertex3f(0,0,0);
00126 glVertex3f(m_Position.GetX(),m_Position.GetY(),m_Position.GetZ());
00127 glEnd();
00128 glColor3f(0.0,0.5,0.5);
00129 glBegin(GL_LINES);
00130 glVertex3f(m_Target.GetX(),m_Target.GetY(),m_Target.GetZ());
00131 glVertex3f(m_Position.GetX(),m_Position.GetY(),m_Position.GetZ());
00132 glEnd();*/
00133 glLineWidth(1.5);
00134 glColor3f(1,1,1);
00135 UnGuard
00136 }
|
|
|
Definition at line 38 of file ExCModel.cpp. References Forward(), Guard, ExCObject3D::m_Position, and ExCObject3D::m_Target. Referenced by Forward().
00039 {
00040 Guard(void ExCModel::Forward(void))
00041 m_Position=m_Position+m_Target;
00042 UnGuard
00043 }
|
|
|
Definition at line 78 of file ExCModel.h. References m_InterpolationPourcentage.
00078 {m_InterpolationPourcentage=inter;}
|
|
|
Definition at line 138 of file ExCModel.cpp. References Guard, m_CurrentFrames, m_numFrames, and NextFrame(). Referenced by ExManagerModel::InputAction(), and NextFrame().
00139 {
00140 Guard(void ExCModel::NextFrame(void))
00141 m_CurrentFrames++;
00142 if(m_CurrentFrames>m_numFrames)m_CurrentFrames=1;
00143 UnGuard
00144 }
|
|
|
Definition at line 146 of file ExCModel.cpp. References Guard, m_CurrentFrames, m_numFrames, and PreviousFrame(). Referenced by PreviousFrame().
00147 {
00148 Guard(void ExCModel::PreviousFrame(void))
00149 m_CurrentFrames--;
00150 if(m_CurrentFrames<1)m_CurrentFrames=m_numFrames;
00151 UnGuard
00152 }
|
|
|
Reimplemented in ExCModelMD2. |
|
|
Definition at line 154 of file ExCModel.cpp. References Guard, m_CurrentFrames, m_numFrames, and SetCurrentFrame(). Referenced by SetCurrentFrame().
00155 {
00156 Guard(void ExCModel::SetCurrentFrame(int frame))
00157 if(frame>0&&frame<m_numFrames)
00158 m_CurrentFrames=frame;
00159 UnGuard
00160 }
|
|
|
Definition at line 77 of file ExCModel.h.
00078 {m_InterpolationPourcentage=inter;}
|
|
|
Definition at line 82 of file ExCModel.h. References ManagerTexture. Referenced by ExManagerModel::Load3DS(), ExManagerModel::LoadASC(), and ExManagerModel::LoadMD2().
00083 {ManagerTexture = Texture;}
|
|
|
Reimplemented in ExCModelMD2. Definition at line 178 of file ExCModel.cpp. References Guard. Referenced by ExManagerModel::InputAction().
00179 {
00180 Guard(void ExCModel::SStartAction(std::string Action))
00181 UnGuard
00182 }
|
|
|
Reimplemented in ExCModelMD2. Definition at line 162 of file ExCModel.cpp. References Guard, and StartRun(). Referenced by StartRun().
00163 {
00164 Guard(void ExCModel::StartRun(void))
00165 //m_CurrentFrames=40;
00166 //m_Transition=true;
00167 UnGuard
00168 }
|
|
|
Reimplemented in ExCModelMD2. Definition at line 184 of file ExCModel.cpp. References Guard, and StopAction(). Referenced by ExManagerModel::InputAction(), and StopAction().
00185 {
00186 Guard(void ExCModel::StopAction(void))
00187 UnGuard
00188 } |
|
|
Reimplemented in ExCModelMD2. Definition at line 170 of file ExCModel.cpp. References Guard, and StopRun(). Referenced by StopRun().
00171 {
00172 Guard(void ExCModel::StopRun(void))
00173 //m_CurrentFrames=1;
00174 //m_Transition=false;
00175 UnGuard
00176 }
|
|
|
Definition at line 62 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), ExCModelMD2::Process(), and ExCModelMD2::StartAction(). |
|
|
Definition at line 54 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), ExCModelMD2::ExCModelMD2(), NextFrame(), PreviousFrame(), SetCurrentFrame(), ExCModelMD2::StartAction(), ExCModelMD2::StopAction(), and ExCModelMD2::StopRun(). |
|
|
Definition at line 59 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), and ExCModelMD2::ExCModelMD2(). |
|
|
Definition at line 57 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), ExCModelMD2::ExCModelMD2(), and GetInterpolationPourcentage(). |
|
|
Definition at line 60 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), and ExCModelMD2::StartAction(). |
|
|
Definition at line 61 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), and ExCModelMD2::StartAction(). |
|
|
Definition at line 55 of file ExCModel.h. Referenced by ExCModelMD2::Draw(), and ExCModelMD2::ExCModelMD2(). |
|
|
Definition at line 56 of file ExCModel.h. Referenced by ExCModelMD2::Load(), NextFrame(), PreviousFrame(), and SetCurrentFrame(). |
|
|
Definition at line 58 of file ExCModel.h. Referenced by ExCModelMD2::ExCModelMD2(), ExCModelMD2::StartAction(), ExCModelMD2::StartRun(), ExCModelMD2::StopAction(), and ExCModelMD2::StopRun(). |
|
|
Definition at line 53 of file ExCModel.h. Referenced by ExCModelASC::BuildList(), ExCModel3DS::BuildList(), ExCModelMD2::Draw(), ExCModelMD2::Load(), and ExCModel3DS::ReadFace(). |
1.3-rc1