00001 /*============================================================================== 00002 00003 file: IProjection_WorkingModelInfo.h 00004 00005 author: Daniel Levesque 00006 00007 created: 19 May 2004 00008 00009 description: 00010 00011 Definition of an interface that gives access to basic shade context information 00012 on the working model of a bake projection. 00013 00014 This interface is to be used along with the bake projection feature, which 00015 allows using high-res objects when baking maps for low-res objects. 00016 00017 modified: 00018 00019 00020 (c) 2004 Autodesk 00021 ==============================================================================*/ 00022 00023 #pragma once 00024 00025 #include "BaseInterface.h" 00026 #include "imtl.h" 00027 00028 // forward declarations 00029 class RenderInstance; 00030 class Point3; 00031 00032 00033 //============================================================================== 00034 // class IProjection_WorkingModelInfo 00063 //============================================================================== 00064 class IProjection_WorkingModelInfo : public BaseInterface { 00065 00066 public: 00067 00069 static IProjection_WorkingModelInfo* GetInterface(ShadeContext& shadeContext); 00070 00072 virtual RenderInstance* GetRenderInstance() = 0; 00074 virtual int GetFaceNumber() = 0; 00076 virtual const Point3& GetOrigNormal() = 0; 00078 virtual void GetBarycentricCoords(Point3& bary) = 0; 00079 virtual void GetBarycentricCoords(float& b0, float& b1, float& b2) = 0; 00081 virtual BOOL GetBackFace() = 0; 00083 virtual const Point3& GetPoint() = 0; 00085 virtual const Point3& GetViewDir() = 0; 00087 virtual const Point3& GetOriginalViewDir() = 0; 00089 virtual int GetMaterialNumber() = 0; 00091 virtual void BumpBasisVectors(Point3 dP[2], int axis, int channel) = 0; 00093 virtual void TangentBasisVectors(Point3 dP[2], int mapChannel) = 0; 00094 00095 // -- from BaseInterface 00096 virtual Interface_ID GetID(); 00097 }; 00098 00099 #define IPROJECTION_WORKINGMODELINFO_INTERFACE_ID Interface_ID(0x79907259, 0xbf05948) 00100 00101 inline IProjection_WorkingModelInfo* IProjection_WorkingModelInfo::GetInterface(ShadeContext& shadeContext) { 00102 00103 return static_cast<IProjection_WorkingModelInfo*>(shadeContext.GetInterface(IPROJECTION_WORKINGMODELINFO_INTERFACE_ID)); 00104 } 00105 00106 inline Interface_ID IProjection_WorkingModelInfo::GetID() { 00107 00108 return IPROJECTION_WORKINGMODELINFO_INTERFACE_ID; 00109 } 00110