BIPEXP.H

Go to the documentation of this file.
00001 /******************************************************************************
00002  *<
00003     FILE: bipexp.h
00004                   
00005     DESCRIPTION:  Export Interface Functionality for BIped
00006 
00007     CREATED BY: Susan Amkraut with a lot of help from John Chadwick
00008 
00009     HISTORY: created June 2, 1998
00010 
00011  *>     Copyright (c) Unreal Pictures, Inc. 1997, 1998 All Rights Reserved.
00012  *******************************************************************************/
00013 #pragma once
00014 
00015 #include <WTypes.h>
00016 #include "..\maxheap.h"
00017 
00018 #ifdef BLD_BIPED
00019 #define BIPExport __declspec( dllexport )
00020 #else
00021 #define BIPExport __declspec( dllimport )
00022 #endif
00023 
00024 
00025 
00026 // This is the interface ID for a Biped Controller Interface
00027 #define I_BIPINTERFACE  0x00100101
00028 
00029 // These are subanim numbers for the center of mass (root) controller
00030 #define VERTICAL_SUBANIM    0
00031 #define HORIZONTAL_SUBANIM  1
00032 #define ROTATION_SUBANIM    2
00033 
00034 
00035 // These are the Class ID defines for Biped Controllers.
00036 
00037 // this is the class for all biped controllers except the root and the footsteps
00038 #define BIPSLAVE_CONTROL_CLASS_ID Class_ID(0x9154,0)
00039 
00040 // this is the class for the center of mass, biped root controller ("Bip01")
00041 #define BIPBODY_CONTROL_CLASS_ID  Class_ID(0x9156,0) 
00042 
00043 // this is the class for the biped footstep controller ("Bip01 Footsteps")
00044 #define FOOTPRINT_CLASS_ID Class_ID(0x3011,0)        
00045 
00046 // this is the class for biped geometric objects
00047 #define SKELOBJ_CLASS_ID Class_ID(0x9125, 0)
00048 
00049 // this is the class for the biped master controller
00050 #define BIPED_CLASS_ID Class_ID(0x9155, 0)
00051 
00052 
00053 // Using the Biped Export Interface
00054 // 
00055 //  1.  Find the Biped Controller you wish to export from (see the sample code).
00056 //
00057 //  2.  Given  a Biped controller c, get the Biped Export Interface:
00058 //      IBipedExport *BipIface = (BipedExport *)c->GetInterface(I_BIPINTERFACE);        
00059 //
00060 // At the moment this interface only allows you to remove the non uniform scale.
00061 // This allows you to export cleaner transform information from a biped.
00062 // In the future, more virtual functions will be added, and you'll be able
00063 // to get more information about the biped via this interface.
00064 
00065 // Sample Code
00066 //
00067 // // Get a biped node - in this case the root
00068 // INode *node = ip->GetINodeByName("Bip01");
00069 //
00070 // if (node)
00071 // {
00072 //     // Get the node's transform control
00073 //     Control *c = node->GetTMController();
00074 //
00075 //     // You can test whether or not this is a biped controller with the following pseudo code:
00076 //     if ((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
00077 //         (c->ClassID() == BIPBODY_CONTROL_CLASS_ID) 
00078 //         (c->ClassID() == FOOTPRINT_CLASS_ID))
00079 //     {
00080 //
00081 //         // Get the Biped Export Interface from the controller 
00082 //         IBipedExport *BipIface = (IBipedExport *) c->GetInterface(I_BIPINTERFACE);
00083 //
00084 //         // Remove the non uniform scale
00085 //         BipIface->RemoveNonUniformScale(1);
00086 
00087 //         // Begin or End figure mode
00088 //         BipIface->BeginFigureMode(1);
00089 //         BipIface->EndFigureMode(1);
00090 //     }
00091 // }
00092 
00093 
00094 // BipedExport: This class can be returned by calling the method GetInterface() from a Biped controller
00095 // Given controller *c points to a Biped controller, then:
00096 // IBipedExport *BipIface = (IBipedExport *) (c->GetInterface(I_BIPINTERFACE));
00097 // will return the interface for this Biped Controller, else returns NULL.
00098 #pragma warning(push)
00099 #pragma warning(disable:4100)
00100 class IBipedExport: public MaxHeapOperators
00101 {
00102     public:
00103         
00104         BIPExport virtual ~IBipedExport() {}
00105 
00106         // For the BipedExport you got from the center of mass (root) controller, send in: 
00107         // VERTICAL_SUBANIM, HORIZONTAL_SUBANIM, and ROTATION_SUBANIM 
00108         // to get information for those tracks.
00109         // For other BipedExports this method is irrelevant.
00110         // The SetSubAnim method is actually included for future releases, 
00111         // when more methods will be added to the IBipedExport class.
00112         // Then you could call these methods for the three center of mass subanims.
00113         // It is not presently useful.
00114         BIPExport virtual void SetSubAnim (int i) {};
00115 
00116         // call this from any IBipedExport instance to remove or restore non uniform scaling
00117         BIPExport virtual void RemoveNonUniformScale(BOOL onOFF) {};
00118 
00119         // call these to begin and end figure mode
00120         BIPExport virtual void BeginFigureMode(int redraw) {};
00121         BIPExport virtual void EndFigureMode(int redraw) {};
00122 };
00123 
00124 #pragma warning(pop)
00125