#include <ExCObject.h>
Inheritance diagram for ExCObject:
Public Methods | |
ExCObject () | |
virtual | ~ExCObject () |
virtual void | Draw (void) |
virtual void | SetManagerTexture (ExManagerTexture *Texture) |
void | SetCurrentState (bool state) |
void | ShowInfo (void) |
void | SetShowInfoState (bool state) |
bool | GetShowInfoState (void) |
void | SetIdName (IdName idname) |
void | SetId (ExId Id) |
ExId | GetId (void) |
char * | GetName (void) |
void | SetName (const char *Name) |
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) |
void | SetGravity (ExCVec3D Gravity) |
void | SetGravity (float x, float y, float z) |
void | SetPosition (ExCVec3D Position) |
void | SetPosition (float x, float y, float z) |
void | SetTarget (ExCVec3D Target) |
void | SetTarget (float x, float y, float z) |
void | Rotate (float angleX, float angleY, float angleZ) |
void | Rotate (void) |
Data Fields | |
float | m_AngleX |
float | m_AngleY |
float | m_AngleZ |
ExCVec3D | GetVelocity (void) |
ExCVec3D | GetGravity (void) |
ExCVec3D | GetPosition (void) |
ExCVec3D | GetTarget (void) |
Protected Attributes | |
ExManagerTexture * | ManagerTexture |
ExId | m_ObjectId |
char * | m_ObjectName |
ExCVec3D | m_Position |
ExCVec3D | m_Target |
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 ExCObject.cpp. References 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, SetId(), SetName(), and ExCVec3D::SetValue(). Referenced by ExCEntite::ExCEntite().
00029 { 00030 SetName("NoName"); 00031 SetId(-1); 00032 m_Size=1.0; 00033 m_RefreshTime=0.01f; 00034 m_Life=0; 00035 m_StartingLife=glutGet(GLUT_ELAPSED_TIME)/1000; 00036 m_Mass=100; 00037 m_ShowInfo=false; 00038 m_CurrentObject=false; 00039 m_Velocity.SetValue(0.01f,0.0f,0.0f); 00040 m_Position.SetValue(0.0f,0.0f,0.0f); 00041 m_Gravity.SetValue(0.0f,0.0f,0.0f); 00042 m_Acceleration=0.0f; 00043 m_AngleX=0.0f; 00044 m_AngleY=0.0f; 00045 m_AngleZ=0.0f; 00046 } |
|
Definition at line 48 of file ExCObject.cpp.
00049 { 00050 00051 } |
|
Reimplemented in ExCCamera, ExCCameraTarget, ExCComposed, ExCEntite, ExCGizmo, ExCGizmoRectangle, and ExCSystemeParticule. Definition at line 61 of file ExCObject.cpp. References Draw(), Guard, and UnGuard. Referenced by Draw().
00062 { 00063 Guard(void ExCObject::Draw(void)) 00064 UnGuard 00065 } |
|
Definition at line 98 of file ExCObject.h. References m_Acceleration.
00098 {return m_Acceleration;} |
|
Definition at line 93 of file ExCObject.h. References m_AngleX.
00093 {return m_AngleX;} |
|
Definition at line 94 of file ExCObject.h. References m_AngleY.
00094 {return m_AngleY;} |
|
Definition at line 95 of file ExCObject.h. References m_AngleZ.
00095 {return m_AngleZ;} |
|
Definition at line 86 of file ExCObject.h. References ExId, and m_ObjectId. Referenced by ExManagerLight::Add(), ExManagerGizmo::Add(), ExManagerEntite::Add(), ExManagerLight::NewObject(), ExManagerGizmo::NewObject(), ExManagerEntite::NewObject(), ExManagerCam::NewObject(), ExManagerEntite::SetCurrentEntiteName(), and ShowInfo().
00086 {return m_ObjectId;} |
|
Definition at line 87 of file ExCObject.h. References m_ObjectName. Referenced by ExManagerEntite::Add(), ExCComposed::LoadAsc(), ExManagerEntite::SetCurrentEntiteName(), and ShowInfo().
00087 {return m_ObjectName;} |
|
Definition at line 82 of file ExCObject.h. References m_ShowInfo.
00082 {return m_ShowInfo;} |
|
Definition at line 146 of file ExCObject.cpp. References GetQuaternionFromEuler(), m_AngleX, m_AngleY, and m_AngleZ. Referenced by Rotate().
00147 { 00148 if(m_AngleX<0)m_AngleX=359; 00149 if(m_AngleX>359)m_AngleX=0; 00150 if(m_AngleY<0)m_AngleY=359; 00151 if(m_AngleY>359)m_AngleY=0; 00152 if(m_AngleZ<0)m_AngleZ=359; 00153 if(m_AngleZ>359)m_AngleZ=0; 00154 00155 ExQuaternion quat; 00156 ExCMatrix4x4 Matr; 00157 ExCVec3D VecX,VecY,VecZ,VecDir; 00158 00159 quat=GetQuaternionFromEuler(m_AngleX,m_AngleY,m_AngleZ); 00160 //Matr=GetMatrixFromQuaternion(quat); 00161 //Matr=GetMatrixFromEuler(m_AngleX,m_AngleY,m_AngleZ); 00162 00163 /*VecX.m_Vector[0]=(float)Matr.m_Matrix[0]; 00164 VecX.m_Vector[1]=(float)Matr.m_Matrix[1]; 00165 VecX.m_Vector[2]=(float)Matr.m_Matrix[2]; 00166 VecY.m_Vector[0]=(float)Matr.m_Matrix[4]; 00167 VecY.m_Vector[1]=(float)Matr.m_Matrix[5]; 00168 VecY.m_Vector[2]=(float)Matr.m_Matrix[6]; 00169 VecZ.m_Vector[0]=(float)Matr.m_Matrix[8]; 00170 VecZ.m_Vector[1]=(float)Matr.m_Matrix[9]; 00171 VecZ.m_Vector[2]=(float)Matr.m_Matrix[10]; 00172 00173 VecDir.m_Vector[0]=VecX.GetVectorLenght(); 00174 VecDir.m_Vector[1]=VecY.GetVectorLenght(); 00175 VecDir.m_Vector[2]=VecZ.GetVectorLenght(); 00176 VecDir=VecX+VecY+VecZ; 00177 std::cout<<"Angle X:"<<m_AngleX<<" Y:"<<m_AngleY<<" Z:"<<m_AngleZ<<std::endl; 00178 std::cout<<"Quater :"<<quat<<std::endl; 00179 std::cout<<"Matrice:"<<Matr<<std::endl; 00180 std::cout<<"vec X:"<<VecX<<std::endl; 00181 std::cout<<"vec Y:"<<VecY<<std::endl; 00182 std::cout<<"vec Z:"<<VecZ<<std::endl; 00183 std::cout<<"vec dir:"<<VecDir<<std::endl; 00184 std::cout<<"vel bef:"<<m_Velocity<<std::endl; 00185 //std::cout<<"vec aft:"<<m_Velocity<<std::endl; 00186 00187 00188 m_Target.SetX((Cos[(int)m_AngleY])); 00189 m_Target.SetZ((Sin[(int)m_AngleY])); 00190 m_Target.SetY((Sin[(int)m_AngleX])); 00191 std::cout<<"vec target:"<<m_Target<<std::endl;*/ 00192 //VecDir=GetAxisFromQuaternion(quat); 00193 //m_Velocity=m_Velocity*VecDir; 00194 //std::cout<<"vec dir:"<<VecDir<<std::endl; 00195 //std::cout<<"vec vel:"<<m_Velocity<<std::endl; 00196 00197 } |
|
Definition at line 138 of file ExCObject.cpp. References Rotate(), SetAngleX(), SetAngleY(), and SetAngleZ(). Referenced by ExManagerCommand::ProcessAction().
|
|
Definition at line 97 of file ExCObject.h. References m_Acceleration.
00097 {m_Acceleration=Acceleration;} |
|
Definition at line 115 of file ExCObject.cpp. References m_AngleX. Referenced by Rotate().
|
|
Definition at line 121 of file ExCObject.cpp. References m_AngleY. Referenced by Rotate().
|
|
Definition at line 127 of file ExCObject.cpp. References m_AngleZ. Referenced by Rotate().
|
|
Definition at line 77 of file ExCObject.h. References m_CurrentObject. Referenced by ExManagerEntite::Add(), and ExManagerEntite::NewObject().
00077 {m_CurrentObject=state;} |
|
Definition at line 105 of file ExCObject.h.
|
|
Definition at line 104 of file ExCObject.h.
00104 {m_Gravity=Gravity;} |
|
Definition at line 85 of file ExCObject.h. References ExId, and m_ObjectId. Referenced by ExCObject(), and SetIdName().
00085 {m_ObjectId=Id;} |
|
Definition at line 109 of file ExCObject.cpp. References IdName, SetId(), and SetName(). Referenced by ExManagerEntite::Add(), ExManagerEntite::NewObject(), and ExManagerCam::NewObject().
|
|
Reimplemented in ExCComposed, and ExCSystemeParticule. Definition at line 133 of file ExCObject.cpp. References ManagerTexture. Referenced by ExManagerEntite::Add(), and ExManagerEntite::NewObject().
00134 { 00135 ManagerTexture = Texture; 00136 } |
|
Definition at line 53 of file ExCObject.cpp. References Guard, m_ObjectName, SetName(), and UnGuard. Referenced by ExCObject(), ExCEntite::LoadAsc(), ExCComposed::LoadAsc(), ExManagerEntite::SetCurrentEntiteName(), SetIdName(), and SetName().
00054 { 00055 Guard(void ExCObject::SetName(char * Name)) 00056 m_ObjectName = new char[strlen(Name)]; 00057 sprintf(m_ObjectName,Name); 00058 UnGuard 00059 } |
|
Definition at line 109 of file ExCObject.h.
00109 {m_Position=ExCVec3D(x,y,z);} |
|
Definition at line 108 of file ExCObject.h. Referenced by ExManagerCam::NewObject().
00108 {m_Position=Position;} |
|
Definition at line 81 of file ExCObject.h. References m_ShowInfo.
00081 {m_ShowInfo=state;} |
|
Definition at line 113 of file ExCObject.h.
|
|
Definition at line 112 of file ExCObject.h.
00112 {m_Target=Target;} |
|
Definition at line 101 of file ExCObject.h.
00101 {m_Velocity=ExCVec3D(x,y,z);} |
|
Definition at line 100 of file ExCObject.h.
00100 {m_Velocity=Velocity;} |
|
Definition at line 67 of file ExCObject.cpp. References EnterOrthoMode(), GetId(), GetName(), ExCVec3D::GetX(), ExCVec3D::GetY(), ExCVec3D::GetZ(), Guard, LeaveOrthoMode(), m_Acceleration, m_Gravity, m_Life, m_Position, m_Velocity, RenderBitmapString(), ShowInfo(), and UnGuard. Referenced by ExCComposed::Draw(), and ShowInfo().
00068 { 00069 Guard(void ExCObject::ShowInfo(void)) 00070 00071 char *CIdName; 00072 char *CPosition; 00073 char *CVelocity; 00074 char *CAcceleration; 00075 char *CGravity; 00076 char *CLife; 00077 00078 CIdName= new char[strlen("Name : Id:")+strlen(GetName())+7]; 00079 sprintf(CIdName,"Name :%s Id:%ld",GetName(),GetId()); 00080 00081 CPosition= new char[strlen("Position X: Y: Z:")+30]; 00082 sprintf(CPosition,"Position X:%f Y:%f Z:%f",m_Position.GetX(),m_Position.GetY(),m_Position.GetZ()); 00083 00084 CVelocity= new char[strlen("Velocity X: Y: Z:")+30]; 00085 sprintf(CVelocity,"Velocity X:%f Y:%f Z:%f",m_Velocity.GetX(),m_Velocity.GetY(),m_Velocity.GetZ()); 00086 00087 CGravity= new char[strlen("Gravity X: Y: Z:")+30]; 00088 sprintf(CGravity,"Gravity X:%f Y:%f Z:%f",m_Gravity.GetX(),m_Gravity.GetY(),m_Gravity.GetZ()); 00089 00090 CAcceleration= new char[strlen("Acceleration :")+30]; 00091 sprintf(CAcceleration,"Acceleration :%f",m_Acceleration); 00092 00093 CLife= new char[strlen("Life :")+10]; 00094 sprintf(CLife,"Life :%f",m_Life); 00095 00096 EnterOrthoMode(); 00097 glDisable(GL_LIGHTING); 00098 RenderBitmapString(500,500,(void *)GLUT_BITMAP_HELVETICA_12,CIdName); 00099 RenderBitmapString(500,515,(void *)GLUT_BITMAP_HELVETICA_12,CPosition); 00100 RenderBitmapString(500,530,(void *)GLUT_BITMAP_HELVETICA_12,CVelocity); 00101 RenderBitmapString(500,545,(void *)GLUT_BITMAP_HELVETICA_12,CAcceleration); 00102 RenderBitmapString(500,560,(void *)GLUT_BITMAP_HELVETICA_12,CGravity); 00103 RenderBitmapString(500,575,(void *)GLUT_BITMAP_HELVETICA_12,CLife); 00104 glEnable(GL_LIGHTING); 00105 LeaveOrthoMode(); 00106 UnGuard 00107 } |
|
Definition at line 106 of file ExCObject.h.
00106 {return m_Gravity;} |
|
Definition at line 110 of file ExCObject.h. Referenced by ExCCameraTarget::Draw().
00110 {return m_Position;} |
|
Definition at line 114 of file ExCObject.h.
00114 {return m_Target;} |
|
Definition at line 102 of file ExCObject.h.
00102 {return m_Velocity;} |
|
Definition at line 50 of file ExCObject.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject(), GetAcceleration(), SetAcceleration(), and ShowInfo(). |
|
Definition at line 62 of file ExCObject.h. Referenced by ExCComposed::Draw(), ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCObject(), GetAngleX(), ExCCamera::GoToView(), ExManagerCommand::ProcessAction(), ExCLight::Reset(), Rotate(), and SetAngleX(). |
|
Definition at line 63 of file ExCObject.h. Referenced by ExCComposed::Draw(), ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCObject(), GetAngleY(), ExCCamera::GoToView(), ExManagerCommand::ProcessAction(), ExCLight::Reset(), Rotate(), and SetAngleY(). |
|
Definition at line 64 of file ExCObject.h. Referenced by ExCComposed::Draw(), ExCCamera::Draw(), ExCCamera::ExCCamera(), ExCObject(), GetAngleZ(), ExManagerCommand::ProcessAction(), ExCLight::Reset(), Rotate(), and SetAngleZ(). |
|
Definition at line 59 of file ExCObject.h. Referenced by ExCComposed::Draw(), ExCObject(), and SetCurrentState(). |
|
Definition at line 48 of file ExCObject.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject(), and ShowInfo(). |
|
Definition at line 54 of file ExCObject.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject(), and ShowInfo(). |
|
Definition at line 57 of file ExCObject.h. Referenced by ExCObject(). |
|
Definition at line 42 of file ExCObject.h. |
|
Definition at line 43 of file ExCObject.h. |
|
Definition at line 45 of file ExCObject.h. Referenced by ExCSystemeParticule::Draw(), ExCEntite::Draw(), ExCComposed::Draw(), ExCCameraTarget::Draw(), ExCCamera::Draw(), ExCObject(), ExCLight::GetPositionX(), ExCLight::GetPositionY(), ExCLight::GetPositionZ(), ExCCamera::GoToView(), ExCLight::Reset(), ExCLight::SetPosition(), ExCLight::SetPositionX(), ExCLight::SetPositionY(), ExCLight::SetPositionZ(), and ShowInfo(). |
|
Definition at line 52 of file ExCObject.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), and ExCObject(). |
|
Definition at line 58 of file ExCObject.h. Referenced by ExCComposed::Draw(), ExCObject(), GetShowInfoState(), and SetShowInfoState(). |
|
Definition at line 56 of file ExCObject.h. Referenced by ExCObject(). |
|
Definition at line 55 of file ExCObject.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), and ExCObject(). |
|
Definition at line 46 of file ExCObject.h. Referenced by ExCCamera::Draw(), ExCLight::GetTargetX(), ExCLight::GetTargetY(), ExCLight::GetTargetZ(), ExCCamera::GoToView(), ExCLight::Reset(), ExCLight::SetTarget(), ExCLight::SetTargetX(), ExCLight::SetTargetY(), and ExCLight::SetTargetZ(). |
|
Definition at line 47 of file ExCObject.h. Referenced by ExCEntite::Draw(), ExCComposed::Draw(), ExCObject(), and ShowInfo(). |
|
Reimplemented in ExCSystemeParticule. Definition at line 41 of file ExCObject.h. Referenced by ExCEntite::DrawWithoutList(), ExCComposed::LoadAsc(), SetManagerTexture(), and ExCComposed::SetManagerTexture(). |