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

Public Methods | |
| ExCObject3D () | |
| virtual | ~ExCObject3D () |
| void | SetCurrentState (bool state) |
| void | ShowInfo (void) |
| void | SetShowInfoState (bool state) |
| bool | GetShowInfoState (void) |
| void | SetAngleX (float Angle) |
| void | SetAngleY (float Angle) |
| void | SetAngleZ (float Angle) |
| float | GetAngleX (void) |
| float | GetAngleY (void) |
| float | GetAngleZ (void) |
| void | SetAcceleration (double Acceleration) |
| double | GetAcceleration (void) |
| void | SetVelocity (ExCVec3D Velocity) |
| void | SetVelocity (float x, float y, float z) |
| ExCVec3D | GetVelocity (void) |
| void | SetGravity (ExCVec3D Gravity) |
| void | SetGravity (float x, float y, float z) |
| ExCVec3D | GetGravity (void) |
| void | SetPosition (ExCVec3D Position) |
| void | SetPosition (float x, float y, float z) |
| ExCVec3D | GetPosition (void) |
| void | SetTarget (ExCVec3D Target) |
| void | SetTarget (float x, float y, float z) |
| ExCVec3D | GetTarget (void) |
| void | Rotate (float angleX, float angleY, float angleZ) |
| void | Rotate (void) |
Data Fields | |
| ExCVec3D | m_Position |
| ExCVec3D | m_Target |
| float | m_AngleX |
| float | m_AngleY |
| float | m_AngleZ |
| int | m_speed |
Protected Attributes | |
| ExCVec3D | m_Up |
| ExCVec3D | m_Velocity |
| ExCVec3D | m_Gravity |
| double | m_Acceleration |
| double | m_RefreshTime |
| double | m_Life |
| double | m_StartingLife |
| float | m_Size |
| float | m_Mass |
| bool | m_ShowInfo |
| bool | m_CurrentObject |
|
|
Definition at line 28 of file ExCObject3D.cpp. References ExCObject::ExCObject(), m_Acceleration, m_AngleX, m_AngleY, m_AngleZ, m_CurrentObject, m_Gravity, m_Life, m_Mass, m_Position, m_RefreshTime, m_ShowInfo, m_Size, m_StartingLife, m_Velocity, ExCObject::SetName(), ExCObject::SetType(), and ExCVec3D::SetValue().
00029 {
00030 ExCObject::ExCObject();
00031 m_Size=1.0;
00032 m_RefreshTime=0.01f;
00033 m_Life=0;
00034 m_StartingLife=glutGet(GLUT_ELAPSED_TIME)/1000;
00035 m_Mass=100;
00036 m_ShowInfo=false;
00037 m_CurrentObject=false;
00038 m_Velocity.SetValue(0.01f,0.0f,0.0f);
00039 m_Position.SetValue(0.0f,0.0f,0.0f);
00040 m_Gravity.SetValue(0.0f,0.0f,0.0f);
00041 m_Acceleration=0.0f;
00042 m_AngleX=0.0f;
00043 m_AngleY=0.0f;
00044 m_AngleZ=0.0f;
00045
00046 SetName("ExCObject3D");
00047 SetType(typeid(this).name());
00048 }
|
|
|
Definition at line 50 of file ExCObject3D.cpp.
00051 {
00052
00053 }
|
|
|
Definition at line 79 of file ExCObject3D.h. References m_Acceleration.
00079 {m_Acceleration=Acceleration;}
|
|
|
Definition at line 74 of file ExCObject3D.h.
00075 {return m_AngleX;}
|
|
|
Definition at line 75 of file ExCObject3D.h. References m_AngleX.
00075 {return m_AngleX;}
|
|
|
Definition at line 76 of file ExCObject3D.h. References m_AngleY.
00076 {return m_AngleY;}
|
|
|
Definition at line 87 of file ExCObject3D.h.
|
|
|
Definition at line 91 of file ExCObject3D.h. Referenced by ExCCameraChase::Draw().
00091 {m_Position=ExCVec3D(x,y,z);}
|
|
|
Definition at line 69 of file ExCObject3D.h. References m_ShowInfo.
00069 {m_ShowInfo=state;}
|
|
|
Definition at line 95 of file ExCObject3D.h.
|
|
|
Definition at line 83 of file ExCObject3D.h.
00083 {m_Velocity=ExCVec3D(x,y,z);}
|
|
|
Definition at line 138 of file ExCObject3D.cpp. References GetQuaternionFromEuler(), m_AngleX, m_AngleY, and m_AngleZ. Referenced by Rotate().
00139 {
00140 if(m_AngleX<0)m_AngleX=359;
00141 if(m_AngleX>359)m_AngleX=0;
00142 if(m_AngleY<0)m_AngleY=359;
00143 if(m_AngleY>359)m_AngleY=0;
00144 if(m_AngleZ<0)m_AngleZ=359;
00145 if(m_AngleZ>359)m_AngleZ=0;
00146
00147 ExQuaternion quat;
00148 ExCMatrix4x4 Matr;
00149 ExCVec3D VecX,VecY,VecZ,VecDir;
00150
00151 quat=GetQuaternionFromEuler(m_AngleX,m_AngleY,m_AngleZ);
00152 //Matr=GetMatrixFromQuaternion(quat);
00153 //Matr=GetMatrixFromEuler(m_AngleX,m_AngleY,m_AngleZ);
00154
00155 /*VecX.m_Vector[0]=(float)Matr.m_Matrix[0];
00156 VecX.m_Vector[1]=(float)Matr.m_Matrix[1];
00157 VecX.m_Vector[2]=(float)Matr.m_Matrix[2];
00158 VecY.m_Vector[0]=(float)Matr.m_Matrix[4];
00159 VecY.m_Vector[1]=(float)Matr.m_Matrix[5];
00160 VecY.m_Vector[2]=(float)Matr.m_Matrix[6];
00161 VecZ.m_Vector[0]=(float)Matr.m_Matrix[8];
00162 VecZ.m_Vector[1]=(float)Matr.m_Matrix[9];
00163 VecZ.m_Vector[2]=(float)Matr.m_Matrix[10];
00164
00165 VecDir.m_Vector[0]=VecX.GetVectorLenght();
00166 VecDir.m_Vector[1]=VecY.GetVectorLenght();
00167 VecDir.m_Vector[2]=VecZ.GetVectorLenght();
00168 VecDir=VecX+VecY+VecZ;
00169 std::cout<<"Angle X:"<<m_AngleX<<" Y:"<<m_AngleY<<" Z:"<<m_AngleZ<<std::endl;
00170 std::cout<<"Quater :"<<quat<<std::endl;
00171 std::cout<<"Matrice:"<<Matr<<std::endl;
00172 std::cout<<"vec X:"<<VecX<<std::endl;
00173 std::cout<<"vec Y:"<<VecY<<std::endl;
00174 std::cout<<"vec Z:"<<VecZ<<std::endl;
00175 std::cout<<"vec dir:"<<VecDir<<std::endl;
00176 std::cout<<"vel bef:"<<m_Velocity<<std::endl;
00177 //std::cout<<"vec aft:"<<m_Velocity<<std::endl;
00178
00179
00180 m_Target.SetX((Cos[(int)m_AngleY]));
00181 m_Target.SetZ((Sin[(int)m_AngleY]));
00182 m_Target.SetY((Sin[(int)m_AngleX]));
00183 std::cout<<"vec target:"<<m_Target<<std::endl;*/
00184 //VecDir=GetAxisFromQuaternion(quat);
00185 //m_Velocity=m_Velocity*VecDir;
00186 //std::cout<<"vec dir:"<<VecDir<<std::endl;
00187 //std::cout<<"vec vel:"<<m_Velocity<<std::endl;
00188
00189 }
|
|
||||||||||||||||
|
Definition at line 130 of file ExCObject3D.cpp. References Rotate(), SetAngleX(), SetAngleY(), and SetAngleZ().
|
|
|
Definition at line 78 of file ExCObject3D.h.
00079 {m_Acceleration=Acceleration;}
|
|
|
Definition at line 110 of file ExCObject3D.cpp. References m_AngleX. Referenced by Rotate().
|
|
|
Definition at line 116 of file ExCObject3D.cpp. References m_AngleY. Referenced by Rotate().
|
|
|
Definition at line 122 of file ExCObject3D.cpp. References m_AngleZ. Referenced by Rotate().
00123 {
00124 /*if(m_AngleZ<0)m_AngleZ=359;
00125 if(m_AngleZ>359)m_AngleZ=0;*/
00126 m_AngleZ=Angle;
00127 }
|
|
|
Definition at line 65 of file ExCObject3D.h. References m_CurrentObject. Referenced by ExManagerEntite::Add(), and ExManagerEntite::NewObject().
00066 {m_CurrentObject=state;}
|
|
||||||||||||||||
|
Definition at line 86 of file ExCObject3D.h.
00086 {m_Gravity=Gravity;}
|
|
|
Definition at line 85 of file ExCObject3D.h.
00086 {m_Gravity=Gravity;}
|
|
||||||||||||||||
|
Definition at line 90 of file ExCObject3D.h.
00090 {m_Position=Position;}
|
|
|
Definition at line 89 of file ExCObject3D.h. Referenced by ExManagerCam::NewObject().
00090 {m_Position=Position;}
|
|
|
Definition at line 68 of file ExCObject3D.h.
00069 {m_ShowInfo=state;}
|
|
||||||||||||||||
|
Definition at line 94 of file ExCObject3D.h.
00094 {m_Target=Target;}
|
|
|
Definition at line 93 of file ExCObject3D.h.
00094 {m_Target=Target;}
|
|
||||||||||||||||
|
Definition at line 82 of file ExCObject3D.h.
00082 {m_Velocity=Velocity;}
|
|
|
Definition at line 81 of file ExCObject3D.h.
00082 {m_Velocity=Velocity;}
|
|
|
Definition at line 55 of file ExCObject3D.cpp. References data, ExCObject::GetId(), ExCObject::GetName(), ExCVec3D::GetX(), ExCVec3D::GetY(), ExCVec3D::GetZ(), Guard, m_Acceleration, m_Gravity, m_Life, m_Position, m_Velocity, and ShowInfo(). Referenced by ExCComposed::Draw(), and ShowInfo().
00056 {
00057 Guard(void ExCObject3D::ShowInfo(void))
00058
00059 char *CIdName;
00060 char *CPosition;
00061 char *CVelocity;
00062 char *CAcceleration;
00063 char *CGravity;
00064 char *CLife;
00065
00066 CIdName= new char[strlen("Name : Id:")+strlen(GetName().data())+7];
00067 sprintf(CIdName,"Name :%s Id:%ld",GetName(),GetId());
00068
00069 CPosition= new char[strlen("Position X: Y: Z:")+30];
00070 sprintf(CPosition,"Position X:%f Y:%f Z:%f",m_Position.GetX(),m_Position.GetY(),m_Position.GetZ());
00071
00072 CVelocity= new char[strlen("Velocity X: Y: Z:")+30];
00073 sprintf(CVelocity,"Velocity X:%f Y:%f Z:%f",m_Velocity.GetX(),m_Velocity.GetY(),m_Velocity.GetZ());
00074
00075 CGravity= new char[strlen("Gravity X: Y: Z:")+30];
00076 sprintf(CGravity,"Gravity X:%f Y:%f Z:%f",m_Gravity.GetX(),m_Gravity.GetY(),m_Gravity.GetZ());
00077
00078 CAcceleration= new char[strlen("Acceleration :")+30];
00079 sprintf(CAcceleration,"Acceleration :%f",m_Acceleration);
00080
00081 CLife= new char[strlen("Life :")+10];
00082 sprintf(CLife,"Life :%f",m_Life);
00083
00084 /*ExNihilo::EnterOrthoMode();
00085 glDisable(GL_LIGHTING);
00086 ExNihilo::RenderBitmapString(500,500,(void *)GLUT_BITMAP_HELVETICA_12,CIdName);
00087 ExNihilo::RenderBitmapString(500,515,(void *)GLUT_BITMAP_HELVETICA_12,CPosition);
00088 ExNihilo::RenderBitmapString(500,530,(void *)GLUT_BITMAP_HELVETICA_12,CVelocity);
00089 ExNihilo::RenderBitmapString(500,545,(void *)GLUT_BITMAP_HELVETICA_12,CAcceleration);
00090 ExNihilo::RenderBitmapString(500,560,(void *)GLUT_BITMAP_HELVETICA_12,CGravity);
00091 ExNihilo::RenderBitmapString(500,575,(void *)GLUT_BITMAP_HELVETICA_12,CLife);
00092 glEnable(GL_LIGHTING);
00093 ExNihilo::LeaveOrthoMode();*/
00094 std::cout<<CIdName<<std::endl;
00095 std::cout<<CPosition<<std::endl;
00096 std::cout<<CVelocity<<std::endl;
00097 std::cout<<CAcceleration<<std::endl;
00098 std::cout<<CGravity<<std::endl;
00099 std::cout<<CLife<<std::endl;
00100
00101 delete CIdName;
00102 delete CPosition;
00103 delete CVelocity;
00104 delete CAcceleration;
00105 delete CGravity;
00106 delete CLife;
00107 UnGuard
00108 }
|
|
|
Reimplemented in ExCParticule. Definition at line 40 of file ExCObject3D.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject3D(), GetAcceleration(), and ShowInfo(). |
|
|
Definition at line 53 of file ExCObject3D.h. Referenced by ExCSystemeParticule::Draw(), ExCModel::Draw(), ExCComposed::Draw(), ExCCameraChase::Draw(), ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCObject3D(), GetAngleY(), ExManagerModel::InputAction(), ExManagerCamera::InputAction(), ExCCamera::Process(), ExCLight::Reset(), Rotate(), and SetAngleX(). |
|
|
Definition at line 54 of file ExCObject3D.h. Referenced by ExCSystemeParticule::Draw(), ExCModel::Draw(), ExCComposed::Draw(), ExCCameraChase::Draw(), ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCObject3D(), GetAngleZ(), ExManagerModel::InputAction(), ExManagerCamera::InputAction(), ExCModelMD2::Process(), ExCCamera::Process(), ExCLight::Reset(), Rotate(), and SetAngleY(). |
|
|
Definition at line 55 of file ExCObject3D.h. Referenced by ExCSystemeParticule::Draw(), ExCModel::Draw(), ExCComposed::Draw(), ExCCameraChase::Draw(), ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCObject3D(), ExManagerModel::InputAction(), ExManagerCamera::InputAction(), ExCModelMD2::Process(), ExCCamera::Process(), ExCLight::Reset(), Rotate(), and SetAngleZ(). |
|
|
Definition at line 48 of file ExCObject3D.h. Referenced by ExCComposed::Draw(), ExCObject3D(), and SetCurrentState(). |
|
|
Reimplemented in ExCParticule. Definition at line 38 of file ExCObject3D.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject3D(), and ShowInfo(). |
|
|
Definition at line 43 of file ExCObject3D.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject3D(), and ShowInfo(). |
|
|
Reimplemented in ExCParticule. Definition at line 46 of file ExCObject3D.h. Referenced by ExCObject3D(). |
|
|
|
Definition at line 41 of file ExCObject3D.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), and ExCObject3D(). |
|
|
Definition at line 47 of file ExCObject3D.h. Referenced by ExCComposed::Draw(), ExCObject3D(), and GetShowInfoState(). |
|
|
Reimplemented in ExCParticule. Definition at line 45 of file ExCObject3D.h. Referenced by ExCObject3D(). |
|
|
Definition at line 56 of file ExCObject3D.h. Referenced by ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCModelMD2::ExCModelMD2(), ExManagerCamera::InputAction(), and ExCModelMD2::Process(). |
|
|
Definition at line 44 of file ExCObject3D.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), and ExCObject3D(). |
|
|
|
Definition at line 36 of file ExCObject3D.h. Referenced by ExCModel::Draw(), ExCCameraChase::Draw(), and ExCCamera::Draw(). |
|
|
Reimplemented in ExCParticule. Definition at line 37 of file ExCObject3D.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject3D(), and ShowInfo(). |
1.3-rc1