IGameObject.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: IGameObject.h
00004 
00005     DESCRIPTION: Object interfaces for IGame
00006 
00007     CREATED BY: Neil Hazzard, Discreet
00008 
00009     HISTORY: created 02/02/02
00010 
00011     IGame Version: 1.122
00012 
00013  *> Copyright (c) 2002, All Rights Reserved.
00014  **********************************************************************/
00018 #pragma once
00019 
00020 #include "..\maxheap.h"
00021 #include "IGameProperty.h"
00022 #include "IGameStd.h"
00023 #include "..\point2.h"
00024 
00025 // forward declarations
00026 class IGameNode;
00027 class IGameModifier;
00028 class IGameSkin;
00029 class IGameMaterial;
00030 class Object;
00031 class Box3;
00032 class Mesh;
00033 class Color;
00034 class ShapeObject;
00035 
00037 
00049 class IGameObject : public IExportEntity
00050 {
00051     Tab <IGameModifier *> gameModTab;
00052 
00053 protected:
00054     INode * gameNode;
00055     Object * gameObject;
00056     void SetNode (INode * n);
00057 public:
00059     IGameObject();
00060     
00062 
00064     enum ObjectTypes{
00065         IGAME_UNKNOWN,  
00066         IGAME_LIGHT,    
00067         IGAME_MESH,     
00068         IGAME_SPLINE,   
00069         IGAME_CAMERA,   
00070         IGAME_HELPER,   
00071         IGAME_BONE,     
00072         IGAME_IKCHAIN,  
00073         IGAME_XREF      
00074     };
00075 
00077 
00079     enum MaxType{
00080         IGAME_MAX_UNKNOWN,  
00081         IGAME_MAX_GEOM,     
00082         IGAME_MAX_SHAPE,    
00083         IGAME_MAX_LIGHT,    
00084         IGAME_MAX_CAMERA,   
00085         IGAME_MAX_BONE,     
00086         IGAME_MAX_HELPER,   
00087     };
00088 
00090 
00093     IGAMEEXPORT void GetBoundingBox(Box3 & bb);
00094 
00096 
00099     IGAMEEXPORT bool IsRenderable();
00100 
00102 
00105     virtual ObjectTypes GetIGameType() =0;
00106     
00108 
00111     IGAMEEXPORT Object * GetMaxObject();
00112 
00114 
00119     IGAMEEXPORT MaxType GetMaxType() ;
00120     
00122 
00125     IGAMEEXPORT int GetNumModifiers();
00126 
00128 
00132     IGAMEEXPORT IGameModifier * GetIGameModifier(int index);
00133 
00135 
00138     IGAMEEXPORT IGameObject(INode  * node);
00139 
00141 
00144     IGAMEEXPORT bool CastShadows();
00145     
00147 
00150     IGAMEEXPORT bool IsObjectSkinned();
00151 
00153 
00156     IGAMEEXPORT IGameSkin * GetIGameSkin();
00157 
00159 
00162     IGAMEEXPORT bool IsObjectXRef();
00163 
00165 
00168     IGAMEEXPORT GMatrix GetIGameObjectTM();
00169 
00171 
00178     virtual bool InitializeData(){return false;}
00179 
00180     virtual ~IGameObject() = 0;
00181 };
00182 
00184 
00186 class IGameLight : public IGameObject  {
00187 public:
00189     enum LightType{
00190         IGAME_OMNI,     
00191         IGAME_TSPOT,    
00192         IGAME_DIR,      
00193         IGAME_FSPOT,    
00194         IGAME_TDIR,     
00195         IGAME_UNKNOWN,  
00196     };
00197 
00199 
00202     virtual IGameProperty * GetLightColor()=0;
00203 
00205 
00208     virtual IGameProperty * GetLightMultiplier()=0;
00209 
00211 
00214     virtual IGameProperty * GetLightAttenEnd()=0;
00215 
00217 
00220     virtual IGameProperty * GetLightAttenStart()=0;
00221 
00223 
00226     virtual IGameProperty * GetLightFallOff()=0;
00227 
00229 
00232     virtual IGameProperty * GetLightHotSpot()=0;
00233 
00235 
00238     virtual IGameProperty * GetLightAspectRatio()=0;
00239     
00241 
00244     virtual IGameProperty * GetLightDecayStart()=0;
00245     
00247 
00250     virtual LightType GetLightType()=0;
00251 
00252 
00254 
00257     virtual int GetLightOvershoot()=0;
00258 
00260 
00267     virtual int GetLightDecayType()=0;
00268 
00270 
00276     virtual int GetSpotLightShape()=0;
00277 
00279 
00282     virtual IGameNode * GetLightTarget()=0;
00283 
00285 
00288     virtual bool IsLightOn() = 0;
00289 
00291 
00294     virtual bool IsExcludeListReversed()=0;
00295 
00297 
00302     virtual int GetExcludedNodesCount() = 0;
00303 
00305 
00309     virtual IGameNode * GetExcludedNode(int index) = 0;
00310 
00311 
00312 
00313 };
00314 
00316 
00318 class IGameCamera : public IGameObject {
00319 
00320 public:
00321 
00323 
00326     virtual IGameProperty * GetCameraFOV()=0;
00327 
00329 
00332     virtual IGameProperty * GetCameraFarClip()=0;
00333 
00335 
00338     virtual IGameProperty * GetCameraNearClip()=0;
00339 
00341 
00344     virtual IGameProperty * GetCameraTargetDist()=0;
00345 
00347 
00350     virtual IGameNode *  GetCameraTarget()=0;
00351 
00352 
00353 };
00354 
00355 
00356 
00358 
00362 class FaceEx: public MaxHeapOperators
00363 {
00364 public:
00365 
00367     DWORD vert[3];
00369     DWORD texCoord[3];
00371     DWORD norm[3];
00373     DWORD color[3];
00375     DWORD illum[3];
00377     DWORD alpha[3];
00379     DWORD smGrp;
00381     int matID;
00383     DWORD flags;
00385     int meshFaceIndex;
00387 
00388     DWORD edgeVis[3];  
00389 
00390 
00391 };
00392 
00394 
00400 class IGameMesh: public IGameObject {
00401 public:
00402     
00404 
00409     virtual bool InitializeBinormalData()=0;
00410     
00412 
00415     virtual int GetNumberOfVerts()=0;
00416 
00418 
00421     virtual int GetNumberOfTexVerts()=0;
00422 
00424 
00430     virtual Point3 GetVertex(int index, bool ObjectSpace = false)=0;
00431 
00433 
00440     virtual bool GetVertex(int index, Point3 & vert, bool ObjectSpace = false) = 0;
00441 
00443 
00447     virtual Point2 GetTexVertex(int index)=0;
00448 
00450 
00455     virtual bool GetTexVertex(int index, Point2 & tex) = 0;
00456 
00458 
00462     virtual void SetUseWeightedNormals() = 0;
00463     
00465 
00468     virtual int GetNumberOfNormals()=0;
00469 
00471 
00475     virtual int GetNormalVertexIndex (int index)=0;
00476     
00478 
00484     virtual Point3 GetNormal(int index, bool ObjectSpace = false)=0;
00485 
00487 
00494     virtual bool GetNormal(int index, Point3 & norm, bool ObjectSpace = false) = 0;
00495 
00497 
00505     virtual bool GetNormal(int faceIndex, int corner, Point3 & norm, bool ObjectSpace = false) = 0;
00506 
00508 
00515     virtual Point3 GetNormal ( FaceEx * face, int corner, bool ObjectSpace = false) = 0;
00516 
00518 
00526     virtual bool GetNormal(FaceEx * face, int corner, Point3 &norm, bool ObjectSpace = false) =0;
00527     
00529 
00536     virtual Point3 GetNormal(int faceIndex, int corner, bool ObjectSpace = false) = 0;
00537     
00539 
00542     virtual int GetNumberOfIllumVerts()=0;
00543 
00545 
00548     virtual int GetNumberOfAlphaVerts()=0;
00549 
00551 
00554     virtual int GetNumberOfColorVerts()=0;
00555 
00557 
00561     virtual Point3 GetColorVertex(int index)=0;
00562 
00564 
00569     virtual bool GetColorVertex(int index, Point3 & col) = 0;
00570 
00572 
00576     virtual float  GetAlphaVertex(int index)=0;
00577 
00578 
00580 
00585     virtual bool GetAlphaVertex(int index, float & alpha) = 0;
00586 
00588 
00592     virtual float  GetIllumVertex(int index)=0;
00593     
00595 
00600     virtual bool GetIllumVertex(int index, float &illum) = 0;
00601 
00603 
00606     virtual int GetNumberOfFaces()=0;
00607     
00609 
00613     virtual FaceEx * GetFace(int index)=0;
00614     
00616 
00620     virtual int GetNumberOfMapVerts(int ch) = 0;
00621 
00623 
00628     virtual Point3 GetMapVertex(int ch, int index) = 0;
00629 
00631 
00637     virtual bool GetMapVertex(int ch, int index, Point3 & mVert) = 0;
00638 
00640 
00644     virtual int GetNumberOfBinormals(int mapChannel = 1) = 0;
00645 
00647 
00652     virtual Point3 GetBinormal(int index, int mapChannel = 1)=0;
00653 
00655 
00661     virtual bool GetBinormal(int index, Point3 & biNormal, int mapChannel = 1) = 0;
00662 
00664 
00668     virtual int GetNumberOfTangents(int mapChannel = 1) = 0;
00669 
00671 
00676     virtual Point3 GetTangent(int index, int mapChannel = 1) = 0;
00677 
00679 
00685     virtual bool GetTangent(int index, Point3 & Tangent, int mapChannel = 1) = 0;
00686 
00688 
00692     virtual Tab<int> GetActiveMapChannelNum() = 0;
00693     
00695 
00701     virtual bool GetMapFaceIndex(int ch, int faceNum, DWORD *index) = 0;
00702     
00704 
00707     virtual Tab<DWORD> GetActiveSmgrps() = 0;
00708 
00710 
00713     virtual Tab<int> GetActiveMatIDs() = 0;
00714 
00716 
00720     virtual Tab<FaceEx *> GetFacesFromSmgrp(DWORD smgrp) = 0;
00721 
00723 
00727     virtual Tab<int> GetFaceIndexFromSmgrp(DWORD smgrp)=0;
00728 
00730 
00734     virtual Tab<FaceEx *> GetFacesFromMatID(int matID) = 0;
00735 
00737 
00744     virtual IGameMaterial * GetMaterialFromFace(int FaceNum) = 0;
00745 
00747 
00754     virtual IGameMaterial * GetMaterialFromFace(FaceEx * face) = 0;
00755 
00756 
00758 
00761     virtual Mesh * GetMaxMesh()=0;
00762 
00763 
00765 
00766 
00767 
00772     virtual int GetFaceVertex (int faceIndex, int corner)=0;
00773     
00775 
00782     virtual int GetFaceTextureVertex (int faceIndex, int corner, int mapChannel = 1)=0;
00783 
00785 
00790     virtual int GetFaceVertexNormal (int faceIndex, int corner)=0;
00791     
00793 
00799     virtual int GetFaceVertexTangentBinormal (int faceIndex, int corner, int mapChannel = 1)=0;
00800     
00802 
00806     virtual DWORD GetFaceSmoothingGroup (int faceIndex)=0;
00807     
00809 
00813     virtual int GetFaceMaterialID (int faceIndex)=0;
00814     
00816 
00821     virtual int GetFaceEdgeVisibility (int faceIndex, int edge)=0;
00823 
00825 
00832     virtual bool EvaluateSurface(int FaceIndex, Color * result) = 0;
00833 
00834 
00836 
00842     virtual void SetCreateOptimizedNormalList() = 0;
00843 
00845 
00846 
00847 
00850     virtual int GetNumberOfPolygons()=0;
00851 
00853 
00856     virtual int GetNumberOfPolygonNormals()=0;
00857 
00859 
00863     virtual int GetNumberOfPolygonCorners(int PolyIndex)=0;
00864 
00866 
00870     virtual Tab<INT> GetPolygonVertices(int PolyIndex)=0;
00871 
00872 
00874 
00878     virtual Tab<INT> GetPolygonNormals(int PolyIndex)=0;
00879 
00881 
00886     virtual Tab<Point3> GetPolygonNormalsArray(int PolyIndex = -1)=0;
00887 
00889 
00894     virtual Tab<INT> GetPolygonMapVertices(int PolyIndex, int MapChannel)=0;
00895 
00897 
00901     virtual Tab<INT> GetPolygonEgdesVisibility(int PolyIndex)=0;
00902 
00904 
00908     virtual DWORD GetPolygonSmoothingGroup (int PolyIndex)=0;
00909 
00911 
00915     virtual int GetPolygonMaterialID (int PolyIndex)=0;
00916     
00918 
00922     virtual Tab<INT> GetPolygonIndexFromMatID(int MatID)=0;
00923 
00925 
00929     virtual IGameMaterial* GetMaterialFromPolygon(int PolyIndex)= 0;
00931 
00932 };
00933 
00935 
00937 class IGameKnot: public MaxHeapOperators
00938 {
00939 public:
00941     enum KnotType{
00942         KNOT_AUTO,              
00943         KNOT_CORNER,            
00944         KNOT_BEZIER,            
00945         KNOT_BEZIER_CORNER,     
00946     };
00947 
00949     enum KnotData{
00950         KNOT_INVEC,             
00951         KNOT_OUTVEC,            
00952         KNOT_POINT,             
00953     };
00955     virtual ~IGameKnot() {;}
00956 
00958 
00961     virtual Point3 GetInVec()=0;
00962     
00964 
00967     virtual Point3 GetOutVec()=0;
00968 
00970 
00973     virtual Point3 GetKnotPoint()=0;
00974 
00976 
00979     virtual KnotType GetKnotType()=0;
00980     
00982 
00986     virtual IGameControl * GetKnotControl(KnotData kd)=0;
00987 };
00988 
00990 
00993 class IGameSpline3D: public MaxHeapOperators
00994 {
00995 public:
00997     virtual ~IGameSpline3D() {;}
00998 
01000 
01003     virtual IGameKnot * GetIGameKnot(int index) = 0;
01004     
01006 
01009     virtual int GetIGameKnotCount()=0;
01010 
01011 };
01012 
01014 
01017 class IGameSpline : public IGameObject
01018 {
01019 public:
01021 
01024     virtual int GetNumberOfSplines()=0;
01025 
01027 
01031     virtual IGameSpline3D * GetIGameSpline3D(int index) =0;
01032 
01034 
01037     virtual ShapeObject * GetMaxShape()=0;
01038 
01039 };
01040 
01041 
01043 
01051 class IGameIKChain : public IGameObject
01052 {
01053 public:
01054 
01056 
01059     virtual int GetNumberofBonesinChain() =0;
01060 
01062 
01066     virtual IGameNode * GetIGameNodeInChain(int index) =0;
01067 
01069 
01072     virtual IGameProperty * GetSwivelData() = 0;
01073 
01075 
01080     virtual IGameControl * GetIKEnabledController() = 0;
01081 
01082 
01083 };
01084 
01085 
01087 
01091 class IGameSupportObject : public IGameObject
01092 {
01093 public:
01095 
01098     virtual IGameMesh * GetMeshObject() = 0;
01099 
01101 
01104     virtual bool PreR4Bone() = 0;
01105 
01106     
01107 };
01108 
01110 class IGameXRefObject : public IGameObject
01111 {
01112 public:
01114 
01117     virtual const MCHAR * GetOriginalFileName() = 0;
01118 
01119     
01120 };
01121 
01123 
01126 class IGameGenObject : public IGameObject
01127 {
01128 public:
01129     
01131 
01134     virtual IPropertyContainer * GetIPropertyContainer()=0;
01135 };
01136 
01137