28 #ifndef HU3D_SCENE_HELPER_H
29 #define HU3D_SCENE_HELPER_H
44 #pragma warning( push, 3 )
45 #pragma warning( disable : 4311 ) // IFXVoidStar.h
47 #include "IFXString.h"
49 #include "IFXCoreCIDs.h"
50 #include "IFXAutoRelease.h"
52 #include "IFXSceneGraph.h"
54 #include "IFXMaterialResource.h"
56 #include "IFXModifier.h"
58 #include "IFXShader.h"
59 #include "IFXShaderLitTexture.h"
61 #include "IFXPalette.h"
62 #include "IFXMatrix4x4.h"
64 #include "IFXAnimationModifier.h"
65 #include "IFXBoneWeightsModifier.h"
66 #include "IFXSkeleton.h"
68 #include "IFXMotionResource.h"
69 #include "IFXMixerConstruct.h"
71 #include "IFXImportingCIDs.h"
72 #include "IFXExportingCIDs.h"
74 #include "IFXScheduler.h"
76 #include "IFXAuthorGeomCompiler.h"
77 #include "IFXSubdivModifier.h"
78 #include "IFXCLODModifier.h"
79 #include "IFXShadingModifier.h"
80 #include "IFXGlyph2DModifier.h"
81 #include "IFXGlyphCommandList.h"
83 #include "IFXAuthorMesh.h"
84 #include "IFXAuthorMeshScrub.h"
85 #include "IFXAuthorLineSet.h"
86 #include "IFXAuthorLineSetResource.h"
87 #include "IFXAuthorPointSet.h"
88 #include "IFXAuthorPointSetResource.h"
90 #include "IFXModifierChain.h"
92 #include "IFXSimulationTask.h"
94 #include "IFXCLODManagerInterface.h"
95 #include "IFXNeighborResControllerIntfc.h"
97 #include "IFXImageCodec.h"
98 #include "IFXLoadManager.h"
99 #include "IFXWriteManager.h"
100 #include "IFXBoundSphereDataElement.h"
102 #include "IFXStdio.h"
103 #include "IFXCheckX.h"
105 #pragma warning( pop )
126 IFXRESULT InitializeScene( IFXCoreServices* pCoreServicesMain );
129 IFXRESULT WriteDebugInfo(
const char* pFile );
132 IFXRESULT WriteSceneToFile(
const IFXCHAR* pFileName,
133 IFXExportOptions ExportOptions );
135 IFXRESULT LoadU3DFile(
const IFXCHAR* pFileName );
137 IFXRESULT CreateFileReference(
138 const IFXString& rName,
139 IFXFileReference** ppFileReference );
142 IFXRESULT CreateNodePlaceholder(
143 const IFXString& rNodeName,
144 U32* pNodeId = NULL );
146 IFXRESULT CreateNode(
147 const IFXString& rNodeName,
148 const IFXCID& rComponentId,
150 U32* pNodeId = NULL );
152 IFXRESULT CreateViewNode(
153 const IFXString& rNodeName,
154 const IFXString& rResourceName,
157 IFXRESULT CreateGroupNode(
158 const IFXString& rNodeName,
161 IFXRESULT CreateLightNode(
162 const IFXString& rNodeName,
163 const IFXString& rResourceName,
164 IFXLight** ppLight );
166 IFXRESULT CreateModelNode(
167 const IFXString& rName,
168 const IFXString& rResourceName,
170 U32* pModelNodeId = NULL);
173 const IFXString& rName,
175 U32* pNodeId = NULL );
178 IFXRESULT CreateResourcePlaceholder(
179 const IFXString& rName,
180 IFXSceneGraph::EIFXPalette palette,
183 IFXRESULT CreateViewResource(
184 const IFXString& rName,
185 IFXViewResource** ppViewResource );
187 IFXRESULT CreateLightResource(
188 const IFXString& rName,
189 IFXLightResource** ppLightResource );
191 IFXRESULT CreateMeshResource(
192 const IFXString& rName,
193 IFXAuthorMesh* pMesh,
194 IFXAuthorGeomCompilerParams& rParams,
195 IFXAuthorCLODResource** ppModel,
196 U32* pResourceId = NULL );
198 IFXRESULT CreatePointSetResource(
199 const IFXString& rName,
200 IFXAuthorPointSet* pLineSet,
202 IFXAuthorPointSetResource** ppModel );
204 IFXRESULT CreateLineSetResource(
205 const IFXString& rName,
206 IFXAuthorLineSet* pLineSet,
208 IFXAuthorLineSetResource** ppModel );
210 IFXRESULT CreateModelResource(
211 const IFXString& rName,
212 IFXREFCID ComponentId,
213 U32 uPrimitivePriority,
214 IFXGenerator** ppPrimitive );
216 IFXRESULT CreateMotionResource(
217 const IFXString& rMotionName,
218 const U32 motionQuality,
219 const U32 motionPriority,
221 IFXMotionResource** pMotionResource);
223 IFXRESULT FindPaletteEntry(
224 const IFXString& rName,
225 IFXSceneGraph::EIFXPalette palette,
226 IFXUnknown** ppResource,
229 IFXRESULT FindTexture(
230 const IFXString& rName,
231 IFXTextureObject** ppResource,
234 IFXRESULT FindMaterial(
235 const IFXString& rName,
236 IFXMaterialResource** ppResource,
239 IFXRESULT FindShader(
240 const IFXString& rName,
241 IFXShaderLitTexture** ppResource,
244 IFXRESULT FindMotionResource(
245 const IFXString& rName,
246 IFXMotionResource** ppResource );
248 IFXRESULT FindResourceByModelName(
249 const IFXString& rModelName,
250 IFXAuthorCLODResource** ppAuthorCLODResource);
252 IFXRESULT FindModelResource(
253 const IFXString& rResourceName,
254 IFXGenerator** ppModelResource,
255 U32* pModelResourceId = NULL);
258 const IFXString& rModelName,
262 IFXRESULT CreateShader(
263 const IFXString& rShaderName,
264 const IFXString& rMaterialName,
265 IFXShaderLitTexture** ppShader );
267 IFXRESULT GetMaterialFromShader(
268 IFXShaderLitTexture* pShaderLitTexture,
269 IFXMaterialResource** ppMaterial );
271 IFXRESULT GetTextureFromShader(
272 IFXShaderLitTexture* pShaderLitTexture,
273 IFXTextureObject** ppTexture,
276 IFXRESULT CreateMaterial(
277 const IFXString& rMaterial,
278 IFXMaterialResource** ppMaterial );
280 IFXRESULT AddTexturePaletteEntry(
281 const IFXString& rName,
284 IFXRESULT CreateTexture(
285 const IFXString& rName,
287 IFXTextureObject** ppTextureObject );
289 IFXRESULT SetRenderWire(
const IFXString& rShaderName, BOOL onOff );
293 IFXRESULT AddModifier(
294 const IFXString& rModName,
295 const IFXString& rModChainType,
296 IFXModifier* pModifier );
298 IFXRESULT AddBoneWeightModifier(
299 const IFXString& rModName,
300 const IFXString& rModChainType,
301 IFXBoneWeightsModifier** ppBoneWeightModifier );
303 IFXRESULT AddShadingModifier(
304 const IFXString& rModName,
305 const IFXString& rModChainType,
306 IFXShadingModifier** ppShadingModifier );
308 IFXRESULT AddGlyphModifier(
309 const IFXString& rModName,
310 const IFXString& rModChainType,
314 IFXGlyphCommandList* pCommandList,
315 IFXGlyph2DModifier** ppGlyph2DModifier );
317 IFXRESULT AddCLODModifier(
318 const IFXString& rModName,
319 const IFXString& rModChainType,
320 IFXCLODModifier** ppCLODModifier );
322 IFXRESULT AddSubdivisionModifier(
323 const IFXString& rModName,
324 const IFXString& rModChainType,
325 IFXSubdivModifier** ppSubDiv );
328 IFXRESULT AddAnimationModifier(
329 const IFXString& rModName,
330 const IFXString& rModChainType,
331 BOOL isKeyFrameModifier,
332 IFXAnimationModifier** ppAnimationModifier );
349 IFXAnimationModifier* pAnimationModifer,
350 const IFXString& rMotionName,
351 F32 rTimeOffset = 0.0, F32 rTimeScale = 1.0,
352 BOOL loop = TRUE, BOOL sync = FALSE );
354 IFXRESULT CompressMotionTracks( IFXMotionResource* MotionResource );
357 IFXRESULT TestModifierResourceChain(
358 IFXAuthorCLODResource* pCLODResource,
359 IFXREFIID ModifierID,
362 IFXRESULT TestModifierNodeChain(
364 IFXREFIID ModifierID,
367 IFXRESULT ResetPalettes( BOOL bRebuildDefaultEntries );
369 IFXRESULT ClearPalette(
370 IFXSceneGraph::EIFXPalette paletteType,
371 IFXPalette* pPalette,
372 BOOL bClearDefaultEntryAlso );
374 IFXRESULT GetWorldTransform(
376 IFXMatrix4x4* pWorldTransform );
388 IFXDECLAREMEMBER(IFXCoreServices,m_pCoreServices);
389 IFXDECLAREMEMBER(IFXSceneGraph,m_pSceneGraph);
391 IFXDECLAREMEMBER( IFXPalette, m_pShaderPalette );
392 IFXDECLAREMEMBER(IFXPalette,m_pGeneratorPalette);
393 IFXDECLAREMEMBER(IFXPalette,m_pNodePalette);
402 #define IFXDBGINDENT_AMT 3
403 #define DISCARD (void)
410 #define DBGOUT(x) {IFXTRACE_GENERIC(L"*** MESSAGE -- from: %s at %d\n",__FILE__, __LINE__); IFXTRACE_GENERIC(L"*** %s\n", (x));};
411 #define DBGOUTFMT(x,y) {IFXTRACE_GENERIC(L"*** MESSAGE -- from: %s at %d\n",__FILE__, __LINE__); IFXTRACE_GENERIC(x,y);} // must look like DBGOUTFMT("Format", Args);
412 #define DBGOUTIFERR(x,y) if(IFXFAILURE(x)){ DBGOUT(y); }
415 #define DBGOUTFMT(x,y)
416 #define DBGOUTIFERR(x,y)
439 IFX_EDI_SKELETON_VERTEXWEIGHTS,
444 IFX_EDI_TEXTUREOBJECT,
445 IFX_EDI_MOTIONRESOURCE,
451 IFX_EDI_NODE_PALETTE,
452 IFX_EDI_MODEL_PALETTE,
453 IFX_EDI_LIGHT_PALETTE,
454 IFX_EDI_VIEW_PALETTE,
455 IFX_EDI_MATERIAL_PALETTE,
456 IFX_EDI_SHADER_PALETTE,
457 IFX_EDI_TEXTURE_PALETTE,
458 IFX_EDI_SIMTASK_PALETTE,
459 IFX_EDI_MOTION_PALETTE,
460 IFX_EDI_DUMP_PALETTE_ENTRIES,
467 IFXRESULT SetFlag(U32 in_Id, U32 in_value);
468 IFXRESULT Init(
const char* pFileName);
470 void WriteIf(U32 in_Flag,
const char* in_Format, ...);
472 void Write(
const char*, ...);
473 void Write(IFXShaderLitTexture* pShader);
474 void Write(IFXShaderLitTexture* pShader, U32 channel);
476 void Write(IFXAnimationModifier*);
477 void Write(IFXSubdivModifier*);
478 void Write(IFXCLODModifier*);
480 void Write(IFXAuthorCLODResource*);
481 void Write(IFXAuthorLineSetResource*);
482 void Write(IFXGenerator*);
483 void WriteBoneWeightGenerator(IFXSkeleton *);
485 void Write(IFXMotionResource*);
486 void Write(IFXMixerConstruct*, IFXPalette *pMixerPalette, IFXPalette *pMotionPalette);
487 void Write(IFXMaterialResource*);
489 void Write(IFXBoneInfo * pData);
490 void Write(IFXQuaternion * pData);
491 void Write(IFXKeyFrame*);
493 void Write(IFXTextureObject*);
495 void Write(IFXSimulationTask*);
497 void Write(IFXModifierChain*);
498 void Write(IFXModifierDataPacket*);
499 void Write(IFXRenderable*);
500 void Write(IFXMeshGroup*);
501 void Write(IFXMesh*);
502 void Write(IFXView*);
503 void Write(IFXModel*);
504 void Write(IFXLight*);
505 void Write(IFXNode*);
507 void Write(IFXVector3 * pData);
508 void Write(IFXVector4 * pData);
509 void Write(IFXMatrix4x4 * pData,
const char* pTabchars);
511 void Write(IFXString* pData);
512 void Write(F32 * pData);
513 void WriteColor(IFXVector4 * pData);
514 void WriteColor(IFXVector3 * pData);
516 void Write(IFXPalette * pData);
517 void WriteNodePalette(IFXPalette * pData);
518 void WriteLightPalette(IFXPalette * pData);
519 void WriteViewPalette(IFXPalette * pData);
520 void WriteModelPalette(IFXPalette * pData);
521 void WriteMaterialPalette(IFXPalette * pData);
522 void WriteShaderPalette(IFXPalette * pData);
523 void WriteMotionPalette(IFXPalette * pData);
524 void WriteMixerPalette(IFXPalette * pData, IFXPalette *pMotionPalette);
525 void WriteTexturePalette(IFXPalette * pData);
526 void WriteSimulationTaskPalette(IFXPalette * pData);
528 IFXRESULT DumpChildNodes(IFXPalette *pNodePalette, IFXNode *pNode, U32 indent);
545 U32 m_Flags[IFX_EDI_COUNT];
554 #endif // _HU3DHelper_H
555 #endif // HU3D_SCENE_HELPER_H
IFX_EDI_FLAGS
Debug Flags.
Definition: HU3DHelper.h:433
This is the implementation of a class that is used to create U3D scene objects.
Definition: HU3DHelper.h:117
IFXRESULT AssignAnimationToModifier(IFXAnimationModifier *pAnimationModifer, const IFXString &rMotionName, F32 rTimeOffset=0.0, F32 rTimeScale=1.0, BOOL loop=TRUE, BOOL sync=FALSE)
Queues up a named motion into an animation modifier.
Provides runtime debugging info to a text file.
Definition: HU3DHelper.h:424
Is the DebugInfo Enabled.
Definition: HU3DHelper.h:436
IFXRESULT GetSceneMetaData(IFXMetaDataX **ppMetaData)
Returns file meta data interface.