added everything

This commit is contained in:
Metario
2017-04-17 06:17:10 -06:00
commit 9c6ff74f19
6121 changed files with 1625704 additions and 0 deletions

View File

@ -0,0 +1,56 @@
/*****************************************************************************
* FILE: BuildWarnings.h
* DESCRIPTION: Enables\Disables build warnings
* CREATED BY: Attila Szabo
* HISTORY:
* - 2003.Oct.14 - created
******************************************************************************
* Copyright (c) 2003 Autodesk, All Rights Reserved.
******************************************************************************/
#ifndef _BUILD_WARNINGS_H_
#define _BUILD_WARNINGS_H_
//*****************************************************************************
// WARNINGS
//*****************************************************************************
// - Enabling certain level 4 warnings can help to automatically detect defects in the code.
// - To disable warning number N in your code (only if absolutely necessary!),
// You can do the following:
// #pragma warning( push )
// #pragma warning( disable : N )
// void YourFunction() {
// }
// #pragma warning( pop )
//
// - The following level 4 warnings have been promoted to level 3:
// + C4130 - 'operator' : logical operation on address of string constant
#pragma warning (3 : 4130 )
//*****************************************************************************
// COMPILER SPECIFIC DEFINES
//*****************************************************************************
#if (_MSC_VER >= 1300) // Visual Studio .NET
// SS 6/7/2002: globally turning off certain warnings we now receive from
// the VC7 compiler. This may only be temporary.
// NH 02/12/03 Added this to R6 but I only kept the first pragma. This was to get
// a nicer looking build and so we could concentrate on the easier fixes.
// We may want to address this again
// Temporarily re-enabled the other two pragmas to help find bigger problems in the
// build logs, 020319 --prs.
// Conversion from XXX to YYY, possible loss of data
#pragma warning(disable: 4244)
// Signed/unsigned mismatch (for ==, >, etc.)
#pragma warning(disable: 4018)
// Loop control variable declared in the for-loop is used outside the for-loop
// scope; it conflicts with the declaration in the outer scope
#pragma warning(disable: 4288)
#endif
#endif // _BUILD_WARNINGS_H_

View File

@ -0,0 +1,218 @@
#define ANALYZER_INTERFACE Interface_ID(0x14bf34cc, 0x519c0633)
#define FIXER_INTERFACE Interface_ID(0xfcd6b18, 0x6e714e23)
#define FILTER_INTERFACE Interface_ID(0x36ca302f, 0x23d147a6)
#define WORKBENCH_INTERFACE Interface_ID(0x78aa2c29, 0x19a55d39)
class IWorkBench : public FPStaticInterface
{
public:
//these function not only affect workbench but all functions
//outside workbench also!
DECLARE_DESCRIPTOR(IWorkBench);
virtual void Open(); //pops up in viewprt
virtual void ToggleShowX();
virtual BOOL GetShowX();
virtual void ToggleShowY();
virtual BOOL GetShowY();
virtual void ToggleShowZ();
virtual BOOL GetShowZ();
virtual void ToggleLayerEdit();
virtual BOOL GetLayerEdit();
virtual void ToggleDrawDuringMove();
virtual BOOL GetDrawDuringMove();
virtual void ToggleLimit180();
virtual BOOL GetLimit180();
virtual void ShowQuatCurve();
virtual void ShowPosCurve();
virtual void ShowAngSpeedCurve();
virtual void ShowAngAccelCurve();
virtual void ShowAngJerkCurve();
virtual void ShowPosSpeedCurve();
virtual void ShowPosAccelCurve();
virtual void ShowPosJerkCurve();
virtual void PosCurveToWorld();
virtual void PosCurveToBipRoot();
virtual void PosCurveToThisNode(INode *node);
typedef enum {toggleShowX=0,getShowX,toggleShowY,getShowY,toggleShowZ,getShowZ,
toggleLayerEdit,getLayerEdit,toggleDrawDuringMove,getDrawDuringMove,
toggleLimit180,getLimit180,
showQuatCurve,showPosCurve,showAngSpeedCurve,showAngAccelCurve,showAngJerkCurve,
showPosSpeedCurve,showPosAccelCurve,showPosJerkCurve,posCurveToWorld, posCurveToBipRoot,
posCurveToThisNode,open} WorkBenchFunctions;
BEGIN_FUNCTION_MAP
VFN_0(toggleShowX,ToggleShowX);
FN_0(getShowX,TYPE_BOOL,GetShowX);
VFN_0(toggleShowY,ToggleShowY);
FN_0(getShowY,TYPE_BOOL,GetShowY);
VFN_0(toggleShowZ,ToggleShowZ);
FN_0(getShowZ,TYPE_BOOL,GetShowZ);
VFN_0(toggleLayerEdit,ToggleLayerEdit);
FN_0(getLayerEdit,TYPE_BOOL,GetLayerEdit);
VFN_0(toggleDrawDuringMove,ToggleDrawDuringMove);
FN_0(getDrawDuringMove,TYPE_BOOL,GetDrawDuringMove);
VFN_0(toggleLimit180,ToggleLimit180);
FN_0(getLimit180,TYPE_BOOL,GetLimit180);
VFN_0(showQuatCurve,ShowQuatCurve);
VFN_0(showPosCurve,ShowPosCurve);
VFN_0(showAngSpeedCurve,ShowAngSpeedCurve);
VFN_0(showAngAccelCurve,ShowAngAccelCurve);
VFN_0(showAngJerkCurve,ShowAngJerkCurve);
VFN_0(showPosSpeedCurve,ShowPosSpeedCurve);
VFN_0(showPosAccelCurve,ShowPosAccelCurve);
VFN_0(showPosJerkCurve,ShowPosJerkCurve);
VFN_0(posCurveToWorld,PosCurveToWorld);
VFN_0(posCurveToBipRoot,PosCurveToBipRoot);
VFN_1(posCurveToThisNode,PosCurveToThisNode,TYPE_INODE);
VFN_0(open,Open);
END_FUNCTION_MAP
};
class IAnalyzer : public FPStaticInterface
{
public:
DECLARE_DESCRIPTOR(IAnalyzer);
//note for the analysis functions if angular type is TRUE then the passed in parent node value isn't used.
//Otherwise if it's FALSE(it's a position analysis) then the parent node is used to calculate the cooridinate space
// of the resulting calculation.
virtual void DoNoiseDetectorAnalysis(Tab<INode *>&nodesToAnalyze,Interval range,float deviation,BOOL angular,int noiseType,INode *pNode);
virtual void DoSpikeDetectorAnalysis(Tab<INode *>&nodesToAnalyze,Interval range,float deviation);
virtual void DoKneeWobbleAnalysis(Tab<INode *>&nodesToAnalyze,Interval range,float frameThreshold,float fluctuationThreshold);
virtual void DoKneeExtensionAnalysis(Tab<INode *>&nodesToAnalyze,Interval range,float kneeAngle);
virtual Tab<TimeValue > GetResults(INode *node);
virtual void LoadAnalysisFile(char *filename);
virtual void SaveAnalysisFile(Tab<INode *> &nodes,char *filename);
virtual void ClearAnalysisResults();
typedef enum {doNoiseDetectorAnalysis=0,doSpikeDetectorAnalysis,getResults,
loadAnalysisFile,saveAnalysisFile,clearAnalysisResults,
doKneeWobbleAnalysis,doKneeExtensionAnalysis} AnalyzeFunctions;
BEGIN_FUNCTION_MAP
VFN_6(doNoiseDetectorAnalysis, DoNoiseDetectorAnalysis,TYPE_INODE_TAB_BR,TYPE_INTERVAL,TYPE_FLOAT,TYPE_BOOL,TYPE_INT,TYPE_INODE);
VFN_3(doSpikeDetectorAnalysis, DoSpikeDetectorAnalysis,TYPE_INODE_TAB_BR,TYPE_INTERVAL,TYPE_FLOAT);
FN_1(getResults,TYPE_TIMEVALUE_TAB_BV,GetResults,TYPE_INODE);
VFN_1(loadAnalysisFile,LoadAnalysisFile,TYPE_STRING);
VFN_2(saveAnalysisFile,SaveAnalysisFile,TYPE_INODE_TAB_BR,TYPE_STRING);
VFN_0(clearAnalysisResults,ClearAnalysisResults);
VFN_4(doKneeWobbleAnalysis, DoKneeWobbleAnalysis,TYPE_INODE_TAB_BR,TYPE_INTERVAL,TYPE_FLOAT,TYPE_FLOAT);
VFN_3(doKneeExtensionAnalysis, DoKneeExtensionAnalysis,TYPE_INODE_TAB_BR,TYPE_INTERVAL,TYPE_FLOAT);
END_FUNCTION_MAP
};
class IFixer : public FPStaticInterface
{
public:
DECLARE_DESCRIPTOR(IFixer);
virtual void DoAngSmoothing(Tab<INode *>&nodes,int width, float damping);
virtual void DoAngBlurring(Tab<INode *>&nodes,int width, float damping);
virtual void DoAdvAngSmoothing(Tab<INode *>&nodes,int width, float damping);
virtual void DoPosSmoothing(Tab<INode *>&nodes,int width, float damping);
virtual void DoPosBlurring(Tab<INode *>&nodes,int width, float damping);
virtual void DoRemoveKeys(Tab<INode *>&nodes,int intervalWidth,BOOL deleteKeys);
virtual void DoKneeWobbleFix(Tab<INode *>&nodes,float frameThreshold,float fluctuationThreshold);
virtual void DoKneeExtensionFix(Tab<INode *>&nodes,float kneeAngle);
typedef enum {
doAngSmoothing = 0, doAngBlurring, doAdvAngSmoothing,doPosSmoothing,
doPosBlurring,doRemoveKeys,doKneeWobbleFix,doKneeExtensionFix
} FilterFunctions;
BEGIN_FUNCTION_MAP
VFN_3(doAngSmoothing, DoAngSmoothing,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT);
VFN_3(doAngBlurring, DoAngBlurring,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT);
VFN_3(doAdvAngSmoothing, DoAdvAngSmoothing,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT);
VFN_3(doPosSmoothing, DoPosSmoothing,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT);
VFN_3(doPosBlurring, DoPosBlurring,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT);
VFN_3(doRemoveKeys, DoRemoveKeys,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_BOOL);
VFN_3(doKneeWobbleFix, DoKneeWobbleFix,TYPE_INODE_TAB_BR,TYPE_FLOAT,TYPE_FLOAT);
VFN_2(doKneeExtensionFix, DoKneeExtensionFix,TYPE_INODE_TAB_BR,TYPE_FLOAT);
END_FUNCTION_MAP
};
class IFilter : public FPStaticInterface
{
public:
DECLARE_DESCRIPTOR(IFilter);
virtual void DoAngSmoothing(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoAngBlurring(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoAngBoosting(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoAdvAngSmoothing(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoPosSmoothing(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoPosBlurring(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoPosBoosting(Tab<INode *>&nodes,int width, float damping,Interval range);
virtual void DoKeyReduction(Tab<INode *>&nodes,float tolerance,int keySpacing, float COMTolerance,
float COMKeySpacing,Interval range);
virtual void DoKeyPerFrame(Tab<INode *>&nodes);
virtual void EnablePosSubAnim(Tab<INode *> &nodes,BOOL enable);
virtual void EnableRotSubAnim(Tab<INode *> &nodes,BOOL enable);
virtual void EnableScaleSubAnim(Tab<INode *> &nodes,BOOL enable);
virtual void CollapsePosSubAnim(Tab<INode *> &nodes,BOOL perFrame, BOOL deleteSubAnim);
virtual void CollapseRotSubAnim(Tab<INode *> &nodes, BOOL perFrame,BOOL deleteSubAnim);
virtual void CreatePosSubAnim(Tab<INode *> &nodes,Control *toClone,BOOL checkIfOneExists);
virtual void CreateRotSubAnim(Tab<INode *> &nodes,Control *toClone,BOOL checkIfOneExists);
virtual void CreateScaleSubAnim(Tab<INode *> &nodes,Control *toClone,BOOL checkIfOneExists);
virtual void DoKneeWobbleFilter(Tab<INode *>&nodes,float frameThreshold,float fluctuationThreshold,Interval range);
virtual void DoKneeExtensionFilter(Tab<INode *>&nodes,float kneeAngle,Interval range);
typedef enum {
doAngSmoothing = 0, doAngBlurring,doAngBoosting,doAdvAngSmoothing,doPosSmoothing,
doPosBlurring,doPosBoosting,doKeyReduction,doKeyPerFrame,
enablePosSubAnim,enableRotSubAnim,enableScaleSubAnim,
collapsePosSubAnim,collapseRotSubAnim,createPosSubAnim,createRotSubAnim,
createScaleSubAnim,doKneeWobbleFilter,doKneeExtensionFilter
} FilterFunctions;
BEGIN_FUNCTION_MAP
VFN_4(doAngSmoothing, DoAngSmoothing,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_4(doAngBlurring, DoAngBlurring,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_4(doAngBoosting, DoAngBoosting,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_4(doAdvAngSmoothing, DoAdvAngSmoothing,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_4(doPosSmoothing, DoPosSmoothing,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_4(doPosBlurring, DoPosBlurring,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_4(doPosBoosting, DoPosBoosting,TYPE_INODE_TAB_BR,TYPE_INT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_6(doKeyReduction, DoKeyReduction,TYPE_INODE_TAB_BR,TYPE_FLOAT,TYPE_INT,TYPE_FLOAT,TYPE_INT,TYPE_INTERVAL);
VFN_1(doKeyPerFrame, DoKeyPerFrame,TYPE_INODE_TAB_BR);
VFN_2(enablePosSubAnim, EnablePosSubAnim,TYPE_INODE_TAB_BR,TYPE_BOOL);
VFN_2(enableRotSubAnim, EnableRotSubAnim,TYPE_INODE_TAB_BR,TYPE_BOOL);
VFN_2(enableScaleSubAnim, EnableScaleSubAnim,TYPE_INODE_TAB_BR,TYPE_BOOL);
VFN_3(collapsePosSubAnim, CollapsePosSubAnim,TYPE_INODE_TAB_BR,TYPE_BOOL,TYPE_BOOL);
VFN_3(collapseRotSubAnim, CollapseRotSubAnim,TYPE_INODE_TAB_BR,TYPE_BOOL,TYPE_BOOL);
VFN_3(createPosSubAnim, CreatePosSubAnim,TYPE_INODE_TAB_BR,TYPE_CONTROL,TYPE_BOOL);
VFN_3(createRotSubAnim, CreateRotSubAnim,TYPE_INODE_TAB_BR,TYPE_CONTROL,TYPE_BOOL);
VFN_3(createScaleSubAnim, CreateScaleSubAnim,TYPE_INODE_TAB_BR,TYPE_CONTROL,TYPE_BOOL);
VFN_4(doKneeWobbleFilter, DoKneeWobbleFilter,TYPE_INODE_TAB_BR,TYPE_FLOAT,TYPE_FLOAT,TYPE_INTERVAL);
VFN_3(doKneeExtensionFilter, DoKneeExtensionFilter,TYPE_INODE_TAB_BR,TYPE_FLOAT,TYPE_INTERVAL);
END_FUNCTION_MAP
};

120
lib/maxsdk70/include/CS/BIPEXP.H Executable file
View File

@ -0,0 +1,120 @@
/******************************************************************************
*<
FILE: bipexp.h
DESCRIPTION: Export Interface Functionality for BIped
CREATED BY: Susan Amkraut with a lot of help from John Chadwick
HISTORY: created June 2, 1998
*> Copyright (c) Unreal Pictures, Inc. 1997, 1998 All Rights Reserved.
*******************************************************************************/
#ifndef BIPEXP_H
#define BIPEXP_H
#ifdef BLD_BIPED
#define BIPExport __declspec( dllexport )
#else
#define BIPExport __declspec( dllimport )
#endif
#include "max.h"
// This is the interface ID for a Biped Controller Interface
#define I_BIPINTERFACE 0x00100101
// These are subanim numbers for the center of mass (root) controller
#define VERTICAL_SUBANIM 0
#define HORIZONTAL_SUBANIM 1
#define ROTATION_SUBANIM 2
// These are the Class ID defines for Biped Controllers.
#ifndef BLD_BIPED
// this is the class for all biped controllers except the root and the footsteps
#define BIPSLAVE_CONTROL_CLASS_ID Class_ID(0x9154,0)
// this is the class for the center of mass, biped root controller ("Bip01")
#define BIPBODY_CONTROL_CLASS_ID Class_ID(0x9156,0)
// this is the class for the biped footstep controller ("Bip01 Footsteps")
#define FOOTPRINT_CLASS_ID Class_ID(0x3011,0)
#endif
// Using the Biped Export Interface
//
// 1. Find the Biped Controller you wish to export from (see the sample code).
//
// 2. Given a Biped controller c, get the Biped Export Interface:
// IBipedExport *BipIface = (BipedExport *)c->GetInterface(I_BIPINTERFACE);
//
// At the moment this interface only allows you to remove the non uniform scale.
// This allows you to export cleaner transform information from a biped.
// In the future, more virtual functions will be added, and you'll be able
// to get more information about the biped via this interface.
// Sample Code
//
// // Get a biped node - in this case the root
// INode *node = ip->GetINodeByName("Bip01");
//
// if (node)
// {
// // Get the node's transform control
// Control *c = node->GetTMController();
//
// // You can test whether or not this is a biped controller with the following pseudo code:
// if ((c->ClassID() == BIPSLAVE_CONTROL_CLASS_ID) ||
// (c->ClassID() == BIPBODY_CONTROL_CLASS_ID)
// (c->ClassID() == FOOTPRINT_CLASS_ID))
// {
//
// // Get the Biped Export Interface from the controller
// IBipedExport *BipIface = (IBipedExport *) c->GetInterface(I_BIPINTERFACE);
//
// // Remove the non uniform scale
// BipIface->RemoveNonUniformScale(1);
// // Begin or End figure mode
// BipIface->BeginFigureMode(1);
// BipIface->EndFigureMode(1);
// }
// }
// BipedExport: This class can be returned by calling the method GetInterface() from a Biped controller
// Given controller *c points to a Biped controller, then:
// IBipedExport *BipIface = (IBipedExport *) (c->GetInterface(I_BIPINTERFACE));
// will return the interface for this Biped Controller, else returns NULL.
class IBipedExport
{
public:
BIPExport virtual ~IBipedExport() {}
// For the BipedExport you got from the center of mass (root) controller, send in:
// VERTICAL_SUBANIM, HORIZONTAL_SUBANIM, and ROTATION_SUBANIM
// to get information for those tracks.
// For other BipedExports this method is irrelevant.
// The SetSubAnim method is actually included for future releases,
// when more methods will be added to the IBipedExport class.
// Then you could call these methods for the three center of mass subanims.
// It is not presently useful.
BIPExport virtual void SetSubAnim (int i) {};
// call this from any IBipedExport instance to remove or restore non uniform scaling
BIPExport virtual void RemoveNonUniformScale(BOOL onOFF) {};
// call these to begin and end figure mode
BIPExport virtual void BeginFigureMode(int redraw) {};
BIPExport virtual void EndFigureMode(int redraw) {};
};
#endif

View File

@ -0,0 +1,652 @@
/*********************************************************************
*<
FILE: bipedapi.h
DESCRIPTION: These are functions that are exported in biped.dlc
CREATED BY: Ravi Karra
HISTORY: Created 21 June 1999
Modified July 2002 by Michael Zyracki
*> Copyright (c) 2002 All Rights Reserved.
**********************************************************************/
#ifndef __BIPEDAPI__
#define __BIPEDAPI__
#include "BipExp.h"
// Interfaces -work similarly to the biped export interface
#define I_BIPMASTER 0x9165
#define I_BIPFOOTSTEP 0x9166
#define GetBipMasterInterface(anim) ((IBipMaster*)(anim)->GetInterface(I_BIPMASTER))
#define GetBipFSInterface(anim) ((IBipFootStep*)(anim)->GetInterface(I_BIPFOOTSTEP))
// Biped modes
#define BMODE_FIGURE (1<<0)
#define BMODE_FOOTSTEP (1<<1)
#define BMODE_MOTIONFLOW (1<<2)
#define BMODE_BUFFER (1<<3)
#define BMODE_BENDLINKS (1<<4)
#define BMODE_RUBBERBAND (1<<5)
#define BMODE_SCALESTRIDE (1<<6)
#define BMODE_INPLACE (1<<7)
#define BMODE_INPLACE_X (1<<8)
#define BMODE_INPLACE_Y (1<<9)
#define BMODE_MIXER (1<<10)
#define BMODE_MOVEALL (1<<11)
#define BMODE_ALL (BMODE_FIGURE|BMODE_FOOTSTEP|BMODE_MOTIONFLOW| \
BMODE_BUFFER|BMODE_BENDLINKS|BMODE_RUBBERBAND| \
BMODE_SCALESTRIDE|BMODE_INPLACE|BMODE_MIXER|BMODE_MOVEALL)
// Display settings
#define BDISP_BONES (1<<0)
#define BDISP_OBJECTS (1<<1)
#define BDISP_FOOTSTEPS (1<<2)
#define BDISP_FOOTSTEPNUM (1<<3)
#define BDISP_TRAJ (1<<4)
// Biped Gait Flags
#define WALKGAIT 1
#define RUNGAIT 2
#define JUMPGAIT 3
//Copy/Paste types
#define COPY_POSTURE 0
#define COPY_POSE 1
#define COPY_TRACK 2
// Body types
#define BTYPE_SKELETON 0
#define BTYPE_MALE 1
#define BTYPE_FEMALE 2
#define BTYPE_CLASSIC 3
#define NUMPIVOTS 27 // Max number of pivot points that can exiss for an object
class IBipMaster;
class IMoFlow;
class IMixer;
class MocapManager;
class MixerManager;
class MultFprintParams;
// Create a new biped with the given options
BIPExport IBipMaster* CreateNewBiped(float height, float angle, const Point3& wpos,
BOOL arms=TRUE, BOOL triPelvis=TRUE, int nnecklinks=1, int nspinelinks=4,
int nleglinks=3, int ntaillinks=0, int npony1links=0, int npony2links=0,
int numfingers=5, int nfinglinks=3, int numtoes=5, int ntoelinks=3, float ankleAttach=0.2,
BOOL prop1exists = FALSE,BOOL prop2exists = FALSE, BOOL prop3exists = FALSE,
int forearmTwistLinks = 0);
// The ticks per frame used by the biped (Currently same as GetTicksPerFrame()).
BIPExport int BipGetTicksPerFrame();
#define MB_FSJUMP 0
#define MB_FFMODE 1
#define MB_RCNTFIG 2
bool GetMsgBoxStatus(int which);
void SetMsgBoxStatus(int which, bool hide);
// Global object that contains the Mocap Interface
extern BIPExport MocapManager TheMocapManager;
// Global object that contains the Mixer Interface
extern BIPExport MixerManager TheMixerManager;
//structs for loading and saving subanim controllers in .bip files. post cs4.2 change
//Note that the type is pos = 0, rot = 1, scale = 2
struct SaveSubAnimInfo
{
INode *node;
int type;
};
struct LoadSubAnimInfo
{
TCHAR name[256];
int type;
};
// Interface into the biped master controller
class IBipMaster {
public:
// Track selection, only work when the UI is showing up in command panel. The #defines are in tracks.h
virtual void SetTrackSelection(int track)=0;
virtual int GetTrackSelection()=0;
// File I/O methods
//These functions pop-up the dialog for file selection.
virtual void SaveBipFileDlg() = 0;
virtual void LoadBipFileDlg() = 0;
virtual int SaveFigfile (TCHAR *fname)=0;
virtual int SaveStpfile (TCHAR *fname)=0;
//These functions don't pop-up a dialog for I/O
virtual int SaveBipfile(TCHAR *fname, BOOL SaveListCntrls,BOOL SaveMaxObjects,Tab<SaveSubAnimInfo> *selectedControlers =NULL,
Tab<INode *> *selectedNodes = NULL) = 0;
virtual int SaveBipfileSegment(TCHAR *filenamebuf,int StartSeg,int EndSeg,int SegKeyPerFrame,
BOOL SaveListCntrls, BOOL SaveMaxObjects,Tab<SaveSubAnimInfo> *selectedControlers =NULL,
Tab<INode *> *selectedNodes = NULL) = 0;
virtual int LoadFigfile (TCHAR *fname, BOOL redraw = false, BOOL msgs = false)=0;
virtual int LoadBipStpfile(TCHAR *fname, BOOL redraw, BOOL msgs, BOOL MatchFile = false, BOOL ZeroHgt = false, BOOL loadMaxObjects = false,
BOOL promptForDuplicates = false, BOOL retargetHeight = false, BOOL retargetLimbSizes = false,
BOOL scaleIKObjectSize = false, BOOL loadSubAnimControllers = false,Tab<TCHAR *> *selectedNodes = NULL,
Tab<LoadSubAnimInfo> *selectedControllers = NULL) =0;
virtual int LoadMocapfile (TCHAR *fname, BOOL redraw = false, BOOL msgs = false, BOOL prompt = false)=0;
// General+Modes
virtual BOOL IsCreating()=0; //will return TRUE if creating
virtual void BeginModes(DWORD modes, int redraw=TRUE)=0;
virtual void EndModes(DWORD modes, int redraw=TRUE)=0;
virtual DWORD GetActiveModes()=0;
virtual BOOL CanSwitchMode(DWORD mode)=0; //returns TRUE if we can switch to that mode from our current mode
virtual void ConvertToFreeForm(bool keyPerFrame=false)=0;
virtual void ConvertToFootSteps(bool keyPerFrame=false, bool flattenToZ=true)=0;
// Display properties
virtual DWORD GetDisplaySettings()=0;
virtual void SetDisplaySettings(DWORD disp)=0;
virtual BOOL DoDisplayPrefDlg(HWND hParent)=0;
// Body types
virtual int GetBodyType() =0;
virtual void SetBodyType(int bodytype) =0;
// Anim properties
virtual int GetDynamicsType()=0;
virtual void SetDynamicsType(int dyn)=0;
virtual float GetGravAccel()=0;
virtual void SetGravAccel(float grav)=0;
virtual TCHAR* GetRootName()=0;
virtual void SetRootName(TCHAR *rootname, bool incAll=true)=0;
virtual BOOL GetAdaptLocks(int id)=0;
virtual void SetAdaptLocks(int id, BOOL onOff)=0;
virtual BOOL GetSeparateTracks(int id)=0;
virtual void SeparateTracks(int id, BOOL separate)=0;
virtual void SetBodySpaceNeckRotation(BOOL val)=0;
virtual BOOL GetBodySpaceNeckRotation()=0;
// Structure properties
virtual BOOL GetHasArms()=0;
virtual void SetHasArms(BOOL arms)=0;
virtual int GetNumLinks(int keytrack)=0;
virtual void SetNumLinks(int keytrack, int n)=0;
virtual int GetNumFingers()=0;
virtual void SetNumFingers(int n)=0;
virtual int GetNumToes()=0;
virtual void SetNumToes(int n)=0;
virtual float GetAnkleAttach()=0;
virtual void SetAnkleAttach(float aa)=0;
virtual float GetHeight()=0;
virtual void SetHeight(float h, BOOL KeepFeetOnGround = TRUE)=0;
virtual BOOL GetTrianglePelvis()=0;
virtual void SetTrianglePelvis(BOOL tri)=0;
virtual BOOL GetProp1Exists()=0;
virtual void SetProp1Exists(BOOL prop)=0;
virtual BOOL GetProp2Exists()=0;
virtual void SetProp2Exists(BOOL prop)=0;
virtual BOOL GetProp3Exists()=0;
virtual void SetProp3Exists(BOOL prop)=0;
// mocap params
virtual BOOL ConvertFromBuffer()=0;
virtual BOOL PasteFromBuffer()=0;
virtual BOOL GetDispBuffer()=0;
virtual void SetDispBuffer(BOOL onOff)=0;
virtual BOOL GetDispBufferTraj()=0;
virtual void SetDispBufferTraj(BOOL onOff)=0;
virtual BOOL GetTalentFigMode()=0;
virtual void SetTalentFigMode(BOOL onOff)=0;
virtual void AdjustTalentPose()=0;
virtual void SaveTalentFigFile(TCHAR *fname)=0;
virtual void SaveTalentPoseFile(TCHAR *fname)=0;
// footstep creation/operations
virtual BOOL GetFSAppendState()=0;
virtual void SetFSAppendState(BOOL onOff)=0;
virtual BOOL GetFSInsertState()=0;
virtual void SetFSInsertState(BOOL onOff)=0;
virtual int GetGaitMode()=0;
virtual void SetGaitMode(int mode)=0;
virtual int GetGroundDur()=0;
virtual void SetGroundDur(int val)=0;
virtual int GetAirDur()=0;
virtual void SetAirDur(int val)=0;
virtual void DoMultipleFSDlg()=0;
virtual int AddFootprint(Point3 pos, float dir, Matrix3 mtx, int appendFS)=0;
virtual void AddFootprints(MultFprintParams *Params)=0;
virtual void NewFprintKeys()=0;
virtual void BendFootprints(float angle)=0;
virtual void ScaleFootprints(float scale)=0;
// motion flow interface
virtual IMoFlow* GetMoFlow()=0;
virtual void UnifyMotion()=0;
virtual TCHAR* GetClipAtTime(TimeValue t)=0; //returns the current clip
// mixer interface
virtual IMixer* GetMixer()=0;
// IK objects
//this set's the ik object for the current selected body part
virtual void SetAttachNode(INode *node)=0;
virtual INode* GetAttachNode()=0;
//head target
virtual void SetHeadTarget(INode *node)=0;
virtual INode * GetHeadTarget() =0;
// Anim,controls,nodes....
virtual bool IsNodeDeleted()=0; //test to see if the interface's node has been deleted.
virtual Interval GetCurrentRange()=0;
virtual int GetMaxNodes()=0;
virtual int GetMaxLinks()=0;
virtual INode* GetNode(int id, int link=0)=0;
virtual BOOL GetIdLink(INode *node, int &id, int &link)=0;
virtual Control * GetHorizontalControl()=0;
virtual Control * GetVerticalControl()=0;
virtual Control * GetTurnControl()=0;
//get set keys and transforms. (in world space)
virtual void SetBipedKey(TimeValue t,INode *node = NULL, BOOL setHor = TRUE, BOOL setVer = TRUE,BOOL setTurn = TRUE)=0;
virtual void SetPlantedKey(TimeValue t,INode *node = NULL)=0;
virtual void SetSlidingKey(TimeValue t,INode *node = NULL)=0;
virtual void SetFreeKey(TimeValue t,INode *node = NULL)=0;
virtual ScaleValue GetBipedScale(TimeValue t, INode *node)=0;
virtual Point3 GetBipedPos(TimeValue t, INode *node)=0;
virtual Quat GetBipedRot(TimeValue t, INode *node,BOOL local = FALSE)=0;
//note that this set's a relative scale!
virtual void SetBipedScale(BOOL relative,const ScaleValue &scale, TimeValue t, INode *node)=0;
virtual void SetBipedPos(const Point3 &p, TimeValue t, INode *node,BOOL setKey =TRUE)=0;
virtual void SetBipedRot(const Quat &q, TimeValue t, INode *node,BOOL setKey = TRUE)=0;
virtual void SetMultipleKeys()=0;
virtual void DoSetMultipleKeysDlg()=0;
//reset's the limb ik pivots. useful when using subanim scale and there's some wierdness like sub-frame popping.
virtual void ResetAllLimbKeys() = 0;
//collapse the move all mode down
virtual void CollapseMoveAllMode(BOOL msg) =0;
//Biped Internal structures get/sets. These functions deal with internal biped structures and hierarchy.
virtual INode* GetRotParentNode(int id,int link)=0; //the parent node where the rotation is inherited from
virtual INode* GetPosParentNode(int id,int link)=0; //the parent node where the position is inherited from
virtual Quat GetParentNodeRot(TimeValue t,int id,int link)=0; //rotation value of the parent
virtual Point3 GetParentNodePos(TimeValue t,int id,int link)=0; //position value of the parent.
virtual void GetClavicleVals(TimeValue t, int id, float &val1,float &val2)=0; //this is valid for KEY_RARM & KEY_LARM or
virtual void GetHingeVal(TimeValue t,int id, float &val)=0; //this is valid for KEY_RARM & KEY_LARM & KEY_RLEG & KEY_LLEG. it get's the elbow/knee angle
virtual void GetHorseAnkleVal(TimeValue, int id, float &val)=0; //this is valid only if you have a horse leg and KEY_RLEG and KEY_LLEG
virtual void GetPelvisVal(TimeValue t, float &val) =0; //get's the pelvis angle
virtual void GetFingerVal(TimeValue t,int id,int link, float &val) = 0;//get the finger rotation value for the finger segements with 1 DOF
virtual BOOL GetIKActive(TimeValue t,int id) = 0;//Fuction to see if a biped limb is effect by ik at a particular time
// Layers.
virtual int NumLayers()=0;
virtual void CreateLayer(int index, TCHAR* name)=0;
virtual void DeleteLayer(int index)=0;
virtual bool CollapseAtLayer(int index)=0; //only works if all layers under this layer are active, returns true if successul
virtual bool GetLayerActive(int index)=0;
virtual void SetLayerActive(int index, bool onOff)=0;
virtual TCHAR* GetLayerName(int index)=0;
virtual void SetLayerName(int index, TCHAR* name)=0;
virtual int GetCurrentLayer()=0;
virtual void SetCurrentLayer(int index)=0;
virtual void UpdateLayers()=0; // need to call this after changes made to layers
virtual void SetSnapKey(TimeValue t,INode *node = NULL)=0;
//layer display info
virtual int GetVisibleBefore()=0;
virtual void SetVisibleBefore(int val)=0;
virtual int GetVisibleAfter()=0;
virtual void SetVisibleAfter(int val)=0;
virtual bool GetKeyHighlight()=0;
virtual void SetKeyHighlight(bool onOff)=0;
// preferred clips for use with biped crowd.
virtual void ClearPreferredClips()=0;
virtual bool AddPreferredClip(TCHAR *clipname, int prob = 100)=0;
virtual bool DeletePreferredClip(TCHAR *clipname)=0;
virtual int IsPreferredClip(TCHAR *clipname)=0;
virtual TCHAR* GetCurrentClip()=0;
virtual int NumPreferredClips()=0;
virtual TCHAR* GetPreferredClip(int i)=0;
virtual int GetPreferredClipProbability(int i)=0;
//Biped Subanims
virtual bool GetEnableSubAnims()=0;
virtual void SetEnableSubAnims(bool onOff)=0;
virtual bool GetManipSubAnims()=0;
virtual void SetManipSubAnims(bool onOff)=0;
//Trackbar stuff //this is post CS4.2
virtual bool GetShowAllTracksInTV()=0;
virtual void SetShowAllTracksInTV(bool onOff)=0;
//doesn't workvirtual bool GetShowSubanimInTrackBar()=0;
//virtual void SetShowSubanimInTrackBar(bool onOff)=0;
virtual bool GetShowBipedInTrackBar()=0;
virtual void SetShowBipedInTrackBar(bool onOff)=0;
virtual void Mirror() =0;
virtual void ClearAllAnimation() =0;
virtual void ClearSelectedAnimation() =0;
//These functions will clone the 'controlToClone' control and put it in each appropiate BipedSubAnim::List,
//and make that control the active control. If 'checkIfOneExists' is TRUE it will first check to see
//if a controller of the same type already exists in the subanim list, in which case it will just
//set that one as active,and not clone a new one.
virtual void CreatePosSubAnims(Control *controlToClone, BOOL checkIfOneExists)=0;
virtual void CreateRotSubAnims(Control *controlToClone, BOOL checkIfOneExists)=0;
virtual void CreateScaleSubAnims(Control *controlToClone, BOOL checkIfOneExists)=0;
//these functions Set a key for the appropiate active controller in the list controller for the
//specified node. If 'absolute' is true the value used to set the key is the total combined value
//of the underlying biped value plus the subanim value. Thus the subanim value will be calculating
//by subtracting out the biped value. If 'absolute' is false the value is the exact subanim key value
//that will be set. Due to the limitation in defining a global 'biped scale', the scale type of this
//function has no absolute parameter and always just sets the key with the specified value
virtual void SetPosSubAnim(const Point3 &p, TimeValue t, INode *node,BOOL absolute)=0;
virtual void SetRotSubAnim(const Quat &q, TimeValue t, INode *node,BOOL absolute) = 0;
virtual void SetScaleSubAnim(const ScaleValue &s, TimeValue t, INode *node) = 0;
//these function calls collapse the specified subAnims..
virtual void CollapseAllPosSubAnims(BOOL perFrame,BOOL keep) = 0;
virtual void CollapseAllRotSubAnims(BOOL perFrame,BOOL keep) = 0;
virtual void CollapseRotSubAnims(BOOL perFrame,BOOL keep,INode *node) = 0;
virtual void CollapsePosSubAnims(BOOL perFrame,BOOL keep,INode *node) = 0;
//Copy/Paste exposure
virtual char * CopyPosture(int copyType,BOOL copyHor,BOOL copyVer,BOOL copyTurn) = 0;
virtual BOOL PastePosture(int copyType,int opposite,char *name) = 0;
virtual void DeleteAllCopies(int copyType, BOOL holdIt = true) = 0;
virtual int NumCopies(int copyType) = 0;
virtual void DeleteCopy(int copyType,char *name) = 0;
virtual TCHAR *GetCopyName(int copyType,int which) = 0;
virtual void SetCopyName(int copyType,int oldIndex, char *newName) = 0;
virtual BOOL SaveCopyPasteFile(char *fname) = 0;
virtual BOOL LoadCopyPasteFile(char *fname) = 0;
};
//Interface to the biped footstep
class IBipFootStep
{
public:
virtual void SetFreeFormMode(BOOL mode)=0;
virtual BOOL GetFreeFormMode()=0;
virtual void SetDispNumType(int type)=0;
virtual int GetDispNumType()=0;
virtual void SetDispAirDur(BOOL onOff)=0;
virtual BOOL GetDispAirDur()=0;
virtual void SetDispNoSupport(BOOL onOff)=0;
virtual BOOL GetDispNoSupport()=0;
virtual void UpdateEditTrackUI()=0;
virtual void UpdateFootSteps(TimeValue t){}
};
// defines for mocap key reduction settings
#define KRS_ALL 0
#define KRS_HORZ 1
#define KRS_VERT 2
#define KRS_ROT 3
#define KRS_PLV 4
#define KRS_SPN 5
#define KRS_NCK 6
#define KRS_LARM 7
#define KRS_RARM 8
#define KRS_LLEG 9
#define KRS_RLEG 10
#define KRS_TAIL 11
// defines for mocap GetLimbOrientation/SetLimbOrientation
#define LIMB_KNEE 0
#define LIMB_ELBOW 1
#define LIMB_FOOT 2
#define LIMB_HAND 3
#define ANGLE_ALIGN 0
#define POINT_ALIGN 1
#define AUTO_ALIGN 2
//The mocap manager class.
class MocapManager {
public:
// import dialog properties
BIPExport TCHAR* GetTalentFigStrucFile();
BIPExport void SetTalentFigStrucFile(const TCHAR *fname);
BIPExport BOOL GetUseTalentFigStrucFile() const;
BIPExport void SetUseTalentFigStrucFile(BOOL onOff);
BIPExport TCHAR* GetTalentPoseAdjFile() const;
BIPExport void SetTalentPoseAdjFile(const TCHAR *fname);
BIPExport BOOL GetUseTalentPoseAdjFile() const;
BIPExport void SetUseTalentPoseAdjFile(BOOL onOff);
BIPExport int GetFSExtractionMode() const;
BIPExport void SetFSExtractionMode(int mode);
BIPExport int GetFSConversionMode() const;
BIPExport void SetFSConversionMode(int mode);
// 0 - x, 1 - y, 2 - z
BIPExport int GetUpVector() const;
BIPExport void SetUpVector(int axis);
BIPExport float GetScaleFactor() const;
BIPExport void SetScaleFactor(float val);
BIPExport float GetFSExtractionTol() const;
BIPExport void SetFSExtractionTol(float val);
BIPExport float GetFSSlidingDist() const;
BIPExport void SetFSSlidingDist(float val);
BIPExport float GetFSSlidingAngle() const;
BIPExport void SetFSSlidingAngle(float val);
BIPExport float GetFSVerticalTol() const;
BIPExport void SetFSVerticalTol(float val);
BIPExport float GetFSZLevel() const;
BIPExport void SetFSZLevel(float val);
BIPExport BOOL GetFSUseVerticalTol() const;
BIPExport void SetFSUseVerticalTol(BOOL val);
BIPExport BOOL GetFSUseFlatten() const;
BIPExport void SetFSUseFlatten(BOOL val);
BIPExport int GetStartFrame() const;
BIPExport void SetStartFrame(int val);
BIPExport int GetEndFrame() const;
BIPExport void SetEndFrame(int val);
BIPExport BOOL GetUseLoopFrame() const;
BIPExport void SetUseLoopFrame(BOOL val);
BIPExport int GetLoopFrameCount() const;
BIPExport void SetLoopFrameCount(int val);
BIPExport float GetKeyReductionTol(int part) const;
BIPExport void SetKeyReductionTol(int part, float val);
BIPExport int GetKeyReductionSpacing(int part) const;
BIPExport void SetKeyReductionSpacing(int part, float val);
BIPExport BOOL GetKeyReductionFilter(int part) const;
BIPExport void SetKeyReductionFilter(int part, BOOL onOff);
BIPExport int GetLimbOrientation(int limb) const;
BIPExport void SetLimbOrientation(int limb, int val);
BIPExport int LoadMocapParameters(const TCHAR *fname);
BIPExport int SaveMocapParameters(const TCHAR *fname);
// marker name dialog
BIPExport TCHAR* GetMarkerNameFile() const;
BIPExport bool LoadMarkerNameFile(const TCHAR *fname);
BIPExport BOOL GetUseMarkerNameFile() const;
BIPExport void SetUseMarkerNameFile(BOOL onOff);
BIPExport TCHAR* GetJointNameFile() const;
BIPExport bool LoadJointNameFile(const TCHAR *fname);
BIPExport BOOL GetUseJointNameFile() const;
BIPExport void SetUseJointNameFile(BOOL onOff);
BIPExport int BatchConvert(TCHAR* inDir, TCHAR* outDir, TCHAR* ext);
BIPExport BOOL GetDispKnownMarkers() const;
BIPExport void SetDispKnownMarkers(BOOL onOff);
BIPExport int GetDispKnownMarkersType() const; // 0 - Sel objects, 1 - all
BIPExport void SetDispKnownMarkersType(int type); // 0 - Sel objects, 1 - all
BIPExport BOOL GetDispUnKnownMarkers() const;
BIPExport void SetDispUnKnownMarkers(BOOL onOff);
BIPExport BOOL GetDispPropMarkers() const;
BIPExport void SetDispPropMarkers(BOOL onOff);
};
//The mixer manager class.
class MixerManager {
public:
BIPExport BOOL GetSnapFrames();
BIPExport void SetSnapFrames(BOOL onOff);
BIPExport BOOL GetShowTgRangebars();
BIPExport void SetShowTgRangebars(BOOL onOff);
BIPExport BOOL GetShowWgtCurves();
BIPExport void SetShowWgtCurves(BOOL onOff);
BIPExport BOOL GetShowTimeWarps();
BIPExport void SetShowTimeWarps(BOOL onOff);
BIPExport BOOL GetShowClipBounds();
BIPExport void SetShowClipBounds(BOOL onOff);
BIPExport BOOL GetShowGlobal();
BIPExport void SetShowGlobal(BOOL onOff);
BIPExport BOOL GetShowClipNames();
BIPExport void SetShowClipNames(BOOL onOff);
BIPExport BOOL GetShowClipScale();
BIPExport void SetShowClipScale(BOOL onOff);
BIPExport BOOL GetShowTransStart();
BIPExport void SetShowTransStart(BOOL onOff);
BIPExport BOOL GetShowTransEnd();
BIPExport void SetShowTransEnd(BOOL onOff);
BIPExport BOOL GetShowBalance();
BIPExport void SetShowBalance(BOOL onOff);
BIPExport BOOL GetSnapToClips();
BIPExport void SetSnapToClips(BOOL onOff);
BIPExport BOOL GetLockTransitions();
BIPExport void SetLockTransitions(BOOL onOff);
BIPExport void SetAnimationRange();
BIPExport void ZoomExtents();
BIPExport void UpdateDisplay();
BIPExport void AddBipedToMixerDisplay(IBipMaster *mc);
BIPExport void RemoveBipedFromMixerDisplay(IBipMaster *mc);
BIPExport void ShowMixer();
BIPExport void HideMixer();
};
// Base Biped Key. For pelvis, spine, neck, tail, pony1, pony2 keys
class IBipedKey : public IKey {
public:
float tens, cont, bias, easeIn, easeOut;
int type;
};
// Biped COM Vertical Key
class IBipedVertKey : public IBipedKey {
public:
float z, dynBlend, ballTens;
};
// Biped COM Horizontal Key
class IBipedHorzKey : public IBipedKey {
public:
float x, y, balFac;
};
// Biped COM Turn Key
class IBipedTurnKey : public IBipedKey {
public:
Quat q;
};
// Biped Body Key for the Arm and Leg Keys. contains ik blend and pivot point info.
// IK spaces
#define BODYSPACE 0
#define WORLDSPACE 1 // Currently not valid
#define OBJECTSPACE 2
class IBipedBodyKey : public IBipedKey {
public:
float ik_blend,
ik_ankle_ten;
int ik_space,
ik_joined_pivot,
ik_pivot_index,
ik_num_pivots;
Point3 ik_pivot_pts[NUMPIVOTS];
};
// Biped Head Key
class IBipedHeadKey : public IBipedKey {
public :
float head_blend;
};
// Biped Prop Key
#define WORLD_PROP 0
#define BODY_PROP 1
#define RHAND_PROP 2
#define LHAND_PROP 3
class IBipedPropKey : public IBipedKey {
public:
int pos_space;
int rot_space;
};
//Biped FootStep Key
#define FS_LSEL (1<<0)
#define FS_RSEL (1<<1)
#define FS_LFT 1
#define FS_RGT 0
class IBipedFSKey : public IKey {
public:
DWORD edgeSel;
BOOL active;
Matrix3 mat;
int side; // LFT, RGT
TimeValue duration;
};
// Multiple footstep params. One will be created to store each gait's paramters (walk, run, jump)
class MultFprintParams {
public:
int numnewfprints;
float aswid;
float pswid;
float aslen;
float pslen;
float ashgt;
int cycle;
float aslen2;
float pslen2;
float ashgt2;
int cycle2;
int AutoTiming;
int InterpTiming;
int Alternate;
int MultiInsertInTime;
MultFprintParams(int gait) {init(gait);}
BIPExport void init(int gait);
};
// returns multiple footsteps parameters for different types of gaits (walk, run, jump)
BIPExport MultFprintParams* GetMultFprintParams(int gait);
// Start Left/Start Right radio buttons in "Create Mutliple Footsteps Dialog"
BIPExport int GetFSAddSide();
BIPExport void SetFSAddSide(int side);
#endif // __BIPEDAPI__

395
lib/maxsdk70/include/CS/IMixer.h Executable file
View File

@ -0,0 +1,395 @@
/**********************************************************************
*<
FILE: IMixer.h
DESCRIPTION: Mixer classes
CREATED BY: Susan Amkraut
HISTORY: created summer 2000
*> Copyright (c) 2000, All Rights Reserved.
**********************************************************************/
/**********************************************************************
UPDATING THE MIXER:
Many of the mixer functions cause changes to the raw mix .
If you call a function or functions which would change the raw mix,
then in order to see biped perform the updated raw mix, you must call:
IMixer::InvalidateRawMix();
If you call a function which changes the arrangement of clips in a
transition track, then to update the display and computation of that
track, you may have to call:
IMXtrack::ComputeTransClips();
It's possible this may have been called for you, depending on what you did.
But if you encounter any incomplete updates, call this.
Most of the mixer SDK works the same way as the mixer user interface.
There are a few exceptions. The user interface does not allow the user to overlap clips.
But some SDK functions make it possible to overlap clips. This is not advisable.
All mixer SDK functions take into account the snap to frames variable
as well as the lock transitions variable, both settable in the SDK.
They do not, however, take into account the snap to clips variable,
both for technical reasons and because this is more of a user interface feature.
************************************************************************/
#ifndef __IMIXER__
#define __IMIXER__
#include "BipExp.h"
#include "keytrack.h"
// track types
#define TRANSTRACK 1
#define LAYERTRACK 2
// transition track levels
#define TOP_ROW 1
#define BOT_ROW 2
// transition focus types
#ifndef FOCUS_AUTO // these are in imoflow.h as well
#define FOCUS_AUTO 0
#define FOCUS_COM 1
#define FOCUS_LFOOT 2
#define FOCUS_RFOOT 3
#define FOCUS_BFEET 4
#endif
// load options
#define RE_SOURCE_CLIP_ONLY 1
#define RE_SOURCE_INSTANCES 2
#define RE_SOURCE_FILEGROUP 3
// Animation Fit Options
#define FIT_ANIM_TO_CLIP 1
#define FIT_CLIP_TO_ANIM 2
#define TRIM_ANIM_TO_CLIP 3
// forward definition
class IMixer;
class IMXclip
{
public:
//**************** timing ***********************
// The original bounds are the time boundaries of the file loaded into the clip.
// These bounds never change unless a new file is loaded into the clip.
virtual void GetOriginalBounds(int *orgstart, int *orgend)=0;
//
// The trimmed bounds are the trimmed boundaries of the clip.
// They are the same as or a subregion of the original bounds.
// These values do not change when you scale a clip.
// These boundaries are visible in the mixer when you are in trim mode.
virtual void GetTrimBounds(int *trimstart, int *trimend)=0;
// This also trims the weight curve and time warp appropriately
// trimstart and trimend must be within the original bounds
virtual void SetClipTrim(int trimstart, int trimend)=0;
//
// The global bounds indicate where the trimmed bounds of the clip are mapped globally.
// The clip's scale is defined by the relationship between the trimmed interval (trimend - trimstart)
// and the global interval (globend - globstart). If those intervals are equal, the clip's scale is 1.
virtual void GetGlobalBounds(int *globstart, int *globend)=0;
// globstart must be less than globend.
// If not, these return false and do nothing. Otherwise these return true.
// Setting these is like pulling one edge of the clip. It actually scales the clip.
// This also scales the weight curve, time warp, and the in/out points appropriately
virtual BOOL SetClipGlobalStart(int globstart)=0;
virtual BOOL SetClipGlobalEnd(int globend)=0;
//
virtual void MoveClip(int timeInc)=0;
//
// These also scale the weight curve, time warp, and the in/out points appropriately
virtual void ScaleClip(float scale)=0;
virtual void SetClipScale(float scale)=0;
//**************** timing conversion ***********************
// The following functions are useful for converting between various time spaces described below:
//
// local: a time between trimstart and trimend, inclusive
//
// scaled local: a time between 0 and the length of the scaled clip, which can be found this way:
// GetGlobalBounds(&g1,&g2); int length = g2 - g1;
//
// global: a global time value
//
virtual float GetClipScale()=0;
virtual int LocalToScaledLocal(int t)=0;
virtual int ScaledLocalToLocal(int t)=0;
virtual int LocalToGlobal(int t)=0;
virtual int GlobalToLocal(int t)=0;
virtual int GlobalToScaledLocal(int t)=0;
virtual int ScaledLocalToGlobal(int t)=0;
virtual int GlobalInpoint()=0;
virtual int GlobalOutpoint()=0;
//**************** transitions ***********************
// Transition information is stored in each clip, whether it is currently a valid clip in a transition track or not.
// A clip stores mostly information for the transition from itself to the next clip.
// It also stores some information for the transition from the previous clip to itself.
//
// Inpoints and outpoints are stored and set in the clip's scaled local time.
//
// Preserve Height is stored inside each track, not inside individual clips.
//
// The best way to manipulate transition values in a transition track is to loop through the clips
// in sequential transition order by using the following IMXtrack functions described in IMXtrack:
// ComputeTransClips()
// NumTransClips()
// GetTransClip(int index)
//
// The inpoint must be greater than the outpoint.
// The inpoint must be less than the scaled local trimmed end.
// If you try to set the inpoint out of bounds, it will not be set and the function will return false.
// Otherwise, the inpoint will be set and the function will return true.
virtual int GetNextTransitionInpoint()=0;
virtual BOOL SetNextTransitionInpoint(int inpt)=0;
//
virtual float GetNextTransitionAngle()=0;
virtual void SetNextTransitionAngle(float angle)=0;
//
// When setting the focus, if the value sent in is acceptable (FOCUS_AUTO, FOCUS_COM, FOCUS_LFOOT, FOCUS_RFOOT)
// then the focus will be set, and the function will return true.
// Otherwise, the focus will not be set, and the function will return false.
virtual int GetNextTransitionFocus()=0; // returns one of the following: FOCUS_AUTO, FOCUS_COM, FOCUS_LFOOT, FOCUS_RFOOT, FOCUS_BFEET
virtual BOOL SetNextTransitionFocus(int focus)=0;
//
virtual BOOL IsNextTransitionRolling()=0;
virtual void SetNextTransitionRolling()=0;
virtual void SetNextTransitionFixed()=0;
//
// Each ease value, and the sum of the ease values, must be between 0.0 and 1.0, inclusive.
// If not, the set function will not set the values and it will return false.
virtual void GetNextTransitionEase(float *easeIn, float *easeOut)=0;
virtual BOOL SetNextTransitionEase(float easeIn, float easeOut)=0;
//
// Inpoints and outpoints are stored and set in the clip's scaled local time.
// The outpoint must be less than the inpoint.
// The outpoint must be greater than the scaled local trimmed start.
// If you try to set an outpoint out of bounds, it will not be set and the function will return false.
// Otherwise, the outpoint will be set and the function will return true.
virtual int GetPrevTransitionOutpoint()=0;
virtual BOOL SetPrevTransitionOutpoint(int outpt)=0;
//
virtual BOOL IsPrevTransitionRolling()=0;
virtual void SetPrevTransitionRolling()=0;
virtual void SetPrevTransitionFixed()=0;
//***************** clip animation file **************************
// Do not change the returned string.
// Copy the string into another string if you need to manipulate it.
virtual TCHAR *GetFilename()=0;
// LoadOption must be one of the following: RE_SOURCE_CLIP_ONLY, RE_SOURCE_INSTANCES, RE_SOURCE_FILEGROUP
// RE_SOURCE_CLIP_ONLY: the file will be loaded into just this single clip
// RE_SOURCE_INSTANCES: the file will be loaded into this clip and all instances of this clip
// RE_SOURCE_FILEGROUP: the file will be loaded into this clip and all instances and adaptations of this clip
virtual BOOL LoadFile(int LoadOption, TCHAR *fname, BOOL ZeroFootHgt)=0;
//***************** weight curve **************************
// The weight curve for a clip is only relevant if the clip is in a layer track
// All time values are in the clip's scaled local time (see note above about the meaning of scaled local time)
virtual int NumWeights()=0;
virtual float GetWeight(int i)=0; // returns weight at index i, if i is out of bounds, returns 0.0
virtual int GetWeightTime(int i)=0; // returns time at index i, if i is out of bounds, returns 0
virtual BOOL DeleteWeight(int i)=0; // returns false if i is out of bounds
virtual BOOL SetWeight(int i, float w)=0; // returns false if i is out of bounds, or weight is not between 0.0 and 1.0
virtual BOOL SetWeightTime(int i, int t)=0; // returns false if i is out of bounds or time is not inbetween prevoius and next time
// If t is at a key in the weight curve, this returns the weight at that key.
// Otherwise, it returns the interpolated weight at time t.
// If there are no weights, this returns 1.0.
virtual float GetWeightAtTime(int t)=0;
// If there is a key at time t on the weight curve, this will reset the weight at that key.
// If not, this will create a new key at time t with weight w.
// Be sure that t is within the scaled local bounds of the clip.
virtual int SetWeightAtTime(int t, float w)=0;
//***************** time warp **************************
// All time values are in the clip's scaled local time (see note above about the meaning of scaled local time)
virtual BOOL IsTimeWarpActive()=0;
virtual BOOL ActivateTimeWarp()=0;
virtual BOOL DeactivateTimeWarp()=0;
// Removes all existing time warps, activates time warp,
// and initializes with one warp at the begining and one at the end of the clip
virtual BOOL InitializeTimeWarp()=0;
virtual int NumTimeWarps()=0;
virtual TimeValue GetTwOrgTime(int i)=0; // returns original time at index i, if i is out of bounds, returns 0
virtual TimeValue GetTwWarpTime(int i)=0;// returns warped time at index i, if i is out of bounds, returns 0
virtual TimeValue GetOrgTimeAtWarpedTime(TimeValue t)=0; // returns what original time has been warped to this time
// if t is out of bounds of the warped time, returns 0
virtual TimeValue GetWarpedTimeAtOrgTime(TimeValue t)=0; // returns what this original time has been warped to
// if t is out of bounds of the original time, returns 0
virtual BOOL DeleteTw(int i)=0; // returns false if i is out of bounds
virtual BOOL SetTwOrgTime(int i, TimeValue t)=0;// returns false if i is out of bounds or t is not inbetween
// the two original times of the warp indices surrounding i
virtual BOOL SetTwWarpTime(int i, TimeValue t)=0;// returns false if i is out of bounds or t is not inbetween
// the two warped times of the warp indices surrounding i
// if t is at an existing warp key's original time value, or t is out of bounds of the clip's scaled local bounds,
// then this returns false. Otherwise it sets a new time warp key, computing the warped time for this key such
// that the flow is continuous
virtual BOOL InsertWarpAtOrgTime(TimeValue t)=0;
};
class IMXtrack
{
public:
virtual int NumClips(int row)=0;
virtual IMXclip *GetClip(int index, int row = BOT_ROW)=0; // For layer tracks, row should always be BOT_ROW
virtual int GetTrackType()=0; // returns LAYERTRACK or TRANSTRACK
virtual void SetTrackType(int toType)=0; // must be set to LAYERTRACK or TRANSTRACK
virtual BOOL GetMute()=0;
virtual BOOL SetMute(BOOL val)=0;
virtual BOOL GetSolo()=0;
virtual BOOL SetSolo(BOOL val)=0;
virtual void GetInterval(Interval& iv)=0; // gets the total time interval of the track, including all clips
virtual void Clear()=0;
// The specified bip file will be loaded into the new clip, and the reservoir, using the ZeroFootHeight parameter.
// For layer tracks, the start of the new clip will be appended interval time from the end of the last clip in the track.
// The interval variable must be >= 0.
// For transition tracks, the interval parameter is ignored. The start of the new clip will be at
// the inpoint of the last clip in the track, and it will be on the opposite row of the last clip.
// It will start later if it collides with another clip. For both layer and transition tracks,
// if there are no clips in the track, the new clip will start at frame 0. This returns false if
// the specified file could not be loaded. Otherwise, it returns true.
virtual BOOL AppendClip(TCHAR *fname, BOOL ZeroFootHeight = true, int interval = 5)=0;
/******************** transition track functions (not for layer tracks) **************************/
// If any of these functions are called for layer tracks, they will return false and do nothing.
// The track must be a transition track.
//
virtual BOOL IsHeightPreservedDuringTransitions()=0;
virtual BOOL SetTransPreserveHeight(BOOL val)=0;
// PreferredTransLength and the search ranges must be positive values. They are in frames.
// If they are negative values, the optimization will not be performed and the function will return false.
// Otherwise, the function will return true/false describing whether or not it was successful.
// If optimization requires clips to be trimmed to avoid visual overlap, then they will be trimmed.
virtual BOOL OptimizeTransitions(int PreferredTransLength, BOOL SearchEntireClip, int SearchRangeBefore, int SearchRangeAfter)=0;
// See notes above.
// The ClipIndex is an index into the tracks's trans clips.
// If the ClipIndex is out of range of the trans clips, the optimization will not be performed and the function will return false.
virtual BOOL OptimizeClipsNextTransition(int PreferredTransLength, BOOL SearchEntireClip, int SearchRangeBefore, int SearchRangeAfter, int ClipIndex)=0;
// The following three functions provide a way of looping through the clips in a transition track in
// sequential order, based on how they transition from one to another, regardless of what row they are in.
// A greyed out clip will not be included in the transclips, since it is not part of the series of transitions.
// If you change ANYTHING in a transition track (clip timiing, transition timing or parameters),
// then you must call ComputeTransClips before looping through the trans clips
virtual void ComputeTransClips()=0;
virtual int NumTransClips()=0;
virtual IMXclip *GetTransClip(int index)=0;
//***************** weight curve **************************
// The weight curve for a track is only relevant if the track is a transition track
virtual int NumWeights()=0;
virtual float GetWeight(int i)=0; // returns weight at index i, if i is out of bounds, returns 0.0
virtual int GetWeightTime(int i)=0; // returns time at index i, if i is out of bounds, returns 0
virtual BOOL DeleteWeight(int i)=0; // returns false if i is out of bounds
virtual BOOL SetWeight(int i, float w)=0; // returns false if i is out of bound, or weight is not between 0.0 and 1.0
virtual BOOL SetWeightTime(int i, int t)=0; // returns false if i is out of bounds or time is not inbetween prevoius and next time
// If t is at a key in the weight curve, this returns the weight at that key.
// Otherwise, it returns the interpolated weight at time t.
// If there are no weights, this returns 1.0.
virtual float GetWeightAtTime(int t)=0;
// If there is a key at time t on the weight curve, this will reset the weight at that key.
// If not, this will create a new key at time t with weight w.
// If this weight curve belongs to a clip, you need to make sure that t is within the
// scaled local bounds of the clip. (see note below about the meaning of scaled local)
virtual int SetWeightAtTime(int t, float w)=0;
};
class IMXtrackgroup
{
public:
virtual int NumTracks()=0;
virtual IMXtrack *GetTrack(int index)=0;
virtual TCHAR *GetName()=0;
virtual BOOL SetName(TCHAR *str)=0;
// the index for the following two filter functions must be one of the follwing track id's defined in track.h:
// KEY_LARM, KEY_RARM, KEY_LHAND, KEY_RHAND, KEY_LLEG, KEY_RLEG, KEY_LFOOT, KEY_RFOOT, KEY_SPINE, KEY_TAIL, KEY_HEAD,
// KEY_PELVIS, KEY_VERTICAL, KEY_HORIZONTAL, KEY_TURN, KEY_NECK, KEY_PONY1, KEY_PONY2, KEY_PROP1, KEY_PROP2, KEY_PROP3,
virtual BOOL GetFilter(int index)=0;
virtual BOOL SetFilter(int index, int val)=0;
virtual void Clear()=0; // removes all clips from the trackgroup
virtual BOOL InsertTrack(int index, int tracktype)=0;
// gets the total time interval of the trackgroup, including all tracks
virtual BOOL DeleteTrack(int index)=0;
virtual void GetInterval(Interval& iv)=0;
};
class IMixer
{
public:
//**************** trackgroups ***********************
virtual int NumTrackgroups()=0;
virtual IMXtrackgroup *GetTrackgroup(int index)=0;
virtual BOOL InsertTrackgroup(int index)=0;
virtual BOOL DeleteTrackgroup(int index)=0;
//**************** mixer ***********************
virtual float GetBalancePropagation()=0; // between 0.0 and 1.0
virtual BOOL SetBalancePropagation(float val)=0;
virtual float GetBalanceLateralRatio()=0; // between 0.0 and 1.0
virtual BOOL SetBalanceLateralRatio(float val)=0;
virtual BOOL GetBalanceMute()=0;
virtual BOOL SetBalanceMute(BOOL val)=0;
virtual BOOL IsPerformingMixdown()=0; // if this returns false, the biped is performing a raw mix
virtual void InvalidateRawMix()=0;
virtual void EffectRawMix()=0;
virtual void EffectMixdown()=0;
// ContinuityRange between 0 and 100, MaxKneeAngle between 0.0 and 180.0
virtual BOOL Mixdown(BOOL KeyPerFrame, BOOL EnforceIkConstraints, int ContinuityRange, BOOL FilterHyperExtLegs, float MaxKneeAngle)=0;
virtual void CopyClipSourceToBiped(IMXclip *iCP)=0;
virtual void CopyMixdownToBiped()=0; // This will only work if a mixdown exists
virtual BOOL LoadMixFile(TCHAR *fname, BOOL redraw)=0;
virtual BOOL SaveMixFile(TCHAR *fname)=0;
// gets the total time interval of the mixer, including all trackgroups and tracks
virtual void GetInterval(Interval& iv)=0;
virtual BOOL ExistingMixdown()=0;
// clear all clips, tracks, and trackgroups - the mixer will be empty
virtual void ClearMixer()=0;
// This group of functions actually applies not to the individual mixer,
// but to the mixer dialog and display. Many of these just get and set
// display preferences.
virtual BOOL GetSnapFrames()=0;
virtual void SetSnapFrames(BOOL onOff)=0;
virtual BOOL GetShowTgRangebars()=0;
virtual void SetShowTgRangebars(BOOL onOff)=0;
virtual BOOL GetShowWgtCurves()=0;
virtual void SetShowWgtCurves(BOOL onOff)=0;
virtual BOOL GetShowTimeWarps()=0;
virtual void SetShowTimeWarps(BOOL onOff)=0;
virtual BOOL GetShowClipBounds()=0;
virtual void SetShowClipBounds(BOOL onOff)=0;
virtual BOOL GetShowGlobal()=0;
virtual void SetShowGlobal(BOOL onOff)=0;
virtual BOOL GetShowClipNames()=0;
virtual void SetShowClipNames(BOOL onOff)=0;
virtual BOOL GetShowClipScale()=0;
virtual void SetShowClipScale(BOOL onOff)=0;
virtual BOOL GetShowTransStart()=0;
virtual void SetShowTransStart(BOOL onOff)=0;
virtual BOOL GetShowTransEnd()=0;
virtual void SetShowTransEnd(BOOL onOff)=0;
virtual BOOL GetShowBalance()=0;
virtual void SetShowBalance(BOOL onOff)=0;
virtual BOOL GetSnapToClips()=0;
virtual void SetSnapToClips(BOOL onOff)=0;
virtual BOOL GetLockTransitions()=0;
virtual void SetLockTransitions(BOOL onOff)=0;
virtual void SetAnimationRange()=0;
virtual void ZoomExtents()=0;
virtual void UpdateDisplay()=0;
virtual void AddToDisplay()=0; // adds this mixer to the mixer dialog
virtual void RemoveFromDisplay()=0; // removes this mixer from the mixer dialog
virtual void ShowMixer()=0; // shows the mixer dialog
virtual void HideMixer()=0; // hides the mixer dialog
};
#endif // __IMIXER__

449
lib/maxsdk70/include/CS/IMoFlow.h Executable file
View File

@ -0,0 +1,449 @@
/*********************************************************************
*<
FILE: bipedapi.h
DESCRIPTION: Biped motion flow interface classes
CREATED BY: Ravi Karra, Michael Zyracki
HISTORY: Created 18 October 1999
*> Copyright (c) 1999-2003 All Rights Reserved.
**********************************************************************/
#ifndef __IMOFLOW__
#define __IMOFLOW__
#include "BipExp.h"
#include "keytrack.h"
/*
Using the Motion Flow classes.
1. You need to make sure you are linking with the biped.lib import library. This is only currently necessary
for linking with these motion flow clases. If you are just using the interface in BipedApi.h,there is no
need to link with this import library.
2. Get the IMoFlow Interface from a corresponding BipMaster.
3. The general MotionFlow class hierarcy.
A. Each Motion Flow consists of a collection of Snippets(stored animation clips) and Scripts(instances
of the Snippets strung together.).
B. Each Snippet Contains an animation (a .bip file), and a collection of Transistions.
C. Each Transistion specifies an one way motion blend from one snippet to another.
D. Each Script in the IMoFlow is a set of animations(snippets), which are contains a list of ScriptItem's.
E. Each ScriptItem contains a pointer back to the Snippet it instances.
NOTE that there is a close correspondence between these SDK classes and functions and the CS motion
flow maxscript implementation, so that may be used as reference for this SDK also.
NOTE That these classes contain internal biped classes. These classes are the actually ones used
internally, they aren't interfaces.
Example of creating a motion flow.
IBipMaster *bipMaster = GetCurrentBipMaster(); //see
POINT graphLocation;
char str[32];
//begin motion flow mode.
bipMaster->BeginModes(BMODE_MOTIONFLOW);
//get the motion flow
IMoFlow *moFlow = bipMaster->GetMoFlow();
//create a walk snippet
sprintf(str,"c:\\Sumo\\walk.bip"); //the file for the snippert
graphLocation.x = 20;
graphLocation.y = 10;
Snippet *walk = moFlow->NewSnippet(str, graphLocation,true,true);
//create a run snippet
sprintf(str,"c:\\Sumo\\run.bip"); //the file for the snippert
graphLocation.x = 50;
graphLocation.y = 10;
Snippet *run = moFlow->NewSnippet(str, graphLocation,true,true);
//create an optimized transistion between the 2 snippets.
walk->AddTransition(run,TRUE);
run->AddTransition(walk,TRUE);
//call this global function to make sure all graphs and moflows are updated.
UpdateMotionFlowGraph();
//create a script and set it to be active
sprintf(str,"SDK Script");
moFlow->AddScript(str,true);
//get the script
Script *script = moFlow->GetActiveScript();
//set the start pos and direction
Point3 startPos(0,0,0);
script->SetStartPos(startPos);
script->SetStartRot(0); //set a 0 heading degree
//create the snipped
script->AddSnippet(run);
moFlow->CurscriptToActiveLinks(); //set the transistions in the script
script->AddSnippet(walk);
moFlow->CurscriptToActiveLinks(); //set the transistions in the script
script->AddSnippet(run);
moFlow->CurscriptToActiveLinks(); //set the transistions in the script
//now compute the animation.
moFlow->ComputeAnimation(TRUE);
//end the motion flow mode
//unify the motion(convert the motion to free form)
bipMaster->UnifyMotion()
bipMaster->EndModes(BMODE_MOTIONFLOW);
return;
*/
// Forward Declarations--note that there are certain classes here (class BipMaster, class animal, etc..)
// which are internal classes.
class Snippet;
class MoFlow;
//Internal classes
class BipMaster;
class Transition;
class MFL_IOProcessor;
class animal;
class Layer;
class path_properties;
class crowd_script;
//string length defines
#define MAXNAME 280
#define MAXSCRIPTNAME 64
#define MAXTRANNOTE 256
// transition focus types
#define FOCUS_AUTO 0
#define FOCUS_COM 1
#define FOCUS_LFOOT 2
#define FOCUS_RFOOT 3
#define FOCUS_BFEET 4
//The Transistion Info. Each transistion contains an array of traninfos.
class TranInfo {
public:
//data
int start1,start2,length; //source and dest start, and length
int rolling1,rolling2,randpct;
int transFocus;
float angle,easein,easeout,cost;
float flow_angle;
path_properties prop;
TCHAR note[MAXTRANNOTE];
BIPExport TranInfo();
BIPExport TranInfo& operator=(const TranInfo& TI);
BIPExport int operator==(const TranInfo& TI);
//internal I/O functions
void Output(MFL_IOProcessor *IOProc);
void Input(MFL_IOProcessor *IOProc);
inline int GetSourceStart() const { return start1; }
inline void SetSourceStart(int s) { start1 = s; }
inline int GetDestStart() const { return start2; }
inline void SetDestStart(int s) { start2 = s; }
inline int GetSourceState() const { return rolling1; }
inline void SetSourceState(int s) { rolling1 = s; }
inline int GetDestState() const { return rolling2; }
inline void SetDestState(int s) { rolling2 = s; }
inline int GetLength() const { return length; }
inline void SetLength(int l) { length = l; }
inline float GetAngle() const { return angle; }
inline void SetAngle(float a) { angle = a; }
inline int GetRandPercent() const { return randpct; }
inline void SetRandPercent(float r) { randpct = r; }
inline float GetCost() const { return cost; }
inline void SetCost(float c) { cost = c; }
inline float GetEaseIn() const { return easein; }
inline void SetEaseIn(float in) { easein = in; }
inline float GetEaseOut() const { return easeout; }
inline void SetEaseOut(float out) { easeout = out; }
inline int GetTransFocus() const { return transFocus; }
inline void SetTransFocus(int t) { transFocus = t; }
inline const TCHAR* GetNote() const { return note; }
inline void SetNote(const TCHAR* n) { _tcscpy(note, n); }
};
class Transition {
public:
Snippet *from;
Snippet *to;
int active;
int selected;
int start1,start2,length;
int rolling1,rolling2;
float easein,easeout;
float angle;
float flow_angle;
int transFocus;
path_properties prop;
int randpct;
float cost;
int index;
int nTransInfo;
int maxTransInfo;
TranInfo *TranList;
TCHAR note[MAXTRANNOTE];
HWND hwnd;
BIPExport Transition();
BIPExport ~Transition();
BIPExport Transition& operator=(const Transition& T);
BIPExport void SetTranListSize(int NUM);
BIPExport void InfoToTransition(int i);
BIPExport void TransitionToInfo(int i);
BIPExport int NewTranInfo(); // returns the index of the inserted item
BIPExport void ShiftTranInfo(int TIindex, int storecurrent);
BIPExport void DeleteTranInfo(int TIindex);
void Output(MFL_IOProcessor *IOProc);
void Input(MFL_IOProcessor *IOProc);
inline int GetRandPercent() const { return randpct; }
inline void SetRandPercent(float r) { randpct = r; }
inline float GetCost() const { return cost; }
inline void SetCost(float c) { cost = c; }
inline int GetTranListSize() const { return nTransInfo; }
inline Snippet* GetFromSnippet() const { return from; }
inline void SetFromSnippet(Snippet* s) { from = s; }
inline Snippet* GetToSnippet() const { return to; }
inline void SetToSnippet(Snippet* s){ to = s; }
inline BOOL GetActive() const { return active; }
inline void SetActive(BOOL act) { active = act; }
inline BOOL GetSelected() const { return selected; }
inline void SetSelected(BOOL sel) { selected = sel; }
inline TranInfo GetTranInfo(int TIindex) const
{ assert (TIindex < nTransInfo); return TranList[TIindex]; }
inline void SetTranInfo(int TIindex, TranInfo ti) {
assert (TIindex < nTransInfo);
TranList[TIindex] = ti;
if (index == TIindex ) InfoToTransition(index);
}
BIPExport void UpdateUI(bool redraw=false);
};
class Script;
class Snippet {
public:
int visited; //used for depth first tranversal
float distance_to_stop;
float distance_to_loop;
int start;
int end;
TCHAR sname[MAXNAME];
TCHAR fname[MAXNAME];
int posx;
int posy;
int width;
int nTrans;
int curtime; // set anytime you compute A for a particular frame (necessary for looping)
int active;
int validload; // currently loaded file, although possibly inactive, is still valid (or not)
BOOL randstart; // can this snippet start a random traversal script
int randstartpct; // percentage of time this snippet starts a random traversal script
Transition *Transitions;
HWND hwnd;
int orgposx; // for interaction - post-fido
int orgposy; // for interaction - post-fido
public:
Snippet *next;
animal *A;
BIPExport Snippet();
BIPExport ~Snippet();
BIPExport void ClearActiveTransitions();
BIPExport void ClearSelectedTransitions();
BIPExport int ActivateTransitionTo(Snippet *toSN);
BIPExport Transition *GetTransitionTo(Snippet *toSN);
BIPExport int GetTransitionIndex(Transition *theTR);
BIPExport float AddTransition(Snippet *child, int optimize); // returns the floating point cost
BIPExport float ComputeTransitionPoints(Transition *nTR, Snippet *Src , Snippet *Dest, int preference, int optimize);
BIPExport float ComputeOptimalTransitionPoints(BOOL SearchAll,int PrefTranLen,int SearchBefore, int SearchAfter, Transition *nTR, Snippet *Src , Snippet *Dst);
BIPExport void RecomputeTransitions();// recompute existing transitions from this new snippet
BIPExport int DeleteTransitionsTo(Snippet *child);
BIPExport int DeleteTransition(int index);
BIPExport void DeleteSelectedTransitions(MoFlow *MF);
BIPExport int IsChild(Snippet *Child);
void Paint(HDC hdc, int selected, int startnode, int editnode, int transhow);
void PaintTransitions(HDC hdc, BOOL transhow);
void ComputeWidth(HDC hdc, BOOL transhow);
int Inside(POINT &mp, float *dist);
BIPExport void UpdateUI();
BIPExport Snippet& operator=(const Snippet& SN);
Transition* TranHitTest(POINT &mp);
void TranRegionSelect(POINT &min, POINT &max, int set, int active);
void Output(MFL_IOProcessor *IOProc);
void Input(MFL_IOProcessor *IOProc);
BIPExport int LoadFile(bool UpdateTheUI = true, int ErrorType = 3); // 3 => shows errors in dialog box
Snippet *GetNextRandScriptSnippet(int *transindex);
///MG added for new MF based forward simulatiom
Snippet * NextRealTime(BipMaster *mc, Script *scr, animal *A, int frame, path_properties *desired_properties, int global_frame, int global_last_clip_start, int currentScript_index, int *transindex, int *found);
inline int GetStart() const { return start; }
inline void SetStart(int s) { start = s; }
inline int GetEnd() const { return end; }
inline void SetEnd(int e) { end = e; }
inline const TCHAR* GetClipName() const { return sname; }
inline void SetClipName(const TCHAR* n) { _tcscpy(sname, n); }
inline const TCHAR* GetFileName() const { return fname; }
inline void SetFileName(const TCHAR* n) { _tcscpy(fname, n); }
inline virtual IPoint2 GetPosition() const { return IPoint2(posx, posy); }
inline virtual void SetPosition(IPoint2 p){ posx = p.x; posy = p.y; }
inline BOOL GetActive() const { return active; }
inline void SetActive(BOOL act) { active = act; }
inline BOOL GetRandStart() const { return randstart; }
inline void SetRandStart(BOOL rs) { randstart = rs; }
inline BOOL GetRandStartPercent() const { return randstartpct; }
inline void SetRandStartPercent(int rsp){ randstartpct = rsp; }
inline int NumTransitions() { return nTrans; }
inline Transition* GetTransition(int Tindex) const
{ assert (Tindex < nTrans); return &Transitions[Tindex]; }
inline void SetTransition(int Tindex, Transition* ti)
{ assert (Tindex < nTrans); Transitions[Tindex] = *ti; }
};
class ScriptItem {
public:
Snippet *snip;
int transindex;
vector flow_pos;
vector2D flow_pivot;
float flow_yaw;
int glob_snipstart;
TCHAR *tempSnipName; // for global moflow i/o
//MG added for CS4
int foothold_frame[2];
int footlift_frame[2];
inline Snippet* GetSnippet() { return snip; }
inline void SetSnippet(Snippet* s) { snip = s; }
inline int GetTransIndex() const { return transindex; }
inline void SetTransIndex(int i) { transindex = i; }
inline vector GetFlowPos() const { return flow_pos; }
inline void SetFlowPos(vector p) { flow_pos = p; }
inline vector2D GetFlowPivot() const { return flow_pivot; }
inline void SetFlowPivot(vector2D p){ flow_pivot = p; }
inline float GetFlowYaw() const { return flow_yaw; }
inline void SetFlowYaw(float y) { flow_yaw = y; }
inline int GetSnipStart() const { return glob_snipstart; }
inline void SetSnipStart(int s) { glob_snipstart = s; }
BIPExport ScriptItem();
BIPExport ScriptItem& operator=(const ScriptItem& SI);
};
class Script {
public:
TCHAR name[MAXSCRIPTNAME];
Point3 startpos;
float startrot;
int startframe;
int nitems;
int maxitems;
ScriptItem *items;
int nlayers;
Layer *layers;
Layer *EditLayer;
Script *next;
BIPExport Script();
BIPExport ~Script();
BIPExport Script& operator=(const Script& P);
BIPExport int AddSnippet(Snippet *SN);
BIPExport int InsertSnippet(int index, Snippet *SN);
BIPExport int DeleteSnippet(int index);
BIPExport int Get_Backtrackframe(); //mg
BIPExport int GetScriptItemIndex(ScriptItem *SI);
BIPExport int InsertScriptItem(int index, ScriptItem *SI);
BIPExport int GetLastTransitionIndex(); //MG m28
Transition *GetLastTransition(); //S43
inline int NumScriptItems() { return nitems; }
inline ScriptItem* GetScriptItem(int ind)
{ assert (ind < nitems); return &items[ind]; }
BIPExport int IncludesSnippet(Snippet *SN);
BIPExport int IncludesTransition(Transition *TR);
void Output(MFL_IOProcessor *IOProc);
void Input(MFL_IOProcessor *IOProc, MoFlow *MF);
inline int GetStartFrame() { return startframe; }
inline void SetStartFrame(int f) { startframe = f; }
BIPExport void Set_crowd_script(crowd_script *CS);
inline Point3 GetStartPos() { return startpos; }
inline void SetStartPos(Point3 p) { startpos = p;}
inline float GetStartRot() { return startrot; }
inline void SetStartRot(float r) { startrot = r;}
inline const TCHAR* GetName() const { return name; }
inline void SetName(const TCHAR* n) { _tcscpy(name, n); }
// The following functions are obsolete
inline int NumLayers() { return nlayers; }
inline Layer *GetEditLayer() { return EditLayer; }
BIPExport Layer *GetLayer(int index);
BIPExport int AddLayer(Script *SCR, TimeValue t);
BIPExport void DeleteLayer(Layer *delLY);
BIPExport void SortLayer(Layer *SORTLY);
BIPExport int GetLayerIndex(Layer *LYR);
BIPExport int InsertLayer(Layer *newLY);
BIPExport void CloneLayer(Layer *orgLY,TimeValue t);
BIPExport void DeleteAllLayers();
};
class IBipMaster;
class IMoFlow
{
public:
virtual int NumScripts() const=0;
virtual int NumSelected() const=0;
virtual Script* GetScript(int index)=0;
virtual Script* GetActiveScript()=0;
virtual void SetActiveScript(Script* scr)=0;
virtual int GetScriptIndex(Script *theSCR) const=0;
virtual int AddScript(TCHAR *newscriptname, bool activate=true)=0;
virtual void DeleteScript(Script *delSCR)=0;
virtual void DeleteScript(int ind)=0;
virtual void DeleteAllScripts()=0;
virtual int NumSnippets() const=0;
virtual const BitArray& GetSelected() const=0;
virtual void SetSelected(const BitArray& sel)=0;
virtual Snippet* GetSnip(int index)=0;
virtual Snippet* GetSnip(TCHAR *str)=0;
virtual int GetIndex(Snippet *theSN) const=0;
virtual int LoadSnippetFiles(bool UpdateTheUI = true, int ErrorType = 3, bool UpdateSNLengths=false)=0;
virtual int GetActiveStartFrame() const=0;
virtual int GetActiveEndFrame() const=0;
virtual int Save(TCHAR *fname)=0;
virtual int Load(TCHAR *fname, bool Append=false, bool UpdateTheUI = true, int ErrorType = 3)=0;
virtual IBipMaster* GetMaster()=0;
virtual void ComputeAnimation(int redraw, int globalsToo = FALSE)=0; //main function that computes the moflow
//NOTE if you add a snippet to the script this function must be called to make sure that
//the transistion are all active!
virtual void CurscriptToActiveLinks() = 0;
// Adds a new snippet(clip) to the motion flow network, if load==true it's immediately loaded(if not need to call LoadSnipetFiles,
//if redraw is true then the moflow graph is redraw
virtual Snippet* NewSnippet(TCHAR *fname, POINT &mp, bool load=false, bool redraw=false)=0;
virtual void DeleteSnip(Snippet *DelSnip)=0;
virtual void RedrawGraphWnd()=0; // update just motion flow editor
virtual void UpdateUI()=0; // updates the motionflow script dialog and motion flow editor
virtual void HoldTrack(int HoldAnimals, BOOL HoldScriptOffsetOnly = false)=0; // HoldAll, holds all biped limbs.use to hold the biped.
};
BIPExport void UpdateMotionFlowGraph(); // updates the motionflow graph should be called after mf functions
// that manipulate transistions
#endif // __IMOFLOW__

View File

@ -0,0 +1,200 @@
#ifndef KEYTRACK_H
#define KEYTRACK_H
#include "BipExp.h"
#include "Tracks.h"
#define BIPSLAVE_CONTROL_CLASS_ID Class_ID(0x9154,0)
// this is the class for the center of mass, biped root controller ("Bip01")
#define BIPBODY_CONTROL_CLASS_ID Class_ID(0x9156,0)
// this is the class for the biped footstep controller ("Bip01 Footsteps")
#define FOOTPRINT_CLASS_ID Class_ID(0x3011,0)
#define SKELOBJ_CLASS_ID Class_ID(0x9125, 0)
#define BIPED_CLASS_ID Class_ID(0x9155, 0)
class vector {public: float x,y,z,w;
vector(){x=0.0;y=0.0;z=0.0;w=1.0;}; //constructors
vector(float X, float Y, float Z) { x = X; y = Y; z = Z; w= 1.0; };
vector (float xx, float yy, float zz, float ww) : x(xx), y(yy), z(zz), w(ww) { }
vector(Point4 p) : x(p.x), y(p.y), z(p.z), w(p.w) { }
// Binary operators
inline vector operator-(const vector&) const;
inline vector operator+(const vector&) const;
};
inline vector vector::operator-(const vector& b) const {
return(vector(x-b.x,y-b.y,z-b.z));
}
inline vector vector::operator+(const vector& b) const {
return(vector(x+b.x,y+b.y,z+b.z));
}
inline vector operator*(float f, const vector& a) {
return(vector(a.x*f, a.y*f, a.z*f, a.w)); //MG was a.w*f
}
inline Point4 VtoP4(const vector& v) { return Point4(v.x, v.y, v.z, v.w); }
//typedef struct {float x,z;} vector2D;
//typedef Point4 vector;
typedef Point3 vector2D;
class path_property
{
public:
float val;
int time;
float distance;
path_property(){
val = 0.0;
time = 0;
distance = 0;
}
};
class path_properties
{
public:
float turn_angle;
float line_distance;
float path_distance;
float average_speed;
float speed_change;
vector direction;
path_property min_speed;
path_property max_speed;
path_property stop;
path_properties(){
turn_angle = 0.0;
line_distance = 0.0;
path_distance = 0.0;
average_speed = 0.0;
speed_change = 1.0;
min_speed.val = 1000000.0;
}
path_properties& operator=(const path_properties& T);
};
class fingPos
{
public:
float jnt[MAXFINGERLINKS];
float quat[4];
float Worldquat[4];
fingPos(){
quat[0] = 0.0;
quat[1] = 0.0;
quat[2] = 0.0;
quat[3] = 1.0;
Worldquat[0] = 0.0;
Worldquat[1] = 0.0;
Worldquat[2] = 0.0;
Worldquat[3] = 1.0;
jnt[0] = 0.0;
jnt[1] = 0.0;
jnt[2] = 0.0;
}
} ;
class handPos
{
public:
float yaw,pitch,roll;
float quat[4];
//NEW FOR TBC control
//float src_quat[4];
//float des_quat[4];
float inc_quat[4];
float Worldquat[4];
fingPos fingerPos[MAXFINGERS];
handPos()
{
yaw = 0.0;
pitch = 0.0;
roll = 0.0;
quat[0] = 0.0;
quat[1] = 0.0;
quat[2] = 0.0;
quat[3] = 1.0;
inc_quat[0] = 0.0;
inc_quat[1] = 0.0;
inc_quat[2] = 0.0;
inc_quat[3] = 1.0;
Worldquat[0] = 0.0;
Worldquat[1] = 0.0;
Worldquat[2] = 0.0;
Worldquat[3] = 1.0;
}
} ;
class limbPos
{
public:
float jnt[MAXLEGJNTS]; // was MAXLINKS
vector pos;
vector Worldpos;
vector Pathpos;
vector rot;
float knee_rotation;
int gaitState;
int state;
float quat[4];
float clav_jnt[2];
float ikblend;
float ikankleten;
int ikworld;
int ik_link_index;
int ik_toe_index;
int ik_heel_index;
int ik_use_toes;
int ik_joined_pivot;
vector ik_pivot_pnt;
vector ik_moved_pivot_pnt;
handPos hand_pos;
limbPos(){
jnt[0] = 0.0f;
jnt[1] = 0.0f;
jnt[2] = 0.0f;
jnt[3] = 0.0f;
knee_rotation = 0.0f;
gaitState = 0;
state = 0;
quat[0] = 0.0f;
quat[1] = 0.0f;
quat[2] = 0.0f;
quat[3] = 1.0f;
clav_jnt[0] = -0.12f;
clav_jnt[1] = 0.0f;
ikblend = 0.0f;
ikankleten = 0.0f;
ikworld = 0;
ik_link_index = 0;
ik_toe_index = 0;
ik_heel_index = 5;
ik_use_toes = false;
ik_joined_pivot = false;
};
};
#endif

View File

@ -0,0 +1,93 @@
/******************************************************************************
*<
FILE: ourexp.h
DESCRIPTION: Export Interface Functionality for Biped
This is used internally inside CS plugins
It is not for use by non-CS developers, since it contains all sorts of internal function calls
Other developers should use bipexp.h
CREATED BY: Susan Amkraut
HISTORY: created February 2001
*> Copyright (c) Unreal Pictures, Inc. 1997, 2001 All Rights Reserved.
*******************************************************************************/
#ifndef OUREXP_H
#define OUREXP_H
#include "bipexp.h" // included to avoid double definitions
// This is the interface ID for a Biped Controller Interface
#define I_OURINTERFACE 0x00100111
// IOurBipExport: This class can be returned by calling the method GetInterface() from a Biped controller
// Given controller *c points to a Biped controller, then:
// IOurBipExport *BipIface = (IOurBipExport *) (c->GetInterface(I_OURINTERFACE));
// will return the interface for this Biped Controller, else returns NULL.
class IOurBipExport
{
public:
BIPExport virtual ~IOurBipExport() {}
// For the BipedExport you got from the center of mass (root) controller, send in:
// VERTICAL_SUBANIM, HORIZONTAL_SUBANIM, and ROTATION_SUBANIM
// to get information for those tracks.
// For other BipedExports this method is irrelevant.
// The SetSubAnim method is actually included for future releases,
// when more methods will be added to the IOurBipExport class.
// Then you could call these methods for the three center of mass subanims.
// It is not presently useful.
BIPExport virtual void SetSubAnim (int i) {};
// call this from any IOurBipExport instance to remove or restore non uniform scaling
BIPExport virtual void RemoveNonUniformScale(BOOL onOFF) {};
// call these to begin and end figure mode
BIPExport virtual void BeginFigureMode(int redraw) {};
BIPExport virtual void EndFigureMode(int redraw) {};
BIPExport virtual ScaleValue GetBipedScale(TimeValue t, INode *node){ return ScaleValue(); }
BIPExport virtual Point3 GetBipedPosition(TimeValue t, INode *node){ return Point3(); }
BIPExport virtual Quat GetBipedRotation(TimeValue t, INode *node){ return Quat(); }
BIPExport virtual void SetBipedScale(const ScaleValue &scale, TimeValue t, INode *node){}
BIPExport virtual void SetBipedPosition(const Point3 &p, TimeValue t, INode *node){}
BIPExport virtual void SetBipedRotation(const Quat &q, TimeValue t, INode *node, int global_reference){}
BIPExport virtual void ScaleBiped(const float scale) {};
BIPExport virtual float GetHeight() {return 1.0;}
BIPExport virtual void GetVelocity(int frame, Point3 *vel) {};
BIPExport virtual void GetProjectedVel(int frame, Point3 *vel) {};
BIPExport virtual void SendDesiredProperties(int frame, Point3 *pos, Point3 *vel, Point3 *goal, int goal_exists, int stop_needed, int stop_time, float stop_distance, float speed_change){};
BIPExport virtual void GetRedirectedVel(int frame, Point3 *desiredVel, Point3 *vel, Point3 *biped_skel_dir, int after_avoid_pass_flag, int avoid_needed) {};
BIPExport virtual void SetAfterAvoidVel(int frame, Point3 *vel, Point3 *bip_vel_before_avoid, Point3 *bip_vel_after_avoid){};
BIPExport virtual void EndFlow(int end_frame){};
BIPExport virtual void InitializeFlow( Point3 *pos, Point3 *vel, float *max_speed, int start_frame, int use_random_start){};
//BIPExport virtual void InitiateBackTrack(int start_frame, int last_frame){};
BIPExport virtual void FinishBacktrack(){};
BIPExport virtual void StartBacktrack(){};
BIPExport virtual void FinishRetrace(){};
BIPExport virtual void StartRetrace(){};
BIPExport virtual void ClearPathsAhead(){};
//BIPExport virtual void SendBackTrackingState(int backtrack){};
BIPExport virtual void GetBackTrackingFrame( int *backtrack_frame, int last_frame){};
//BIPExport virtual void NumPossibleTransitions(int *num_transitions){};
//BIPExport virtual void NumBlockedTransitions(int *num_transitions){};
BIPExport virtual void GetPosition(int frame, Point3 *pos) {};
BIPExport virtual void SetFlowHeight(int frame, float height) {};
BIPExport virtual BOOL IsReadyForCrowdComputation(int starttype) {return FALSE;};
BIPExport virtual void SetStartFrame(int startframe) {};
BIPExport virtual void InitializeMoflowAnalysis() {};
BIPExport virtual void SetDetourAngle(float angle) {};
// make authorization available in one place to all dlls
BIPExport virtual int BipAuthorize(HWND hwndParent) {return FALSE;};
BIPExport virtual int BipIsAuthorized() {return FALSE;};
BIPExport virtual void BipAuthorizedFromOutside() {};
};
#endif

482
lib/maxsdk70/include/CS/Phyexp.h Executable file
View File

@ -0,0 +1,482 @@
/******************************************************************************
*<
FILE: PhyExp.h
DESCRIPTION: Export Interface Functionality for Physique
CREATED BY: John Chadwick with a lot of help from Jurie Horneman
HISTORY: created July 10, 1997, modified for Version 2.0 March 5, 1998
*> Copyright (c) Unreal Pictures, Inc. 1997, 1998 All Rights Reserved.
*******************************************************************************/
// This header file is included in CS3.2.
// Plugins compiled with this header are incompatible with CS3.0, CS3.01, CS3.1, and CS3.1.1
#ifndef PHYEXP_H
#define PHYEXP_H
#ifdef BLD_PHYSIQUE
#define PHYExport __declspec( dllexport )
#else
#define PHYExport __declspec( dllimport )
#endif
#include "max.h"
#include "modstack.h"
// this is the interface ID for a Physique Modifier Interface
#define I_PHYINTERFACE 0x00100100
#define I_PHYEXPORT 0x00100100
#define I_PHYIMPORT 0x00100101
//return values for GetInitNodeTM
#define MATRIX_RETURNED 0
#define NODE_NOT_FOUND 1
#define NO_MATRIX_SAVED 2
#define INVALID_MOD_POINTER 3
// version control
#define CURRENT_VERSION 313
// these are the Class ID defines for Physique Modifier:
// Physique Class_ID = ClassID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B);
#define PHYSIQUE_CLASS_ID_A 0x00100
#define PHYSIQUE_CLASS_ID_B 0x00000
#define RIGID_TYPE 1
#define DEFORMABLE_TYPE 2
#define BLENDED_TYPE 4
#define FLOATING_TYPE 8
#define RIGID_NON_BLENDED_TYPE (RIGID_TYPE)
#define DEFORMABLE_NON_BLENDED_TYPE (DEFORMABLE_TYPE)
#define RIGID_BLENDED_TYPE (RIGID_TYPE | BLENDED_TYPE)
#define DEFORMABLE_BLENDED_TYPE (DEFORMABLE_TYPE | BLENDED_TYPE)
// NOTE: for Character Studio 2.1 Deformable Offset Vertices and Vertex Assignment
// Import has been added. These classes and descriptions follow the standard Rigid
// Export functionality at the end of this file.
// Using the Physique Export Interface:
//
// 1. Find the Physique Modifier you which to export rigid vertex assignments from.
// (there is a comment at the bottom of this file giving an example of this)
//
// 2. Given Physique Modifier Modifier *phyMod get the Physique Export Interface:
// IPhysiqueExport *phyExport = (IPhysqiueExport *)phyMod->GetInterface(I_PHYINTERFACE);
//
// 3. For a given Object's INode get this ModContext Interface from the Physique Export Interface:
// IPhyContextExport *contextExport = (IPhyContextExport *)phyExport->GetContextInterface(INode* nodePtr);
//
// 4. For each vertex of the Object get the Vertex Interface from the ModContext Export Interface:
// IPhyVertexExport *vtxExport = (IPhyVertexExport *)contextExport->GetVertexInterface(int i);
// NOTE: only Rigid Vertices are currently supported: (see ConvertToRigid(TRUE) to make all vertices rigid)
// IPhyRigidVertex *rigidExport = (IPhyRigidVertex *)contextExport->GetVertexInterface(int i);
//
// 5. Get the INode for each Rigid Vertex Interface:
// INode *nodePtr = rigidExport->GetNode();
//
// 6. Get the Point3 Offset Vector in INode coordinates for each Rigid Vertex Interface:
// Point3 offsetVector = rigidExport->GetOffsetVector();
// IPhyVertexExport: this is the base class for Vertex Export Interface
// NOTE: currently only RIGID_TYPE vertices are supported (IPhyRigidVertex)
// When a vertex is not assigned Rigid in Physique, the VertexInterface will be NULL
// Unless you call IPhyContextExport->ConvertToRigid(TRUE) (see IPhyContextExport below)
// With ConvertToRigid(TRUE) you will always get a IPhyRigidVertex
// from IPhyContextExport->GetVertexInterface(i)
class IPhyFloatingVertex;
class IPhyVertexExport
{
public:
PHYExport virtual ~IPhyVertexExport() {}
// NOTE: currently only type RIGID_TYPE | RIGID_BLENDED_TYPE are supported
PHYExport virtual int GetVertexType() = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhyRigidVertex : public IPhyVertexExport
{
public:
PHYExport virtual ~IPhyRigidVertex() {}
// GetNode() will return the INode pointer of the link of the given VertexInterface
PHYExport virtual INode *GetNode() = 0;
// GetOffsetVector() will return the coordinates of the vertex
// in the local coordinates of associated INode pointer from GetNode
// this is NOT THE SAME as the .vph file coordinates. (It is simpler)
// the world coordinates of the vertex have been transformed by the Inverse of the INode pointer.
PHYExport virtual Point3 GetOffsetVector() = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhyBlendedRigidVertex : public IPhyVertexExport
{
public:
PHYExport virtual ~IPhyBlendedRigidVertex() {}
// GetNumberNodes() returns the number of nodes assigned to the given VertexInterface
PHYExport virtual int GetNumberNodes() = 0;
// GetNode(i) will return the i'th INode pointer of the link of the given VertexInterface
PHYExport virtual INode *GetNode(int i) = 0;
// GetOffsetVector(i) will return the coordinates of the vertex
// in the local coordinates of associated i'th INode pointer from GetNode(i)
// this is NOT THE SAME as the .vph file coordinates. (It is simpler)
// the world coordinates of the vertex have been transformed by the Inverse of the INode pointer.
PHYExport virtual Point3 GetOffsetVector(int i) = 0;
// GetWeight(i) will return the weight of the vertex associated with the i'th Node
// pointer from GetNode(i)
PHYExport virtual float GetWeight(int i) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
// IPhyContextExport: This class can be returned by :
// passing the INode pointer of an Object with the given Physique Modifier's IPhysiqueExport::GetContextInterface(node)
// If this Node does contain the Physique Modifier associated with this interface an interface to this object's
// interface is returned (several object's may share the same physique modifier), else returns NULL.
class IPhyContextExport
{
public:
PHYExport virtual ~IPhyContextExport() {}
// this returns the number of vertices for the given modContext's Object
PHYExport virtual int GetNumberVertices() = 0;
// If ConvertToRigid is set to TRUE, all GetVertexInterface calls will be IPhyRigidVertex OR IPhyBlendedRigidVertex.
// Vertices which are not Rigid in Physique will be converted to Rigid for the VertexInterface.
// When ConvertToRigid is set to FALSE, GetVertexInterface for non-Rigid vertices currently returns NULL.
// By default, if you do not call ConvertToRigid, it is set to FALSE.
PHYExport virtual void ConvertToRigid(BOOL flag = TRUE) = 0;
// If AllowBlending is set to FALSE then GetVertexInterface will return a non-blended subclass.
// Currently the only valid VertexInterface subclasses are IPhyRigidVertex, and IPhyBlendedRigidVertex.
// When AllowBlending is FALSE, either IPhyRigidVertex or NULL will be returned.
// If ConvertToRigid is TRUE and AllowBlending is FALSE, all vertices will return
// IPhyRigidVertex. By default AllowBlending is set to TRUE.
PHYExport virtual void AllowBlending(BOOL flag = TRUE) = 0;
// GetVertexInterface return's a VertexInterface (IPhyVertexExport *) for the i'th vertex.
// If ConvertToRigid has been set to TRUE, then all VertexInterfaces will return IPhyRigidVertex OR IPhyBlendedRigidVertex.
// When ConvertToRigid has been set to FALSE, non-Rigid vertices will return NULL (CURRENTLY).
PHYExport virtual IPhyVertexExport *GetVertexInterface(int i) = 0;
// You must call ReleaseVertexInterface to delete the VertexInterface when finished with it.
PHYExport virtual void ReleaseVertexInterface(IPhyVertexExport *vertexExport) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
PHYExport virtual IPhyFloatingVertex *GetFloatingVertexInterface(int i) = 0;
};
// IPhysiqueExport: This class can be returned by calling the method GetInterface() for a Physique Modifier
// given Modifier *mod points to a Physique Modifier, then:
// IPhysiqueExport *phyInterface = (IPhysiqueExport *)( mod->GetInterface(I_PHYINTERFACE) );
// will return the interface for this Physique Modifier, else returns NULL.
class IPhysiqueExport
{
public:
PHYExport virtual ~IPhysiqueExport() {}
//GetContextInterface will return a pointer to IPhyContextExport Interface for a given INode.
// Ff the given INode does not contain the Physique Modifier of this IPhysique Export then NULL is returned.
PHYExport virtual IPhyContextExport *GetContextInterface(INode* nodePtr) = 0;
// You must call ReleaseContextInterface to delete the COntextInterface when finished with it.
PHYExport virtual void ReleaseContextInterface(IPhyContextExport *contextExport) = 0;
PHYExport virtual int GetInitNodeTM(INode *node, Matrix3 &initNodeTM) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
PHYExport virtual int Version(void) = 0;
PHYExport virtual void SetInitialPose(bool set) = 0;
};
// example code to find if a given node contains a Physique Modifier
// DerivedObjectPtr requires you include "modstack.h" from the MAX SDK
/*
Modifier* FindPhysiqueModifier (INode* nodePtr)
{
Object* ObjectPtr = nodePtr->GetObjectRef();
if (!ObjectPtr ) return NULL;
while (ObjectPtr->SuperClassID() == GEN_DERIVOB_CLASS_ID && ObjectPtr)
{
// Yes -> Cast.
IDerivedObject* DerivedObjectPtr = (IDerivedObject *)(ObjectPtr);
// Iterate over all entries of the modifier stack.
int ModStackIndex = 0;
while (ModStackIndex < DerivedObjectPtr->NumModifiers())
{
// Get current modifier.
Modifier* ModifierPtr = DerivedObjectPtr->GetModifier(ModStackIndex);
// Is this Physique ?
if (ModifierPtr->ClassID() == Class_ID(PHYSIQUE_CLASS_ID_A, PHYSIQUE_CLASS_ID_B))
{
// is this the correct Physique Modifier based on index?
SkinMod *phyMod = (SkinMod *)ModifierPtr;
if (phyMod == mod)
{
ModContext *mc = DerivedObjectPtr->GetModContext(ModStackIndex);
}
}
ModStackIndex++;
}
ObjectPtr = DerivedObjectPtr->GetObjRef();
}
// Not found.
return NULL;
}
*/
// Deformable Vertex Export via Offset Vectors
//
// Character Studio 2.1 allows users to export Deformable Vertices
// as time frame offsets from a rigid node offset
// The Rigid Offset Vector is identical to the Rigid Vertex Offset Vector.
// This represents the vertex in local coordinates from the attached node.
// Note that since the deformable offset is relative to a single node,
// Blending between links is handled internal to Physique in determining
// this offset, so that the export is a single offset for a given time
// for a single Node.
// Basically, you export a deformable offset from a single node, while
// Physique uses blending between several deformable links to determine
// this offset.
// NOTE: while the Rigid Vertex and Rigid Blended Vertex Export require
// a one time export for replicating the deformabion internal to the game engine,
// the Deformable Offset Vertex Export requires the export of DeformVertexOffset(t)
// at several (or every) frame.
class IPhyDeformableOffsetVertex : public IPhyVertexExport
{
public:
PHYExport virtual ~IPhyDeformableOffsetVertex() {}
// GetNode() will return the INode pointer of the link of the given VertexInterface
PHYExport virtual INode *GetNode() = 0;
// GetOffsetVector() will return the coordinates of the undeformed vertex
// in the local coordinates of associated INode pointer from GetNode().
// This is IDENTICAL to the Rigid Non Blended OffsetVector.
// It represents the Vertex in the local coordinates of the node via GetNode().
PHYExport virtual Point3 GetOffsetVector() = 0;
// GetDeformOffsetVector(t) will return the coorinates of the deformed vertex
// in the local coordinates of the associated INode pointer from GetNode().
// Game Developers wishing to store relative offsets can subtract the
// Deformable Offsets for given frames from the Base Offset Vector.
PHYExport virtual Point3 GetDeformOffsetVector(TimeValue t) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
// Import Interface Functionality for Physique
//
// Character Studio 2.1 allows users to programatically set the Rigid
// Vertex Assignments (with or without Blending) via Import Interface
// IPhyVertexImport: this is the base class for Vertex Export Interface
// NOTE: currently only RIGID_TYPE vertices are supported (IPhyRigidVertex)
// When a vertex is not assigned Rigid in Physique, the VertexInterface will be NULL
// Unless you call IPhyContextExport->ConvertToRigid(TRUE) (see IPhyContextExport below)
// With ConvertToRigid(TRUE) you will always get a IPhyRigidVertex
// from IPhyContextExport->GetVertexInterface(i)
class IPhyVertexImport
{
public:
PHYExport virtual ~IPhyVertexImport() {}
// NOTE: currently only type RIGID_TYPE | RIGID_BLENDED_TYPE are supported
PHYExport virtual int GetVertexType() = 0;
// You can lock (TRUE) or unlock (FALSE) vertex assignments
// To avoid changes to manual vertex assignments locking prevents
// these vertices from being reinitialized by Physique.
PHYExport virtual void LockVertex(BOOL lock) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhyRigidVertexImport : public IPhyVertexImport
{
public:
PHYExport virtual ~IPhyRigidVertexImport() {}
// SetNode() will define the INode pointer of the link of the given Rigid Vertex Interface
// If this INode is a valid Physique Link SetNode returns TRUE, and this vertex is
// now assigned Rigid (NonBlended) to this INode.
// If this INode is not a valid Physique Link, then SetNode returns FALSE,
// and no change to the vertex assignment occurs.
PHYExport virtual BOOL SetNode(INode *nodePtr) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhyBlendedRigidVertexImport : public IPhyVertexImport
{
public:
PHYExport virtual ~IPhyBlendedRigidVertexImport() {}
// SetWeightedNode will assign the given vertex to the nodePtr with the weight specified.
// When init = TRUE, this will remove all existing asignments and define this nodePtr
// as the first and only nodePtr assigned to the given vertex. When init = FALSE this
// nodePtr and weight are appeneded to the current assignments.
// Always set init = TRUE for the first nodePtr and weight for a given vertex
// and init = FALSE for all additional 2nd thru Nth nodeptr and weights.
// SetWeightedNode returns the number of Nodes assigned to the given Vertex
// when set successfully, or when the given nodePtr is not a valid Physique Link
// SetWeightedNode returns 0.
PHYExport virtual int SetWeightedNode(INode *nodePtr, float weight, BOOL init = FALSE) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhyContextImport
{
public:
PHYExport virtual ~IPhyContextImport() {}
// this returns the number of vertices for the given modContext's Object
PHYExport virtual int GetNumberVertices() = 0;
// SetVertexInterface return's a VertexInterface (IPhyVertexImport *) for the i'th vertex.
// type = RIGID_NON_BLENDED_TYPE | RIGID_BLENDED_TYPE are currently supported.
// Any other value for type will return NULL.
PHYExport virtual IPhyVertexImport *SetVertexInterface(int i, int type) = 0;
// You must call ReleaseVertexInterface to delete the VertexInterface when finished with it.
PHYExport virtual void ReleaseVertexInterface(IPhyVertexImport *vertexImport) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhysiqueImport
{
public:
PHYExport virtual ~IPhysiqueImport() {}
//GetContextInterface will return a pointer to IPhyContextImport Interface for a given INode.
// if the given INode does not contain the Physique Modifier of this IPhysique Import then NULL is returned.
PHYExport virtual IPhyContextImport *GetContextInterface(INode* nodePtr) = 0;
// You must call ReleaseContextInterface to delete the ContextInterface when finished with it.
PHYExport virtual void ReleaseContextInterface(IPhyContextImport *contextImport) = 0;
// You call AttachRootNode to define the root node of the Physique Modifier
// This will create default vertex assignments.
// You MUST call AttachRootNode prior to any Imported Vertex Assignments
// This method is designed specifically for developers wanting to
// define Physique fully via import. Predictable results should only be
// expected when this call is followed by a series of Vertex Import calls
// for every ModContext and Vertex of the Modifier.
// If the attach is successful it returns TRUE, otherwise it returns FALSE.
// TimeValue t specifies the initial skeleton pose, the position of the
// skeleton relative to the Object Geometry.
PHYExport virtual BOOL AttachRootNode(INode *nodePtr, TimeValue t) = 0;
PHYExport virtual BOOL InitializePhysique(INode *nodePtr, TimeValue t) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
};
class IPhyFloatingVertex : public IPhyVertexExport
{
public:
PHYExport virtual ~IPhyFloatingVertex() {}
PHYExport virtual int GetNumberNodes() = 0;
PHYExport virtual INode *GetNode(int i) = 0;
PHYExport virtual float GetWeight(int i, float &totalweight) = 0;
PHYExport virtual Point3 GetOffsetVector(int i) = 0;
PHYExport virtual int Execute(int cmd, ULONG arg1=0, ULONG arg2=0, ULONG arg3=0) = 0;
// GetNumberNodes() returns the number of nodes (bones) assigned to the given Vertex
// GetNode(i) will return the INode pointer of the ith node assigned to
//this Vertex
// GetOffsetVector(i) will return the coordinates of the vertex
// in the local coordinates of associated i'th INode pointer from GetNode(i)
// this is NOT THE SAME as the .vph file coordinates. (It is simpler)
// the world coordinates of the vertex have been transformed by the Inverse of the INode pointer.
// GetWeight(i) will return the normalized weight of the vertex associated with the i'th Node
// pointer from GetNode(i)
};
#endif

View File

@ -0,0 +1,69 @@
#ifndef __TRACKS_H
#define __TRACKS_H
// The Biped Tracks
#define KEY_NOTHING -1
#define KEY_LARM 0
#define KEY_RARM 1
#define KEY_LHAND 2
#define KEY_RHAND 3
#define KEY_LLEG 4
#define KEY_RLEG 5
#define KEY_LFOOT 6
#define KEY_RFOOT 7
#define KEY_SPINE 8
#define KEY_TAIL 9
#define KEY_HEAD 10
#define KEY_PELVIS 11
#define KEY_VERTICAL 12
#define KEY_HORIZONTAL 13
#define KEY_TURN 14
#define KEY_FOOTPRINTS 15
#define KEY_NECK 16
#define KEY_PONY1 17
#define KEY_PONY2 18
#define KEY_PROP1 19
#define KEY_PROP2 20
#define KEY_PROP3 21
#define KEY_LFARM 22
#define KEY_RFARM 23
#define NKEYTRACKS 24
// RK: 10/12/99 defines for adapt locks
#define ADAPT_LOCKHOR 0
#define ADAPT_LOCKVER 1
#define ADAPT_LOCKTURN 2
#define ADAPT_LOCKLLEG 3
#define ADAPT_LOCKRLEG 4
#define ADAPT_LOCKFFRM 5
#define ADAPT_LOCKTIME 6
#define NUB_START NKEYTRACKS
#define NUB_RHAND (NKEYTRACKS+0)
#define NUB_LHAND (NKEYTRACKS+1)
#define NUB_LFOOT (NKEYTRACKS+2)
#define NUB_RFOOT (NKEYTRACKS+3)
#define NUB_TAIL (NKEYTRACKS+4)
#define NUB_HEAD (NKEYTRACKS+5)
#define NUB_PONY1 (NKEYTRACKS+6)
#define NUB_PONY2 (NKEYTRACKS+7)
#define NNUBTRACKS 8
// Track Selection used in IBipMaster::GetTrackSelection.. SetTrackSelection.
//bodytracks
#define NO_TRACK 0
#define HOR_TRACK 1
#define VER_TRACK 2
#define ROT_TRACK 3
#define HORVER_TRACK 4
#define MAXFINGERS 5
#define MAXFINGERLINKS 3
#define MAXLEGJNTS 4
#endif

82
lib/maxsdk70/include/CS/bhvr.h Executable file
View File

@ -0,0 +1,82 @@
//*********************************************************************
// Crowd / Unreal Pictures / bhvr.h
// Copyright (c) 1999, All Rights Reserved.
//*********************************************************************
#ifndef BHVR_H
#define BHVR_H
#include "max.h"
#include "iparamm2.h"
#define MAXBHVRNAME 256
// values to set the flag in Perform
#define BHVR_SETS_FORCE 0x00000001
#define BHVR_SETS_GOAL 0x00000002
#define BHVR_SETS_SPEED 0x00000004
#define BEHAVIOR_SUPER_CLASS_ID REF_TARGET_CLASS_ID
// data that is returned by the Perform function
struct PerformOut
{
Point3 frc;
Point3 goal;
float speedwt;
float speedAtGoalwt;
};
// data that is passed in by the Constraint function
struct ConstraintInOut
{
Point3 vel;
float speed;
Point3 pos;
Point3 desGoal;
};
// All behaviors must inherit from this base class
class BaseBehavior: public ReferenceTarget {
public:
typedef enum {FORCE=0,CONSTRAINT,ORIENTATION} BEHAVIOR_TYPE;
BaseBehavior() {}
SClass_ID SuperClassID() { return BEHAVIOR_SUPER_CLASS_ID; }
virtual void SetName(TCHAR *newname) {}
virtual TCHAR *GetName() {return NULL;}
virtual int Perform(INode *node, TimeValue t, int numsubsamples, BOOL DisplayHelpers, float BhvrWeight,
PerformOut &out) {return FALSE;}
virtual int CanConvertToMaxScript() {return FALSE;}
virtual void InitBeforeSim(int FirstFrame, INode *n, int SimStart, int AssignIndex) {}
// These provide an option to display an apparatus along with the behavior
// at all times - not just during solve. The behavior can offer an option
// to turn this on and off. Keep in mind this apparatus will be displayed
// as part of the crowd object, and so may enlarge the damaged rectangle significantly...
virtual int Display(TimeValue t, ViewExp *vpt) {return 0;}
virtual void GetWorldBoundBox(TimeValue t, ViewExp *vpt, Box3& box ) {}
virtual void BehaviorStarted(TimeValue t, INode *node){}; //called only from cog control(currently) whenever a behavior gets restarted.
virtual void SetUpDelegates(INodeTab& participants){}; //called at beginning of simulation.
virtual void InitAtThisTime(TimeValue t){} //called at beginning of each simulation frame
virtual BEHAVIOR_TYPE BehaviorType() {return FORCE;}
virtual IsWeightable()
{if (BehaviorType() == BaseBehavior::CONSTRAINT) return FALSE;
if (BehaviorType() == BaseBehavior::ORIENTATION) return FALSE;
return TRUE;}
//FOR CONSTRAINTS.
virtual int Constraint(INode *node, TimeValue t, int numsubsamples, BOOL DesGoalExists,BOOL DisplayHelpers,
BOOL finalSet,ConstraintInOut &inOut) {return FALSE;}
//FOR ORIENTATIONS
virtual int Orient(const Point3 &vel,INode *node, TimeValue t,Quat &quat) {return FALSE;}
};
#endif

View File

@ -0,0 +1,96 @@
/******************************************************************************
*<
FILE: delegexp.h
DESCRIPTION: Export Interface Functionality for Crowd Delegate
CREATED BY: Susan Amkraut
HISTORY: created December, 1999
*> Copyright (c) Unreal Pictures, Inc. 1999 All Rights Reserved.
*******************************************************************************/
#ifndef DELEGEXP_H
#define DELEGEXP_H
#ifdef BLD_DELEG
#define DELEGexport __declspec( dllexport )
#else
#define DELEGexport __declspec( dllimport )
#endif
#include "max.h"
// This is the interface ID for a Delegate Interface
#define I_DELEGINTERFACE 0x00100101
// This is the Class ID for Vector Field Objects.
#ifndef BLD_DELEG
#define DELEG_CLASSID Class_ID(0x40c07baa, 0x245c7fe6)
#define CROWD_CLASS_ID Class_ID(0x60144302, 0x43455584) // to avoid selecting a crowd
#endif
// Sample Code, starting with an INode(node)
//
// Object *o = node->GetObjectRef();
// if ((o->ClassID() == DELEG_CLASS_ID)
// {
//
// // Get the Delegate Export Interface from the node
// IDelegate *Iface = (IDelegate *) o->GetInterface(I_DELEGINTERFACE);
//
// // Get the delegate's average speed at time t
// float AverageSpeed = Iface->GetAverageSpeed(t);
// }
//
// // Release the interface. NOTE that this function is currently inactive under MAX.
// //o->ReleaseInterface(I_DELEGINTERFACE,Iface);
// }
// IDelegate: This class can be returned by calling the method GetInterface() from a Delegate node
class IDelegate
{
public:
DELEGexport virtual ~IDelegate() {}
DELEGexport virtual BOOL IsComputing() {return FALSE;}
DELEGexport virtual BOOL IsConstrainedInZ() {return FALSE;}
DELEGexport virtual Point3 GetCurrentPosition() {return Point3(0.0,0.0,0.0);}
DELEGexport virtual Point3 GetCurrentVelocity() {return Point3(0.0,0.0,0.0);}
DELEGexport virtual Point3 GetPreviousVelocity() {return Point3(0.0,0.0,0.0);}
DELEGexport virtual float GetCurrentSpeed() {return 1.0;}
DELEGexport virtual float GetAverageSpeed(TimeValue t) {return 1.0;}
DELEGexport virtual float GetMaxAccel(TimeValue t){return 1.0;}
DELEGexport virtual float GetMaxHeadingVel(TimeValue t) {return 1.0;}
DELEGexport virtual float GetMaxHeadingAccel(TimeValue t){return 1.0;}
DELEGexport virtual float GetMaxPitchVel(TimeValue t) {return 1.0;}
DELEGexport virtual float GetMaxPitchAccel(TimeValue t){return 1.0;}
DELEGexport virtual float GetMaxIncline(TimeValue t){return 1.0;}
DELEGexport virtual float GetMaxDecline(TimeValue t){return 1.0;}
DELEGexport virtual Point3 GetSimStartVelocity(INode *n, TimeValue StartTime) {return Point3(0.0,0.0,0.0);}
DELEGexport virtual int GetIndex() {return 0;}
DELEGexport virtual BOOL OkToDisplayMyForces() {return 1;}
DELEGexport virtual BOOL OkToDisplayMyVelocity() {return 1;}
DELEGexport virtual BOOL OkToDisplayMyCogStates() {return 1;}
DELEGexport virtual void LineDisplay(Point3& pt1, Point3& pt2, Color clr, BOOL scale) {}
DELEGexport virtual void BboxDisplay(Point3& pt1, Point3& pt2, Color clr) {}
DELEGexport virtual void SphereDisplay(Point3& pt1, float radius, Color clr) {}
DELEGexport virtual void TextDisplay(Point3& pt1, Color clr, TCHAR *str) {}
DELEGexport virtual BOOL IsAssignmentActive(int AssignIndex, TimeValue t) {return TRUE;}
DELEGexport virtual void ClearBacktracking() {}
DELEGexport virtual BOOL NeedsBacktracking() {return FALSE;}
DELEGexport virtual void SetBacktracking(int frame) {}
DELEGexport virtual int GetRandId() {return 0;}
DELEGexport virtual Matrix3 GetTM(INode *node,TimeValue t){return Matrix3();}
DELEGexport virtual BOOL ComputingBiped() {return FALSE;}
DELEGexport virtual BOOL ReactToMe() {return FALSE;}
};
#endif

View File

@ -0,0 +1,100 @@
//-----------------------------------------------------------------------------
// ----------------
// File ....: DefaultActions.h
// ----------------
// Author...: Larry Minton
// Date ....: June 2003
//
// History .: June, 19 2003 - Started
//
//-----------------------------------------------------------------------------
#ifndef DEFAULTACTION_H_DEFINED
#define DEFAULTACTION_H_DEFINED
#define DEFAULTACTIONS_DEFAULT_MSG_LOG_MAXSIZE 500
// Actions - set as bits in a DWORD
#define DEFAULTACTIONS_LOGTOFILE 0x00000001
#define DEFAULTACTIONS_LOGMSG 0x00000002
#define DEFAULTACTIONS_ABORT 0x00000004
#define DEFAULTACTIONS_RESERVED_4 0x00000008
#define DEFAULTACTIONS_RESERVED_5 0x00000010
#define DEFAULTACTIONS_RESERVED_6 0x00000020
#define DEFAULTACTIONS_RESERVED_7 0x00000040
#define DEFAULTACTIONS_RESERVED_8 0x00000080
// Event IDs. 0 through 65535 reserved for internal use.
#define TYPE_MISSING_EXTERNAL_FILES 1
#define TYPE_MISSING_DLL_FILES 2
#define TYPE_MISSING_XREF_FILES 3
#define TYPE_MISSING_UVWS 4
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//
class DefaultActionSys {
public:
/* Provides the default action to take for a specified event instead of displaying a dialog.
Returns TRUE if a default action was specified for the event, false otherwise.
The eventID argument is a random value signifying a specific event, with values 0 through 65535 reserved
for internal use.
If a default action was specified for the event it is returned through argument action.
Bits 0, 1, and 2 are reserved to mean Write to Log File, Write to MsgLog, and Abort, respectively.
Bits 3 to 7 are reserved for future internal use
The remaining bits are event specific.
The default return value for events which have not had an action value set is 1 (Write to Log, No Abort).
*/
virtual BOOL GetAction (DWORD eventID, DWORD &action) = 0;
/* Sets the default action and descriptive title for the event.
Returns TRUE if a default action was previously specified for the event, and if oldAction is not NULL the
old action value is stored to it.
*/
virtual BOOL SetAction ( DWORD eventID, DWORD action, TCHAR * = NULL, DWORD *oldAction = NULL) = 0;
// Deletes the event. Returns TRUE of eventID was located and deleted
virtual BOOL DeleteAction (DWORD eventID) = 0;
// Returns the number of event IDs registered.
virtual int GetActionCount() = 0;
// Returns the event<6E>s title, null string if eventID not found
virtual TSTR GetActionTitle(DWORD eventID) = 0;
// Returns the indexed event<6E>s title.
virtual TSTR GetActionTitleByIndex(int index) = 0;
// Returns the indexed event<6E>s ID.
virtual DWORD GetActionIDByIndex(int index) = 0;
// Logs the event ID and message. Returns TRUE if successfully logged.
virtual BOOL LogEntry(DWORD eventID, TCHAR *message) = 0;
// Clears the logged messages.
// If eventID is 0, all messages are deleted, otherwise only messages for the specific event ID are deleted.
virtual void MsgLogClear(DWORD eventID) = 0;
// Returns the number of logged messages.
// If eventID is 0, all messages are counted, otherwise only messages for the specific event ID are counted.
virtual int GetMsgLogCount(DWORD eventID) = 0;
// Returns the specified logged message.
// If eventID is 0, all messages are counted, otherwise only messages for the specific event ID are counted.
virtual TSTR GetMsgLogMsg(DWORD eventID, int index) = 0;
// Returns the event ID of specified logged message.
virtual DWORD GetMsgLogID(int index) = 0;
// Sets the maximum number of messages that can be stored. Returns the previous limit.
// If eventID == -1, the count is not changed, and the current limit is returned.
virtual int SetMsgLogMaxCount(int count) = 0;
};
#endif
//-- EOF: DefaultActions.h ---------------------------------------------------------------

View File

@ -0,0 +1,16 @@
#pragma once
class GeoTableItem
{
public:
bool m_geoInfo;
Matrix3 m_matrix;
NameTab m_names;
Point3 m_pts[4];
Point3 m_scale;
GeoTableItem() : m_geoInfo(false), m_matrix(1)
{
m_names.SetSize(0);
}
};

View File

@ -0,0 +1,64 @@
#ifndef __IBMESH__H
#define __IBMESH__H
#include "iFnPub.h"
//***************************************************************
//Function Publishing System stuff
//****************************************************************
#define BLOBMESH_INTERFACE Interface_ID(0xDE17A66a, 0x8A41E45d)
enum { blobmesh_addnode, blobmesh_removenode,
blobmesh_addpfnode, blobmesh_removepfnode,
blobmesh_pickmode, blobmesh_addmode,
blobmesh_addpfmode
};
class IBlobMesh : public FPMixinInterface
{
public:
//Function Publishing System
//Function Map For Mixin Interface
//*************************************************
BEGIN_FUNCTION_MAP
VFN_1(blobmesh_addnode, fnAddNode, TYPE_INODE);
VFN_1(blobmesh_removenode, fnRemoveNode, TYPE_INODE);
VFN_1(blobmesh_addpfnode, fnAddPFNode, TYPE_INODE);
VFN_1(blobmesh_removepfnode, fnRemovePFNode, TYPE_INODE);
VFN_0(blobmesh_pickmode, fnPickMode);
VFN_0(blobmesh_addmode, fnAddMode);
VFN_0(blobmesh_addpfmode, fnAddPFMode);
END_FUNCTION_MAP
FPInterfaceDesc* GetDesc(); // <-- must implement
//note functions that start with fn are to be used with maxscript since these expect 1 based indices
virtual void fnAddNode(INode *node)=0;
virtual void fnRemoveNode(INode *node)=0;
virtual void fnAddPFNode(INode *node)=0;
virtual void fnRemovePFNode(INode *node)=0;
virtual void fnPickMode() = 0;
virtual void fnAddMode() = 0;
virtual void fnAddPFMode() = 0;
};
#endif

View File

@ -0,0 +1,52 @@
//////////////////////////////////////////////////////////////////////////////
//
// Composite Shader Interface
//
// Created: 9/27/01 Cleve Ard
//
#ifndef ICOMPOSITESHADERS_H
#define ICOMPOSITESHADERS_H
#include "iFnPub.h"
// ISpecularCompositeShader is used to let a shader choose the manner
// that it combines specular and diffuse lighting. The shader can use
// any information in the RenderGlobalContext to make this decision.
// Several shaders, include anisotropic, translucent, and multilayer
// combine specular and diffuse lighting using this equation:
// L = specular + (1 - specular) * diffuse
// This only works when 0 <= specular <= 1. These shaders use this
// interface to determine whether we are rendering with a tone operator.
// If the render is using a tone operator, then the specular and diffuse
// lighting is simply added for the total lighting.
// In order for a StdMtl2 to ask for and call this interface for a shader
// it must return MTLREQ_PREPRO in it's LocalRequirements method.
class ISpecularCompositeShader : public BaseInterface {
public:
// Choose specular method
virtual void ChooseSpecularMethod(TimeValue t, RenderGlobalContext* rgc) = 0;
};
#define ISPECULAR_COMPOSITE_SHADER_ID Interface_ID(0x5e2117d0, 0x327e2f73)
// Get the ISpecularCompositeShader method, if there is one.
inline ISpecularCompositeShader* GetSpecularCompositeShader(InterfaceServer* s)
{
return static_cast<ISpecularCompositeShader*>(s->GetInterface(
ISPECULAR_COMPOSITE_SHADER_ID));
}
// Choose the method for combining specular and diffuse lighting.
inline void ChooseSpecularMethod(InterfaceServer* s, TimeValue t, RenderGlobalContext* rgc)
{
ISpecularCompositeShader* scs = GetSpecularCompositeShader(s);
if (scs != NULL)
scs->ChooseSpecularMethod(t, rgc);
}
#endif

2324
lib/maxsdk70/include/ICoordSys.h Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,98 @@
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Sun Jul 25 11:57:48 1999
*/
/* Compiler settings for ICoordSys.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
const IID IID_IGcsBitmap = {0x189618F0,0xF8FD,0x11d2,{0xAA,0x0F,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsPointTab = {0x90F5DD70,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsNodeTab = {0x90F5DD71,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsTriObject = {0x90F5DD72,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsSplineShape = {0x90F5DD73,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsTransform = {0x90F5DD74,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsUI = {0x90F5DD76,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsLoad = {0x90F5DD77,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsSave = {0x90F5DD78,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID IID_IGcsSession = {0x90F5DD79,0xE2F6,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const IID LIBID_GCSAPILib = {0xCEFFE1D4,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsSession = {0xCEFFE1D5,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsPointTab = {0xCEFFE1D8,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsNodeTab = {0xCEFFE1D9,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsTriObject = {0xCEFFE1DA,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsSplineShape = {0xCEFFE1DB,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsLoad = {0xCEFFE1DC,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsSave = {0xCEFFE1DD,0xE309,0x11d2,{0xA9,0xFE,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
const CLSID CLSID_GcsBitmap = {0x189618F1,0xF8FD,0x11d2,{0xAA,0x0F,0x00,0x60,0xB0,0x57,0xDA,0xFB}};
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,53 @@
/**********************************************************************
FILE: ICustAttribCollapseManager.h
DESCRIPTION: Public interface controlling whether Custom Attributes should survive a stack collapse
CREATED BY: Neil Hazzard, Discreet
HISTORY: Created 8th April 2004
*> Copyright (c) 2004, All Rights Reserved.
**********************************************************************/
#ifndef __ICUSTATTRIBCOLLAPSEMANAGER_H__
#define __ICUSTATTRIBCOLLAPSEMANAGER_H__
#include "iFnPub.h"
#define CUSTATTRIB_COLLAPSE_MANAGER Interface_ID(0x7abc18a6, 0x2a7e522b)
//!This interface provides access for setting and querying the state of flag that defines whether a Custom Attribute should survive a stack collapse
/*!
When the calling code needs to collapse the stack, it should bracket the call with an Enumeration using a class derived from GeomPipelineEnumProc.
Now the maxsdk contains two types of enumeration callbacks. One which collapses the stack with out any regard to Custom Attributes, and another that
will copy Custom Attributes to the base object. The calling code can find out which to use by using this interface, the user can set the state of flag
explicitly defining the path to take.
The calling code should only really need to query the flag, and not set it. The user will most likely control the flag
*/
class ICustAttribCollapseManager : public FPStaticInterface
{
public:
// Gets the current state of the survive stack collapse flag
/*/
\return True if the Custom Attributes should be maintained during a stack collapse
*/
virtual bool GetCustAttribSurviveCollapseState() = 0;
// Sets the current state of the survive stack collapse flag
/*/
\param state True if the Custom Attributes should be maintained during a stack collapse
*/
virtual void SetCustAttribSurviveCollapseState(bool state) = 0;
static ICustAttribCollapseManager* GetICustAttribCollapseManager() {
return static_cast<ICustAttribCollapseManager*>(GetCOREInterface(CUSTATTRIB_COLLAPSE_MANAGER));
}
};
#endif

View File

@ -0,0 +1,156 @@
/**********************************************************************
*<
FILE: IDxMaterial.h
DESCRIPTION: Interface for accessing the bitmaps used by effects in the DxMaterial
CREATED BY: Neil Hazzard
HISTORY: Created: 07/08/03
*> Copyright (c) 2003, All Rights Reserved.
**********************************************************************/
#include "iFnPub.h"
#ifndef __IDXMATERIAL_H__
#define __IDXMATERIAL_H__
#define IDXMATERIAL_INTERFACE Interface_ID(0x55b3201d, 0x29ab7fc3)
#define IDXMATERIAL2_INTERFACE Interface_ID(0x54e4202f, 0x30ab6bc4)
//!An interface class to manage access to various parameters used by DirectX effects.
/*!
The Effect file has many internal presentations and as such the DxMaterial does not always store a
one to one look up. Many parameters are stored in the ParamBlock and can be accessed that way. The
paramblock index for the Effect is located at 0 (the material maintains 5 ParamBlocks). However things like Lights
and Bitmaps do not get stored in the paramblock in an ideal way for data access. This interface simplifies this data
access by providing direct access to these elements.
*/
class IDxMaterial : public FPMixinInterface
{
public:
typedef enum LightSemantics {
LIGHT_COLOR,
LIGHT_DIRECTION,
LIGHT_POSITION,
}LightSemantics;
//!Reloads the current active effect
virtual void ReloadDXEffect()=0;
//!Returns the number of bitmaps used by the currently loaded effect
/*!
\return The number of bitmaps
*/
virtual int GetNumberOfEffectBitmaps()=0;
//!Gets the bitmap used by the effect
/*!
\param index The index of the bitmap to retrieve
\return A PBBitmap pointer for the bitmap used
*/
virtual PBBitmap * GetEffectBitmap(int index)=0;
//!Set the bitmap used by the effect
/*!
\param index The index of the bitmap to set
\param * bmap A PBBitmap pointer for the bitmap to set
*/
virtual void SetEffectBitmap(int index,PBBitmap * bmap)=0;
//!Get the Dx Effect file
/*!This can also be accessed via the paramblock, but it is simply provided for completeness
\return The effect file in use
*/
virtual TCHAR* GetEffectFilename()=0;
//!Set the Dx Effect file
/*!This can also be accessed via the paramblock, but it is simply provided for completeness
\param filename The effect file to set
*/
virtual void SetEffectFilename(TCHAR * filename)=0;
//! Get the bitmap used for the software rendering overrride
/*! This can also be set by the Paramblock, it is just used for completeness
return The Bitmap used
*/
virtual PBBitmap * GetSoftwareRenderBitmap() = 0;
//!Set the bitmap to be used by the Renderer.
/*! This can also be set by the Paramblock, it is just used for completeness
\param *bmap A PBBitmap specifiying the bitmap to use
*/
virtual void SetSoftwareRenderBitmap(PBBitmap * bmap) = 0;
//************************************************************************************
// The following method are not exposed through function publishing
//************************************************************************************
//!Get the number of light based parameters
/*!This will return the number of parameters that are light based, even Light Color. Care needs to be taken with Light Color
as it could also have a Color Swatch associated with it, so could already have been exported as part of the ParamBlock.
\return The number of light based parameters
*/
virtual int GetNumberOfLightParams()=0;
//!The actual node used by the parameter
/*!This represent the light node used by the parameter. Care needs to taken as this could be a NULL pointer. There are two reason for this.
The first is that the LightColor Semantic is stored internally as a LightElement, but the writer of the Effect file may not have specified
a parentID for the light, this will result in a NULL. Secondly if the user has not actually assigned a light via the UI drop down list,
then again this will again result in a NULL pointer.
\param index The index of the light to return.
\return The INode for the active light.
*/
virtual INode * GetLightNode(int index)=0;
//!The name of the parameter in the Effect file
/*
\param index The index of the light to retrieve
\return A TCHAR* containing the name
*/
virtual TCHAR * GetLightParameterName(int index)=0;
//!The light semantic as defined in the effect file
/*
\param index THe index of the light to retrieve
\return The semantic represented as a LightSemantics
*/
virtual LightSemantics GetLightSemantic(int index)=0;
};
class IDxMaterial2 : public IDxMaterial
{
public:
typedef enum BitmapTypes{
UNKNOWN_MAP,
DIFFUSE_MAP,
BUMP_MAP,
SPECULAR_MAP,
OPACITY_MAP,
DISPLACEMENT_MAP,
LIGHTMAP_MAP,
NORMAL_MAP,
REFLECTION_MAP,
}BitmapTypes;
//! Get the Mapping channel defined for the texture
/*! The mapping channel as specified in the Effect file. If no mapping is defined then this will be mapping channel 0
\param index The index of the bitmap to access
\return The mapping channel for the texture
*/
virtual int GetBitmapMappingChannel(int index) = 0;
virtual BitmapTypes GetBitmapUsage(int index) = 0;
virtual void SetMappingChannel(int bitmapIndex, int mapChannel)=0;
};
#endif

View File

@ -0,0 +1,73 @@
/**********************************************************************
*<
FILE: IFrameTagManager.h
DESCRIPTION: Interface to Frame Tag Manager
CREATED BY: Larry Minton
HISTORY: created 8/23/04
*> Copyright (c) 2004 Autodesk, All Rights Reserved.
**********************************************************************/
#ifndef __IFRAMETAGMANAGER__
#define __IFRAMETAGMANAGER__
#define FRAMETAGMANAGER_INTERFACE Interface_ID(0x8cd73eea, 0x688b1f11)
class IFrameTagManager : public FPStaticInterface {
public:
// get number of frame tags
virtual int GetTagCount() = 0;
// get ID for the Ith frame tag in the list of frame tags
// the list is maintained in sorted order, so a given
// tag can move around in the list. Each tag has a unique
// ID, so all access to the tag is via this ID
virtual DWORD GetTagID(int i) = 0;
// get/set the tag's time value. If relative is TRUE, time is relative
// to the tag this tag is locked to, if any. If false, or this tag is
// not locked to another tag, the time is absolute
virtual TimeValue GetTimeByID(DWORD id, BOOL relative) = 0;
virtual void SetTimeByID(DWORD id, TimeValue newTime, BOOL relative) = 0;
// get/set the tag this tag is locked to. An ID value of 0 means not tagged
// If you attempt to set a lock that would cause a circular dependency, the
// current lock will not be changed and the method will return FALSE. See CheckForLoop
// for testing for loops
virtual DWORD GetLockIDByID(DWORD id) = 0;
virtual BOOL SetLockIDByID(DWORD id, DWORD newLockID) = 0;
// get/set the tag's name
virtual TSTR GetNameByID(DWORD id) = 0;
virtual void SetNameByID(DWORD id, TSTR &newName) = 0;
// get/set whether to scale the tag's time when time is scaled
virtual BOOL GetScaleByID(DWORD id) = 0;
virtual void SetScaleByID(DWORD id, BOOL newScale) = 0;
// get the index of the tag in the sorted tag list. A return value of -1
// means a tag with the given ID was not found
virtual int FindItem(DWORD id) = 0;
// finds the first tag in the sorted list, if any, for the given absolute time value
virtual int FindItemByTime(TimeValue t) = 0;
// creates a new tag. If lockID is 0, the tag is not locked to another tag
// The time value is always absolute
virtual DWORD CreateNewTag(TCHAR *name, TimeValue t, DWORD lockID, BOOL scale) = 0;
// deletes the specified tag
virtual void DeleteTag(DWORD id) = 0;
// deletes all the tags
virtual void ResetFrameTags() = 0;
// returns true if tag testID is dependent on tag id
virtual BOOL CheckForLoop(DWORD testID, DWORD id) = 0;
};
#endif //__IFRAMETAGMANAGER__

View File

@ -0,0 +1,196 @@
/**********************************************************************
*<
FILE: IConveriosnManager.h
DESCRIPTION: Tools to convert from one coordinate system to another
CREATED BY: Neil Hazzard
HISTORY: 10|12|2002
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IConversionManager.h
\brief IGame Coordinate conversion Interfaces.
*/
#ifndef __ICONVERSIONMANAGER__H
#define __ICONVERSIONMANAGER__H
#pragma once
#include "Max.h"
#define IGAMEEXPORT __declspec( dllexport )
//!A User definable Coordinate System
/*! The developer can use this to define the Coordinate System that they are using. Rotation specifies whether
it is a Right or Left handed system. The Axis define which way the primary axis point. This will mean that the
data extracted is converted correctly, and the winding order is correct for Left and Right handed systems.
\n
In Max this could be defined as
\n
<pre>
UserCoord = {
1, //Right Handed
1, //X axis goes right
4, //Y Axis goes in
2, //Z Axis goes up.
1, //U Tex axis is left
0, //V Tex axis is Up
}
</pre>
*/
struct UserCoord{
//! Handedness
/*! 0 specifies Left Handed, 1 specifies Right Handed.
*/
int rotation;
//! The X axis
/*! It can be one of the following values 0 = left, 1 = right, 2 = Up, 3 = Down, 4 = in, 5 = out.
*/
int xAxis;
//! The Y axis
/*! It can be one of the following values 0 = left, 1 = right, 2 = Up, 3 = Down, 4 = in, 5 = out.
*/
int yAxis;
//! The Z axis
/*! It can be one of the following values 0 = left, 1 = right, 2 = Up, 3 = Down, 4 = in, 5 = out.
*/
int zAxis;
//! The U Texture axis
/*! It can be one of the following values 0 = left, 1 = right
*/
int uAxis;
//! The V Texture axis
/*! It can be one of the following values 0 = Up, 1 = down
*/
int vAxis;
};
//! A developer can use this class to define what Coord Systems IGame exports the data in
/*! IGame will convert data from the standard Max RH Z up system to any defined system. At the moment direct support
for DirectX and OpenGL are provided. This means that all Matrix and vertex data will have been converted ready to use
on your target system
\nYou should set up the coordinate system straight after initialising IGame. The default is to provide everything in Max
native formats.
*/
class IGameConversionManager
{
public:
//! The supported Coordinate Systems
/*! These are used to tell IGame how to format the data
*/
enum CoordSystem{
IGAME_MAX, /*!<Max RH Z up & +Y*/
IGAME_D3D, /*!<DirectX LH Y up & +Z*/
IGAME_OGL, /*!<OpenGL RH Y up & -Z*/
IGAME_USER /*!<User defined Coord System*/
};
//!Set IGame up for the Coordinate System you are wanting the data to be present in
/*! The default system is the MAX system.
\param Coord The Coordinate system to use If Coord is IGAME_USER then you must set
this data via SetUserCoordSystem
*/
virtual void SetCoordSystem(CoordSystem Coord) =0;
//!Set the User defined Coordinate system, if the CoordSystem has been defined as IGAME_USER
/*! Allow a user definable Coordinate System. See comments above.
\param UC THe data to define the system
*/
virtual void SetUserCoordSystem(UserCoord UC) =0;
};
typedef float GRow[4];
//! this is very minimal, it is used purely to store 4x4 data with minimum functionality to support that.
class GMatrix
{
float m[4][4];
friend IGAMEEXPORT Point3 operator*(const Point3& V, const GMatrix& A);
public:
Point4& operator[](int i) { return((Point4&)(*m[i]));}
const Point4& operator[](int i) const { return((Point4&)(*m[i])); }
//!Returns the Address of the GMatrix. This allows direct access via the [] operator
/*!
\returns The address of the GMatrix
*/
GRow * GetAddr(){return (GRow *)(m);}
//!Returns the Address of the GMatrix. This allows direct access via the [] operator.
/*! This method is const aware.
\returns The address of the GMatrix
*/
const GRow* GetAddr() const { return (GRow *)(m); }
//!constructor from a Matrix3
IGAMEEXPORT GMatrix(Matrix3);
//! default constructor
IGAMEEXPORT GMatrix();
//! Sets all values to 0.0f
void ResetMatrix();
//! Set the Standard Identity Matrix
void SetIdentity();
/*! Access to the matrix column.
\param i The number of the column to retrieve
\returns A Point4 containing the column
*/
IGAMEEXPORT Point4 GetColumn(int i) const;
/*! Set the the matrix column.
\param i The number of the column to set
\param col Point4 containing the column to set
*/
IGAMEEXPORT void SetColumn(int i, Point4 col);
/*! Access to the matrix row.
\param i The number of the row to retrieve
\returns A Point4 containing the row
*/
Point4 GetRow(int i) const { return (*this)[i]; }
/*! Set to the matrix row to the desired data.
\param i The number of the row to set
\param row A Point4 containing the row
*/
IGAMEEXPORT void SetRow(int i, Point4 row);
//!Provide matrix multiplication
IGAMEEXPORT GMatrix operator*(const GMatrix&)const;
//!Assignment operator from a Matrix3
IGAMEEXPORT GMatrix& operator=(const Matrix3&);
//!Extract a Matrix3 from the GMatrix
/*!This is for backward compatibility. This is only of use if you use Max as a coordinate system, other wise
standard max algebra might not be correct for your format.
\returns A max Matrix3 form of the GMatrix
*/
IGAMEEXPORT Matrix3 ExtractMatrix3()const ;
};
//! Multiplies a GMatrix with a Point3
IGAMEEXPORT Point3 operator*(const Point3& V, const GMatrix& A);
//!External access to the conversion manager
IGAMEEXPORT IGameConversionManager * GetConversionManager();
#endif

View File

@ -0,0 +1,322 @@
/**********************************************************************
*<
FILE: IGame.h
DESCRIPTION: Scene and Node interfaces for IGame
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IGame.h
\brief Main IGame scene access including node and materials
*/
#ifndef __IGAME__H
#define __IGAME__H
#pragma once
#include "IGameControl.h"
#include "IGameMaterial.h"
#include "IGameObject.h"
#define IGAMEEEXPORT __declspec( dllexport )
class GMatrix;
//!A simple wrapper for max nodes
/*!
IGameNode provides simplified access to many of Max's standard Node. The user can use this class to gain access
to Controllers and Objects, plus many basic node properties. An instance of this class is available through the IGameScene
interfaces.
\sa class IGameScene class IGameObject
*/
class IGameNode
{
public:
//! Get the IGameControl Interface for this node
/*! The IGameControl provides access to the key frame data for the node
\return An IGameControl pointer.
*/
virtual IGameControl * GetIGameControl() =0;
//! Get the actual object
/*! The is the object used by IGame, all the basic objects supported by IGame derive from IGameObject
You can use IGameObject::GetIGameType to determine how to cast the returned pointer.
\return An IGameObject pointer
*/
virtual IGameObject * GetIGameObject()=0;
//! Release the IGameObject obtained from GetIGameObject
/*! This will release all the memory used by the object, but it will not effect any controller or transfrom
data. Remember to call GetIGameObject if you want to use it again.
*/
virtual void ReleaseIGameObject()=0;
//! the node name
/*! The name of the node as used in max
\return The name of the object
*/
virtual TCHAR * GetName() = 0;
//! the unique Node ID
/*! This provideds access to the node handle used in max. This value will be unique for the file
\return The node id (node handle)
*/
virtual int GetNodeID() =0;
//! Access to the max node, if further processing is required
/*! if need be the node can be accessed here - this is so that IGame can be intergrated into existing pipelines
\return A pointer to a Max node
*/
virtual INode * GetMaxNode()=0;
//! World TM
/*!
\param t the Time to retrieve the WorldTM. If no time is passed in then the global static frame is used
\return A matrix containing the World TM
*/
// virtual Matrix3 GetWorldTM(TimeValue t=TIME_NegInfinity)=0;
virtual GMatrix GetWorldTM(TimeValue t=TIME_NegInfinity)=0;
//! Local TM
/*!
\param t the Time to retrieve the LocalTM. If no time is passed in then the global static frame is used
\return A Matrix containing the local TM
*/
//virtual Matrix3 GetLocalTM(TimeValue t=TIME_NegInfinity)=0;
virtual GMatrix GetLocalTM(TimeValue t=TIME_NegInfinity)=0;
//! Object TM
/*!
\param t the Time to retrieve the LocalTM. If no time is passed in then the global static frame is used
\return A Matrix containing the Object TM. This is the TM after any world space transforms have been applied
*/
virtual GMatrix GetObjectTM(TimeValue t=TIME_NegInfinity)=0;
//! Get the nodes parent
/*! If this is a top level node, then it will not have any parents
\returns If there is a parent a valid pointer will be returned, else NULL
*/
virtual IGameNode * GetNodeParent() =0;
//! The number of direct children to the parent. This does not include children of children
/*!
\return The number of children
*/
virtual int GetChildCount()=0;
//! Access the n'th child node of the parent node
/*!
\param index The index to the child to retrieve
\return IGameNode pointer to the child
*/
virtual IGameNode * GetNodeChild(int index) =0;
//! The index into the material array for this node's material
/*!
\return The index of material used by this node
*/
virtual int GetMaterialIndex() =0;
//! Direct access to the actual material used by the node
/*!
\return The IGameMaterial pointer for this node.
*/
virtual IGameMaterial * GetNodeMaterial() =0;
//! Is this a Target Node
/*!Can be used for exporting targets. Exporters often treat targets separately to standard nodes
choosing to export them as part of the node that uses them as targets for example lights and cameras
\return true if it is a target
*/
virtual bool IsTarget()=0;
//! Is this node a Group Head
/*! A group in max has an owner, a Group Head, this is a dummy node. The children of a Group Head are the members of the
group. So when you encounter one of these, look for the children as these will be the members of the group.
\return Is it a "Group Head". True if it is.
*/
virtual bool IsGroupOwner()=0;
//!Is the node hidden
/*!This allows access to the hidden property of the node. A developer may choose to ignore any node that is hidden. However
this can be dangerous as many dummy objects get hidden but actually define animation - especially in IK situations
\return true is hidden
*/
virtual bool IsNodeHidden()=0;
};
//!Main scene access
/*! IGameScene is the main entry point for an exporter. It contains the initialisation routines and access to
the nodes and materials of the scene. The user can ask IGame to emeumerate the whole scene, selected nodes or
single nodes, with or with out hierarchy.
*/
class IGameScene
{
public:
//!Set the Property File to use
/*!You can define the name of the file to use, including full path, that IGame uses to parse for the supported
parameters. This means that you could have multiple configs depending on the various games in development. <b>You must call this
before you call InitialiseIGame(). </b> By default the the filename will be the maxroot\plugcfg\IGameProp.XML.
\param fileName The name of the property file to use inthis session.
*/
virtual void SetPropertyFile(const TCHAR * fileName) = 0;
//! Initialise IGame
/*! IGame can be initialised specifying whether to search for selected nodes only
\param selected True is selected are searched for - default false
\return True if the scene was enumerated - A Possible reason for failure is that the Parameter
XML file was not found or parsed correctly
*/
virtual bool InitialiseIGame(bool selected = false)=0;
//!Initialise IGame with a specific node.
/*!Developers can specify a single node to parse.
\param root The actual node to parse
\param Hierarchy lets IGame know to initialise the children of the node
\return True if the scene was enumerated - A Possible reason for failure is that the Parameter
XML file was not found or parsed correctly
*/
virtual bool InitialiseIGame(INode * root, bool Hierarchy = true)=0;
//!Initialise IGame with a specific set of nodes.
/*!Developers can specify a set of nodes to parse. The could be implemented by creating a Tab using
the max sdk. Look at Interface::GetSelNodes() and Interface::GetSelNodeCount().
\param nodes The actual tab containing the nodes to parse
\param Hierarchy lets IGame know to initialise the children of the node
\return True if the scene was enumerated - A Possible reason for failure is that the Parameter
XML file was not found or parsed correctly
*/
virtual bool InitialiseIGame(Tab<INode *> nodes, bool Hierarchy = true) = 0;
//!Get the active filename
/*!
\return The current filename
*/
virtual TCHAR * GetSceneFileName() =0;
//!Set the static frame
/*! Specify the frame to use for Time access functions
\param frameNum The static frame to use - Internally this will be converted to Ticks
*/
virtual void SetStaticFrame(int frameNum)=0;
//!The start of the animation range
/*!This provides the animation start time in ticks
\return The start time in ticks
*/
virtual TimeValue GetSceneStartTime() =0;
//!The end of the animation range
/*!This provides the animation end time in ticks
\return The end time in ticks
*/
virtual TimeValue GetSceneEndTime() =0;
//!THe number of ticks per frame
/*!
\return The number of ticks per frame
*/
virtual int GetSceneTicks()=0;
// Get the number of Top level Parent Node
/*! All node access is provides by parent nodes. This does not include the Root node as in Max. This method
can be used to traverse the scene
\return The number of parent nodes
*/
virtual int GetTopLevelNodeCount()=0;
//! Returns the complete number of nodes.
/*! The is useful if you want to use a progress bar in the exporter
\return The total node count
*/
virtual int GetTotalNodeCount()=0;
//! Access the actual toplevel node
/*!
A Top level node is a node at the top of the Hierarchy, i.e it has no Parent.
\param index The index into the the toplevel parent list
\return A pointer to a IGameNode
\sa IGameNode
*/
virtual IGameNode * GetTopLevelNode(int index) =0;
//! The total number of parent materials
/*! This does not include sub materials - just the number of actual material containers
\return The total number of parent materials
*/
virtual int GetRootMaterialCount() = 0;
//! Access to the Root Material
/*! This is the parent material that is stored on the Node. The material will host any sub materials and access
is provided by the IGameMaterial interface.
\param index The root material to access
\return A Pointer to an IGameMaterial
\sa IGameMaterial
*/
virtual IGameMaterial * GetRootMaterial(int index) =0;
//! Access the IGameNode from the supplied INode
/*! Some IGame methods provide access to INode lists. You can use this method to retrieve the IGameNode equivelent
IGame must be initialised first, as the node must be in the Database
\param node The max node to find
\return A pointer to IGameNode, or NULL if not found
*/
virtual IGameNode * GetIGameNode(INode * node) =0;
//! Access the IGameNode from the supplied Node ID
/*! You can use this method to retrieve the IGameNode based on a Node ID IGame must be initialised first, as the node must be in the Database
\param NodeID The Node ID to find
\return A pointer to IGameNode, or NULL if not found
*/
virtual IGameNode * GetIGameNode(ULONG NodeID) =0;
//! Access the set IGameNodes from the specified IGame Type
/*! You can use this method to retrieve the IGameNode based on IGameObject::ObjectTypes. IGame must be initialised first, as the node must be in the Database
\param Type The IGameObject::ObjectTypes to find
\return A Tab of IGameNodes. The developer should check the Count() method to see if any were found
*/
virtual Tab<IGameNode*> GetIGameNodeByType(IGameObject::ObjectTypes Type) = 0;
//! Releases IGame and free all associated memory
/*! This must be called after you have finished with IGame. It makes sure all data is freed and general clean up is performed.
Without calling this you run the risk of corrupting memory, and causing incorrect data to returned the next time IGame is run
*/
virtual void ReleaseIGame()=0;
};
/*!\fn IGameScene *GetIGameInterface()
\brief A global function to IGameScene, the main starting point in IGame
\return A Pointer to IGameScene
*/
IGAMEEEXPORT IGameScene *GetIGameInterface();
/*!\fn float GetIGameVersion()
\brief Provides a way to query for the version of IGame the DLL has been built against
\return A float value with the IGame Version
*/
IGAMEEEXPORT float GetIGameVersion();
/*!\fn float GetSupported3DSVersion()
\brief Provides a way to query for the version of 3ds max that the IGame DLL is compatible with
\return A float value with the 3ds max version. This currently can either be 4.2,5.1 or 6.0 If it is 6.0 then it
will be compiled with the VC7.0 compiler
*/
IGAMEEEXPORT float GetSupported3DSVersion();
#endif // __IGAME__H

View File

@ -0,0 +1,497 @@
/**********************************************************************
*<
FILE: IGameControl.h
DESCRIPTION: Controller interfaces for IGame
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IGameControl.h
\brief High level access to MAX's controllers, including Biped and constraints and list controllers
High level access to MAX's controllers, including Biped and constraints and list controllers
<b> Please note that Point4 controller access is only available for 3ds max 6 and above</b>
*/
#ifndef __IGAMECONTROL__H
#define __IGAMECONTROL__H
#pragma once
#include "max.h"
#include "ISTDPLUG.H"
#include "IGameProperty.h"
#include "IConversionManager.h"
class IGameNode;
//! An enum of basic controller types used by IGame
/*! These controllers types are used to define the type of controller being queried.
*/
enum IGameControlType{
IGAME_POS, /*!<Position Controller*/
IGAME_ROT, /*!<Rotation Controller*/
IGAME_SCALE, /*!<Scale Controller*/
IGAME_FLOAT, /*!<Float Controller*/
IGAME_POINT3, /*!<Point3 Controller*/
IGAME_TM, /*!<Used for sampling the node transformation matrix. This is the only time this control
type can be used*/
IGAME_EULER_X, /*!<Euler X controller*/
IGAME_EULER_Y, /*!<Euler Y controller*/
IGAME_EULER_Z, /*!<Euler Z controller*/
IGAME_POINT4, /*!<Point4 based controllers - This is available from 3ds max 6*/
};
class IGameConstraint;
class GMatrix;
//! A generic animation key wrapper class
/*! A generic TCB key class for IGame
*/
class IGameTCBKey {
public:
//! access to basic TCB data
/*! This provides access to the Tension, continuity, bias and easein/out properties of a TCB Key
*/
float tens, cont, bias, easeIn, easeOut;
//! float based value,
/*! This would be accessed when using the IGAME_FLOAT specifier
*/
float fval;
//! Point3 based value,
/*! This would be accessed when using the IGAME_POS or IGAME_POINT3 specifiers
*/
Point3 pval;
//! Point4 based value,
/*! This would be accessed when using the IGAME_POINT4 specifiers
*/
Point4 p4val;
//! Ang Axis based value,
/*! This would be accessed when using the IGAME_ROT specifier
*/
AngAxis aval;
//! scale based value,
/*! This would be accessed when using the IGAME_SCALE specifier
*/
ScaleValue sval;
};
//! A generic animation key wrapper class
/*! A generic Bezier Key class for IGame
*/
class IGameBezierKey {
public:
//! float based In and out tangents
/*! This would be accessed when using the IGAME_FLOAT specifier
*/
float fintan, fouttan;
//! float based value,
/*! This would be accessed when using the IGAME_FLOAT specifier
*/
float fval;
//! float based tangent lengths
/*! This would be accessed when using the IGAME_FLOAT specifier
*/
float finLength, foutLength;
//! Point3 based In and out tangents
/*! This would be accessed when using the IGAME_POS or IGAME_POINT3 specifiers
*/
Point3 pintan, pouttan;
//! Point3 based value,
/*! This would be accessed when using the IGAME_POS or IGAME_POINT3 specifiers
*/
Point3 pval;
//! Point3 based tangent lengths
/*! This would be accessed when using the IGAME_POS or IGAME_POINT3 specifiers
*/
Point3 pinLength, poutLength;
//! Quaternion based value,
/*! This would be accessed when using the IGAME_ROT specifier
*/
Quat qval;
//! scale based value,
/*! This would be accessed when using the IGAME_SCALE specifier
*/
ScaleValue sval;
//! Point4 based In and out tangents
/*! This would be accessed when using the IGAME_POINT4 specifier
*/
Point4 p4intan, p4outtan;
//! Point4 based tangent lengths
/*! This would be accessed when using IGAME_POINT4 specifier
*/
Point4 p4inLength, p4outLength;
//! Point4 based value,
/*! This would be accessed when using the IGAME_POINT4 specifier
*/
Point4 p4val;
};
//! A generic animation key wrapper class
/*! A generic Linear Key class for IGame
*/
class IGameLinearKey {
public:
//! float based value,
/*! This would be accessed when using the IGAME_FLOAT specifier
*/
float fval;
//! Point3 based value,
/*! This would be accessed when using the IGAME_POS or IGAME_POINT3 specifiers
*/
Point3 pval;
//! Quaternion based value,
/*! This would be accessed when using the IGAME_ROT specifier
*/
Quat qval;
//! scale based value,
/*! This would be accessed when using the IGAME_SCALE specifier
*/
ScaleValue sval;
};
//! A generic animation key wrapper class
/*! A generic Sample Key class for IGame. This is used for unknown controllers or controllers that
simply need to be sampled, this can includes Biped
*/
class IGameSampleKey{
public:
//! Point3 value, used with IGAME_POINT3 and IGAME_POS
Point3 pval;
//! Point4 value, used with IGAME_POINT4
Point4 p4val;
//! float value, used with IGAME_FLOAR
float fval;
//! Quaternion value, used with IGAME_ROT
Quat qval;
//! Scale value, used with IGAME_SCALE
ScaleValue sval;
//! GMatrix, used with IGAME_TM
GMatrix gval;
};
//!Main animation key container
/*! A simple container class for direct Key access of all the available Key types
*/
class IGameKey
{
public:
//! The time the key was set
TimeValue t;
//! Flags various selection states for the key.
DWORD flags;
//!The TCB Keys
/*! This key access would be used if you used one of the GetTCBKeys methods
*/
IGameTCBKey tcbKey;
//!The Bezier Keys
/*! This key access would be used if you used one of the GetBezierKeys methods
*/
IGameBezierKey bezierKey;
//!The Linear Keys
/*! This key access would be used if you used one of the GetLinearKeys methods
*/
IGameLinearKey linearKey;
//!The Sampled Keys
/*! This key access would be used if you used one of the GetSampledKeys methods
*/
IGameSampleKey sampleKey;
};
/*!\var typedef Tab<IGameKey> IGameKeyTab
\brief A Tab of IGameKey.
Uses <A HREF="sdk.chm::/html/idx_R_template_class_tab.htm">Max's Template class Tab</A>
*/
typedef Tab<IGameKey> IGameKeyTab;
//!A simple access class for controllers.
/*! IGameControl provides a simplified access to the various key frame controllers used throughout max. In max a controller
needs to be queried for the key interface and then its class ID checked before casting to the appropriate Key class. This class
provide the developer with all the keys based on the key type being asked for. As the game engine may only support certain type
of max controllers it is far more efficient for a developer to ask IGame for all the Bezier Postion keys then to check with max for
the controller type. This class also provides direct support for Euler Rotation controllers. The developer can use GetControlType
to see if the rotation is Euler and can then can use IGAME_EULER_X in the appropriate control access type to retrieve the keys.
\br
In 3ds max some controllers such as TCB, Linear and Bezier support direct access to their keys. Other controllers are more private
and usually base them selves on a float or Point3 controller. If there is no direct access then sampling is the easiest choice. IGame
supports two types - Full and Quick. Full samples across the full animation range, whilst Quick only samples where keys are found. The
limitation of Quick, is that it does not support IGAME_TM or controllers that do not set keys.
\sa <A HREF="sdk.chm::/html/idx_R_template_class_tab.htm">Max's Template class Tab</a>
\sa GMatrix
\sa IGameProperty
*/
class IGameControl
{
public:
enum MaxControlType{
IGAME_UNKNOWN, /*!<An unknown controller type*/
IGAME_MAXSTD, /*!<A Standard max key frame controller*/
IGAME_BIPED, /*!<A Biped Controller*/
IGAME_EULER, /*!<An Euler Controller*/
IGAME_ROT_CONSTRAINT, /*!<A Rotation constraint*/
IGAME_POS_CONSTRAINT, /*!<A Position constraint*/
IGAME_LINK_CONSTRAINT, /*!<A Link Constraint*/
IGAME_LIST, /*!<A List Controller*/
};
//! An enum of Euler Orderings
/*! These are the rotation orders for an Euler Controller
*/
enum EulerOrder{
XYZ, /*!<XYZ Ordering*/
XZY, /*!<XZY Ordering*/
YZX, /*!<YZX Ordering*/
YXZ, /*!<YXZ Ordering*/
ZXY, /*!<ZXY Ordering*/
ZYX, /*!<ZYX Ordering*/
XYX, /*!<XYX Ordering*/
YZY, /*!<YZY Ordering*/
ZXZ, /*!<ZXZ Ordering*/
BAD /*!<If this is not a Euler Controller*/
};
//! Return the Bezier Keys
/*! IGameControl will check the appropriate control and fill the IGameKeyTab with the Key data. To access the
keys you would look in the bezierKey Tab maintained by IGameKey.
\param &gameKeyTab The Tab to receive the data
\param Type The controller type (based on Transform style) to query. This can be one of the following\n
IGAME_POS\n
IGAME_ROT\n
IGAME_SCALE\n
IGAME_FLOAT\n
IGAME_POINT3\n
IGAME_EULER_X\n
IGAME_EULER_Y\n
IGAME_EULER_Z\n
\return TRUE is the controller was accessed successfully.
*/
virtual bool GetBezierKeys(IGameKeyTab &gameKeyTab,IGameControlType Type)=0;
//! Return the Linear Keys
/*! IGameControl will check the appropriate control and fill the IGameKeyTab with data
\param &gameKeyTab The tab to receive the data
\param Type The controller type to query. See IGameControl::GetBezierKeys for more info
\return TRUE is the controller was accessed successfully.
*/
virtual bool GetLinearKeys(IGameKeyTab &gameKeyTab, IGameControlType Type)=0;
//! Return the TCB Keys
/*! IGameControl will check the appropriate control and fill the IGameKeyTab with data
\param &gameKeyTab The tab to receive the data
\param Type The controller type to query. See IGameControl::GetBezierKeys for more info
\return TRUE is the controller was accessed successfully.
*/
virtual bool GetTCBKeys(IGameKeyTab &gameKeyTab, IGameControlType Type)=0;
//! Return the Sampled Keys
/*! IGameControl will sample the control based on the type supplied. It will sample the node TM , float or point3
controllers. The TM sample will be in the Coord System that you defined when initialising IGame. This method
will sample the controller across the complete animation range. The method of access can be provided (absolute and
relative) It is important to read the max sdk docs on Control::GetValue to understand the usage when used with non IGAME_TM
controllers. IGame will still however fill out the respective structures even when the max sdk docs mention Matrix3 access
It is set to Relative as default, as this was the default for IGAME_TM usage before the method changed. If you are sampling
anything else than IGAME_TM this should be set to false to behave like the max default and IGame before this change.
\param &sample The tab to receive the data
\param frameRate This is the number frames that the controller will be sampled at. It will be converted to Ticks internally
\param Type The controller type to query. This can be any of the standard type but also include IGAME_TM
\param Relative This defines whether the controller is sampled for relative or absolute values. It defaults to
relative true. Please read the max sdk section on Control::GetValue for details on the internal usage.
\return TRUE is the controller was accessed successfully.
*/
virtual bool GetFullSampledKeys(IGameKeyTab &sample, int frameRate, IGameControlType Type, bool Relative = true) =0;
//! Return the Sampled Keys
/*! IGameControl will sample the control based on the type supplied. It will sample float or point3
controllers. The TM sample will be in the Coord System that you defined when initialising IGame. This
method only samples the controller where a key is Set, so it will not support the IGAME_TM type. If the
controller does not support setting of keys, it will return false. This method will only sample the controller
at times where keys exist. This is useful to limit the data where controller can not be accessed directly
\param &sample The tab to receive the data
\param Type The controller type to query. This can be any of the standard type but also include IGAME_TM
\return TRUE is the controller was accessed successfully.
*/
virtual bool GetQuickSampledKeys(IGameKeyTab &sample, IGameControlType Type) =0;
//! Return an individual IGameKey
/*! fills out the supplied IGameKEy with the bezier data for the key index supplied
\param Type The controller type to query. See IGameControl::GetBezierKeys for more info
\param &bezKey
\param index The key to retrieve
\return TRUE if successful
*/
virtual bool GetBezierIGameKey(IGameControlType Type, IGameKey &bezKey, int index) =0 ;
//! Return an individual IGameKey
/*! fills out the supplied IGameKey with the TCB data for the key index supplied
\param Type The controller type to query. See IGameControl::GetBezierKeys for more info
\param &tcbKey
\param index The key to retrieve
\return TRUE if successful
*/
virtual bool GetTCBIGameKey(IGameControlType Type, IGameKey &tcbKey, int index)=0 ;
//! Return an individual IGameKey
/*! fills out the supplied IGameKey with the Linear data for the key index supplied
\param Type The controller type to query. See IGameControl::GetBezierKeys for more info
\param &linearKey
\param index The key to retrieve
\return TRUE if successful
*/
virtual bool GetLinearIGameKey(IGameControlType Type, IGameKey &linearKey, int index)=0;
//! The total number of keys for this controller
/*! This return the total number of keys for the controller supplied.
\param Type The controller type to query. See IGameControl::GetBezierKeys for more info
\return The total number of keys
*/
virtual int GetIGameKeyCount(IGameControlType Type)=0;
//!The controller type
/*!Retrieves what type of IGame Controller it is based on transformation style..
\param Type The controller to query. See IGameControl::GetBezierKeys for more info
\return The type of controller, It can be one of the following\n
IGAME_UNKNOWN\n
IGAME_MAXSTD\n
IGAME_BIPED\n
IGAME_ROT_CONSTRAINT\n
IGAME_POS_CONSTRAINT\n
*/
virtual MaxControlType GetControlType(IGameControlType Type)=0;
//!Access to the Constraints
/*! If a controller has a constraint system, then this will provide access to it
\param Type The controller to check. THis can be either of\
IGAME_POS\n
IGAME_ROT\n
\return A Pointer to IGameConstraint, or NULL if not available
*/
virtual IGameConstraint * GetConstraint(IGameControlType Type)=0;
//! The order of Rotation
/*! This provides a way of determining the order of rotation for Euler controllers. THis is important
so that the rotation can be rebuilt correctly on import.\nThis data is also important when accessing the
controller keys. You still access the Euler data bsed on X,Y and Z - but you would use the ordering to
work out the meaning of each controller. So if EulerOrder was ZXZ, then controller access would mean
x=z, y=x, z=z.
\return The order of Rotation. This can be a value from the EulerOrder
*/
virtual EulerOrder GetEulerOrder()=0;
/*! Get access to the actual max controller
\param Type This can be either\n
IGAME_POS\n
IGAME_ROT\n
IGAME_SCALE\n
\return The max controller
*/
virtual Control * GetMaxControl(IGameControlType Type)=0;
//! Access the list controller
/*! Access the n'th controller from the List controller.
\param index The index into the list controller
\param Type The Control type to access
\return An IGameControl interface
*/
virtual IGameControl * GetListSubControl(int index, IGameControlType Type)=0;
//! The number of controllers maintained by the list controller
/*! The number of controllers maintained by the list controller for the Controller type being queried
\param Type The controller to type
\return The number of controllers in the list controller
*/
virtual int GetNumOfListSubControls(IGameControlType Type)=0;
};
//! simple wrapper class for constraints
/*! A unified wrapper around the various constraints that are available in Max. There is access to the type of constraint
in use, plus easier access to the constraints. If further access it needed, the IPropertyContainer interface can be used
and additions made to property file used to access other data, as the source fro these constraints is available in the SDK.
*/
class IGameConstraint : public IExportEntity
{
public:
//! An enum of Max Constraint
/*! These are the constraints supported by IGame
*/
enum ConstraintType{
IGAME_PATH, /*!<Path Constraint*/
IGAME_ORIENTATION, /*!<Orientation Constraint*/
IGAME_LOOKAT, /*!<look At Constraint*/
IGAME_POSITION, /*!<Position Constraint*/
IGAME_LINK, /*!<A TM link constraint*/
IGAME_UNKNOWN, /*!<Unknown Constraint*/
};
//!Number of constraining Node
/*!The number of nodes in use by the Constraint system
\return The number fo nodes
*/
virtual int NumberOfConstraintNodes()=0;
//!The constraint Node
/*! The actual node of the index passed in that is working in the system
\param index The index of the node to retrieve
\return A pointer to IGameNode
*/
virtual IGameNode * GetConstraintNodes(int index)=0;
//!The influence of the bone
/*! This is the weight, or influence the specified node has in the constraint system. The index used here is the same
as the index used in GetConstraintNodes, otherwise the weights will not match. This has no effect for a Link Constraint
\param nodeIndex The node index to query
\return The weight value
*/
virtual float GetConstraintWeight(int nodeIndex)=0;
//!Get the start frame for the Link constraint
/*!This specifies when the link for the n'th node will start.
\param index The node index
\return The start frame for the node queried.
*/
virtual int GetLinkConstBeginFrame(int index) = 0;
//! The type of Constraint
/*! This defines the actual constraint being used on the controller
\return The type of max constraint. It can be one ConstraintType enum
*/
virtual ConstraintType GetConstraintType()=0;
};
#endif

View File

@ -0,0 +1,87 @@
/**********************************************************************
*<
FILE: IGameError.h
DESCRIPTION: Access to the IGame Errors.
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IGameError.h
\brief IGame Error Access.
Internal IGame methods maintain a global error state, these methods provide access to this data. Many IGame methods return
pointers or boolean status flags. If either of these are null or false, then you can use these method to access the error.
*/
#ifndef __IGAMEERROR__H
#define __IGAMEERROR__H
#include "max.h"
#pragma once
#define IGAMEEEXPORT __declspec( dllexport )
//!Enumeration of the Error codes produced by IGame
enum IGameError{
IG_NO_ERROR, /*!<No Error*/
IG_NO_KEY_INTERFACE, /*!<No Key interface for the controller*/
IG_INDEX_OUT_OF_BOUNDS, /*!<The index into the array is out of bounds*/
IG_ERROR_LOADING_PROPERTIES_FILE, /*!<Errors finding or parsing the Properties file*/
IG_COM_ERROR, /*!<Various COM errors*/
IG_NODE_NOT_FOUND, /*!<IGameNode not found*/
IG_UNSUPPORTED_CONT, /*!<The controller for the basic type is not supported*/
IG_OBJECT_NOT_SUPPORTED, /*!<Object not supported by IGame*/
IG_MAPPING_CHANNEL_ERROR, /*!<Mapping Channel not found*/
IG_MATERIAL_ERROR, /*!<Material not found*/
IG_NO_SKIN_MOD, /*!<No skin modifier*/
IG_NO_CONTROLLER_KEY, /*!<No Keys set on the controller*/
IG_NO_NORMALS, /*!<No indexed normal array created*/
};
//!Error callback
/*!Define a callback for error reporting. This will be called when ever an error has been reported by the system.
The developer can then call GetIGameErrorText to retrieve a more detailed error description. The callback can be
set by using SetErrorCallBack()
*/
class IGameErrorCallBack
{
public:
//!The error callback
/*!This needs to be implemented by the developer and is used by the system to report the error
\param error The error code of the last error
*/
virtual void ErrorProc(IGameError error)=0;
};
/*! Retrieve the last error set by the system
\returns The error code
*/
IGAMEEEXPORT IGameError GetLastIGameError();
/*! Get the detailed description of the last error set by the system
\returns The error text
*/
IGAMEEEXPORT TCHAR * GetLastIGameErrorText();
/*! Set the callback for the error logging
\param *proc A pointer the the IGameErrorCallback object created by the developer
*/
IGAMEEEXPORT void SetErrorCallBack(IGameErrorCallBack * proc);
/*! Resets the last error stored by the system. The global error will only change when IGame sets the last error.
Using this method will override this.
*/
IGAMEEEXPORT void ResetError();
#endif

View File

@ -0,0 +1,310 @@
/**********************************************************************
*<
FILE: IGameMaterial.h
DESCRIPTION: Material interfaces for IGame
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IGameMaterial.h
\brief IGame material and texture Interfaces.
*/
#ifndef __IGAMEMATERIAL__H
#define __IGAMEMATERIAL__H
#pragma once
#include "max.h"
#include "stdmat.h"
#include "IGameProperty.h"
// copied here from stdmat.h -- this is just to allow IGame to be self contained
#define ID_AM 0 // ambient
#define ID_DI 1 // diffuse
#define ID_SP 2 // specular
#define ID_SH 3 // shininesNs
#define ID_SS 4 // shininess strength
#define ID_SI 5 // self-illumination
#define ID_OP 6 // opacity
#define ID_FI 7 // filter color
#define ID_BU 8 // bump
#define ID_RL 9 // reflection
#define ID_RR 10 // refraction
#define ID_DP 11 // displacement
class IGameBitmapTex;
class IGameTextureMap;
class IGameUVGen;
//!Simple wrapper for max materials
/*! IGameMaterial An IGame Wrapper around a basic Material. It provides access to the basic material properties and
Bitmap Textures used by the material. Any material will be wrapped in this class, but only Standard Material is directly supported
with API access to the properties. If the material is not directly supported then the data can be access via the IPropertyContainer
interface.
\sa IGameProperty, IGameScene
*/
class IGameMaterial : public IExportEntity
{
public:
//! Is the material a Multi Material type - This could be for a Blend or Mix material
/*!
\return TRUE is Multi material
*/
virtual bool IsMultiType()=0;
//! Is the material a SubObject style Multi Material This could be for Max's Multi Subobject material
/*!
\return TRUE is a Subobject material
*/
virtual bool IsSubObjType()=0;
//! The material name as seen in the Material Editor
/*!
\return the name of the material
*/
virtual TCHAR * GetMaterialName()=0;
//! The number of sub materials this material maintains
/*! The value is used by IGameScene::GetSubMaterial
\return The number of Sub material
\sa GetSubMaterial
*/
virtual int GetSubMaterialCount()=0;
//! Access to any sub material.
/*! The sub material is any material used by a multi material For example, a Top/Bottom material the sub materials
would be the top and bottom
\param index Index into the submaterial
\return A Pointer to a IGameMaterial
\sa IGameMaterial, IGameScene::GetRootMaterial
*/
virtual IGameMaterial * GetSubMaterial(int index) =0;
//! For subobject materials get the MatID for the actual material.
/*! This value represents the MatID used on objects to define what faces receive this material
\param subIndex The index of the submaterial to retrieve
\return The MatID of the material
*/
virtual int GetMaterialID(int subIndex)=0;
//! Get the Ambient Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetAmbientData()=0;
//! Get the Diffuse Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetDiffuseData()=0;
//! Get the Emissive Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetEmissiveData()=0;
//! Get the Specular Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetSpecularData()=0;
//! Get the Opacity Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetOpacityData()=0;
//! Get the Glossiness Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetGlossinessData()=0;
//! Get the Specular Level Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetSpecularLevelData()=0;
//! Get the Emissive Amount Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetEmissiveAmtData()=0;
//! Get the number of Textures used by the material
/*!
\return The texture count.
*/
virtual int GetNumberOfTextureMaps()=0;
//!Access to the actual Texture Map
/*!
\param index The index to the Texture Map to retrieve
\return A pointer to a IGameTextureMap
*/
virtual IGameTextureMap * GetIGameTextureMap(int index) =0;
//! Access to the actual Max material definition
/*! This allows developer access to the complete max object if further data access is needed
\return A pointer to a standard max Mtl class
\sa IGameBitmapTex
*/
virtual Mtl * GetMaxMaterial()=0;
};
//!Simple wrapper for max textures
/*! A generic class that wraps all the max texture maps. This class directly supports the Bitmap Texture. This can be
tested for by calling IsObjectSupported. If it is not supported then access to the paramblocks, if defined can be obtained
by using the properties interface. The usual texture map properties including coordinate rollout access are provide here
*/
class IGameTextureMap : public IExportEntity
{
public:
/*! The name of the TextureMap as seen in the material editor/material browser.
\returns The name of the texture map
*/
virtual TCHAR * GetTextureName() = 0;
//!Provide access to the actual max definition
/*! This allows the developer to get hold of extra data such as Texture Transforms, specified from the
Coordinates rollout. You can use the max method of GetUVGen or GetXYZGen for more advanced access
\return A pointer to a max class Texmap
*/
virtual Texmap * GetMaxTexmap() = 0;
//!Access to the Coordinate Rollout
/*!If the developer needs access to the transforms applied to the texture, then this can be accessed here.
\returns A pointer to IGameUVGen
*/
virtual IGameUVGen * GetIGameUVGen()=0;
//! This returns the slot that the bitmap was found in.
/*! It uses the standard Max convention ID_BU for bump etc.. If this is -1 then it means either the hosting material
was not a standard material and the channel conversion could not be performed based on the active shader.
\return the Slot definition. This can be -1 signifying an unsupported material.
*/
virtual int GetStdMapSlot()=0;
//! The filename of the bitmap used by the Bitmap Texture
/*!
\return The name of bitmap file
*/
virtual TCHAR * GetBitmapFileName()=0;
//! Get the Clip U Data from a the Bitmap Texture
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetClipUData()=0;
//! Get the Clip V Data from a the Bitmap Texture
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetClipVData()=0;
//! Get the Clip H Data from a the Bitmap Texture
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetClipHData()=0;
//! Get the Clip W Data from a the Bitmap Texture
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetClipWData()=0;
};
//! class IGameBitmapTex
/*! An IGame wrapper class for basic Bitmap Texture access. Properties such as tiling are also provided
\sa IGameMaterial, IGameProperty
*/
/*
class IGameBitmapTex : public IExportEntity
{
public:
virtual BitmapTex* GetMaxBitmapTex()=0;
};
*/
//!simple wrapper for UVGen type data
/*!This is basically a helper class to access some data from the Coordinate Rollout panel. All data is extracted
from the paramblock, and access is provided by support methods that handle the Property Container Access. This data
is used to extract the actual Matrix used. However it can be animated, so using this data the matrix can be recontructed.
\sa IGameBitmapTex, IGameProperty
*/
class IGameUVGen : public IExportEntity
{
public:
//! Get the U Offset Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetUOffsetData() = 0;
//! Get the V Offset Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetVOffsetData() = 0;
//! Get the U Tiling Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetUTilingData() = 0;
//! Get the V Tiling Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetVTilingData() = 0;
//! Get the U Angle Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetUAngleData() = 0;
//! Get the V Angle Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetVAngleData() = 0;
//! Get the W Angle Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetWAngleData() = 0;
//! Get the actual UV transform.
/*! The UV transform that is the result of the Coordinate data.
\returns A GMatrix representation of the matrix
*/
virtual GMatrix GetUVTransform() = 0;
};
#endif

View File

@ -0,0 +1,282 @@
/**********************************************************************
*<
FILE: IGameModifier.h
DESCRIPTION: Modifier interfaces for IGame
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IGameModifier.h
\brief IGame Modifier Interfaces including direct access skin,physique and the morphing based operators.
High level access to MAX's modifier, with specific exposure for Skin and Morph modifiers. This includes the Morph compound object
*/
#ifndef __IGAMEMODIFIER__H
#define __IGAMEMODIFIER__H
#pragma once
#include "max.h"
#include "IGameProperty.h"
#include "IConversionManager.h"
class IGameProperty;
class IGameNode;
//!Simple wrapper for max modifiers
/*! This is an IGame wrapper for the basic max modifier class. This is provided so that the developer does not need
to walk the modifier stack and look for derived objects. An instance of this class is obtained from IGameObject class
\sa IGameObject
*/
class IGameModifier : public IExportEntity
{
private:
Modifier * gameMod;
INode * gameNode;
TSTR intName;
public:
//! An enum of Modifier Types
/*! These are the modifier known to IGame
*/
enum ModType{
IGAME_SKINNING, /*!<A skinning Modifier*/
IGAME_MORPHER, /*!<A Morphing based Modifier/Object*/
IGAME_GENERAL, /*!<A generic Max modifier*/
};
IGameModifier(Modifier * mod, INode * node);
/*! Return the Type of Modifier IGameModifier represents
\return The modifier type This is value from the ModType Enum
*/
virtual ModType GetModifierType() =0;
//!Get the modifier Name
/*!The name as viewed in StackView
\return The name
*/
virtual TCHAR * GetUIName() ;
//!Get the modifier Name
/*!The internal name of the modifier
\return The name
*/
virtual TCHAR * GetInternalName() ;
//! Access to the max modifier
/*! This is provided so the developer can get to any LocalModData that may have been added to the modifier
\return The pointer a standard max modifier.
*/
virtual Modifier * GetMaxModifier();
//! Access to the nodes this modifier is applied to,
/*! This enumerates all the nodes that are effected by this modifier.
\param &nodeList The tab to receive the node list. This will always be at least 1 in size, as it will contain the
original node.
*/
virtual void EffectedNodes(Tab<INode*> &nodeList);
//! Defines whether the modifier is a skinning modifier
/*!
\return TRUE if the modifier is a skinning modifier
*/
virtual bool IsSkin();
//! Defines whether the modifier is the morpher modifier
/*!
\return TRUE if the modifier is the morpher modifier
*/
virtual bool IsMorpher();
virtual ~IGameModifier();
};
//! A skin wrapper Class
/*! This class provides an unified interface to the various skin options present in Max. This include Physique and Skin
All the data from skin and physique are stored in the same way, but options exist to find out what skinning option was used
The vertex indexes used here are the same as those for the actual mesh, so this provides a one to one corelation.
\n
The version of the Character Studio that is used for IGame is 3.2.1 - Anything earlier will cause problems
\n
NB: The bones need to be parsed by IGame before this interface can be used.
\sa IGameModifier
*/
class IGameSkin : public IGameModifier
{
public:
//! An enum of Skin Modifier Types
/*! These are the Skin modifiers known to IGame
*/
enum SkinType{
IGAME_PHYSIQUE, /*!<A Physique Modifier*/
IGAME_SKIN, /*!<A Max skin Modifier*/
};
//! An enum of Vertex types
/*! These are the types used by the modifiers
*/
enum VertexType{
IGAME_RIGID, /*!<A RIGID vertex*/
IGAME_RIGID_BLENDED, /*!<A BLENED vertex*/
IGAME_UNKNOWN /*!<Error or unsupported vertex*/
};
//! the numbers of vertices effected by this instance of the modifier.
/*! If the modifier is attached to more than one node, then this will be the count of vertices on the current node
\return the number of vertices
*/
virtual int GetNumOfSkinnedVerts()=0;
//! the numbers of bones effecting the vertex
/*!
\param vertexIndex The index of the vertex
\return the number of bones
*/
virtual int GetNumberOfBones(int vertexIndex)= 0;
//! Get the weight for the bone and vertex index passed in
/*!
\param vertexIndex The index of the vertex
\param boneIndex The bone index
\return The weight
*/
virtual float GetWeight(int vertexIndex,int boneIndex) = 0;
//! Get the max bone effecting the vertex
/*!
\param vertexIndex The index of the vertex
\param boneIndex The bone index
\return A pointer to a max INode for the bone
*/
virtual INode * GetBone(int vertexIndex,int boneIndex)= 0;
//! Get the IGameNode equivalent of the bone effecting the vertex
/*!
\param vertexIndex The index of the vertex
\param boneIndex The bone index
\return A pointer to a IGameNode for the bone
*/
virtual IGameNode * GetIGameBone(int vertexIndex,int boneIndex)= 0;
//! Get the IGameNode ID equivalent of the bone effecting the vertex
/*! The IGameNode ID can be used if you pass out the nodes first
// and use this value as an index when you import
\param vertexIndex The index of the vertex
\param boneIndex The bone index
\return A Node ID
*/
virtual int GetBoneID(int vertexIndex, int boneIndex) =0;
//! Specifies whether the Vertex is either Rigid or blended
/*!
\param vertexIndex The vertex to query
\return The vertex type. It can be one of the following\n
IGAME_RIGID\n
IGAME_RIGID_BLENDED\n
*/
virtual VertexType GetVertexType(int vertexIndex)=0;
//! What skinning technique is used
/*! This can be used to find out whether Max's skin or Physique was used
\return The skinning type. It can be one of the following\n
IGAME_PHYSIQUE\n
IGAME_SKIN\n
*/
virtual SkinType GetSkinType()=0;
//! The bone TM when skin was added
/*! This provides access to the intial Bone TM when the skin modifier was applied.
\param boneNode THe IGameNode bone whose matrix is needed
\param &intMat THe matrix to receive the intial TM
\return True if the bone was found
*/
virtual bool GetInitBoneTM(IGameNode * boneNode, GMatrix &intMat)=0;
//! The bone TM when skin was added
/*! This provides access to the intial Bone TM when the skin modifier was applied.
\param boneNode The Max INode bone whose matrix is needed
\param &intMat The matrix to receive the intial TM
\return True if the bone was found
*/
virtual bool GetInitBoneTM(INode * boneNode, GMatrix &intMat)=0;
//! The original TM for the node with skin.
/*! This provides access to the intial node TM when the skin modifier was applied.
\param &intMat The matrix to receive the intial TM
*/
virtual void GetInitSkinTM(GMatrix & intMat) = 0;
IGameSkin(Modifier * mod, INode * node):IGameModifier(mod, node){};
};
//! An IGame wrapper around the Morph Compound Object and the Morpher Modifier
/*!
*/
class IGameMorpher : public IGameModifier
{
public:
//! A morph type enumeration
/*! This provides details about the type of morph operator being accessed
*/
enum MorphType{
MORPHER_OBJECT, /*!<A Morph Compound Object*/
MORPHER_MODIFIER, /*!<A Morph Modifier*/
};
//! The number of morph Targets
/*! The number of targets used by the morpher. There is a slight difference between the morph methods. The compound
morpher include the original object as a target, where as the morpher modifier only show the actual physical targets. So
to provide the same result the compound will show one more target
\returns The number of morph targets
*/
virtual int GetNumberOfMorphTargets() = 0;
//! The morph target used by the morpher
/*! This method provides the actual morph target used by the system. In the case of the compound object, it does its best to find the node
but, the compound morpher only exposes the actual "Object" and in max the object could have multiple nodes.
\param index The index of the target to retrieve
\returns An IGameNode representing the target
*/
virtual IGameNode * GetMorphTarget(int index) = 0;
//! The weight associated with the target
/*!
\param index The index of the target whose weight is being accessed
\returns An IGameControl os the keys. The actual value of the keys provides the weight value - this value can not be consider normalised
*/
virtual IGameControl * GetMorphWeight(int index)= 0;
//! The type of morpher represented by this interface - this can either be the Compound Morpher or the Morpher Modifier
virtual MorphType GetMorphType() = 0;
IGameMorpher(Modifier * mod, INode * node):IGameModifier(mod, node){};
};
//! A generic Modifier class
/*! Any modifier that is not known to IGame will be implemented as a "Generic" modifier, so that basic access can be provided
*/
class IGameGenMod : public IGameModifier
{
public:
IGameGenMod(Modifier * mod, INode * node):IGameModifier(mod, node){};
};
#endif

View File

@ -0,0 +1,905 @@
/**********************************************************************
*<
FILE: IGameObject.h
DESCRIPTION: Object interfaces for IGame
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
/*!\file IGameObject.h
\brief IGame supported Object Interfaces.
*/
#ifndef __IGAMEOBJECT__H
#define __IGAMEOBJECT__H
#pragma once
#include "Max.h"
#include "IGameProperty.h"
#define IGAMEEXPORT __declspec( dllexport )
class IGameNode;
class IGameModifier;
class IGameSkin;
//!Simple wrapper for max objects
/*! This is heart of the interaction with Max objects. Max objects are converted to IGame objects to provide
simpler interfaces. Specific support is given to Meshes, Splines, Helper (including bones) and Cameras. Any object
that is not supported by IGame directly is supported as a generic object, so that properties can be extracted easily. At the present time IGame only
supports Geom Objects that can be converted to a Tri Object.
\n
A note about XRef items. IGame will search out XRef Objects and performs the operations on the original Object, so any
modifiers will be extracted and the original object data such as mesh will be evaluated. Currently IGame does not support
the actual XRefObject in the scene, so external file names and proxies are not available.
\n
NB: Some of the interfaces returned by IGameObject require that the nodes be parsed by IGame first.
\sa IGameNode, IGameMesh, IGameLight, IGameCamera, IGameSupportObject
\sa IExportEntity
*/
class IGameObject : public IExportEntity
{
Tab <IGameModifier *> gameModTab;
Object * gameObject;
protected:
INode * gameNode;
void SetNode (INode * n);
public:
//!default constructor
IGameObject();
//! Various IGame Object types
/*! These are the objects supported by IGame
*/
enum ObjectTypes{
IGAME_UNKNOWN, /*!< An unknown object*/
IGAME_LIGHT, /*!< A Light Object */
IGAME_MESH, /*!< A Mesh Object */
IGAME_SPLINE, /*!< A Spline Object */
IGAME_CAMERA, /*!< A Camera Object */
IGAME_HELPER, /*!< A Helper Object */
IGAME_BONE, /*!< A Bone Object */
IGAME_IKCHAIN /*!< An IK Chain Object*/
};
//! Various Max Object types
/*! These are Max object - Developers can use this to cast the Object pointer to one of the relevent Max classes
*/
enum MaxType{
IGAME_MAX_UNKNOWN, /*!< An unknown object*/
IGAME_MAX_GEOM, /*!< A Geom Object*/
IGAME_MAX_SHAPE, /*!< A Shape Object*/
IGAME_MAX_LIGHT, /*!< A Light Object*/
IGAME_MAX_CAMERA, /*!< A Camera Object*/
IGAME_MAX_BONE, /*!< A Bone Object*/
IGAME_MAX_HELPER, /*!< A Helper Object*/
};
//! The bounding box
/*! The bounding box of the object
\param bb The box3 to receive the value
*/
IGAMEEXPORT void GetBoundingBox(Box3 & bb);
//!Is this object renderable
/*!
\return TRUE if it is renderable
*/
IGAMEEXPORT bool IsRenderable();
/*! Return the Type of IGameObject it represents
\return The object type This is value from the ObjectTypes Enum
*/
virtual ObjectTypes GetIGameType() =0;
//IGameObject();
/*! This provide access to the actual max object, if the developer wants further direct access
\return a pointer to a max Object class
*/
IGAMEEXPORT Object * GetMaxObject();
/*! This lets the developer know what type of object - Light, Geom, Helper etc...
This is different to the IGame types, as these may group more than one type of max object together
the information here can be used to cast Object returned from GetMaxObject to the appropriate class.
\return The type of max object. THis is defined as the MaxObject enum
*/
IGAMEEXPORT MaxType GetMaxType() ;
/*! The number of modifiers active on this object
\return The number of modifiers
*/
IGAMEEXPORT int GetNumModifiers();
/*! Get a pointer to the IGame representation of the modifier
\param index The index of the modifier to return
\return A pointer to the IGameModifier
*/
IGAMEEXPORT IGameModifier * GetIGameModifier(int index);
/*! The IGameObject constructor
\param *node The max node to initialise
*/
IGAMEEXPORT IGameObject(INode * node);
//! Does this object cast shadows
/*!
\return true if is casts shadows
*/
IGAMEEXPORT bool CastShadows();
/*! Is this object skinned with either Physique of Skin
\return TRUE if skinned
*/
IGAMEEXPORT bool IsObjectSkinned();
/*! Provide access to the skin interface
\return a pointer to IGameSkin or NULL if not present
*/
IGAMEEXPORT IGameSkin * GetIGameSkin();
/*! Is this an XRef Object. This will in future allow access to additional XRef data, but for now you just know
what you are getting
\returns TRUE if it is an XRef Object
*/
IGAMEEXPORT bool IsObjectXRef();
/*! Get the ObjectTM. This is the matric needed to calculated world space
\return A matrix containing the Object TM. Use this to calculate world space.
*/
IGAMEEXPORT GMatrix GetIGameObjectTM();
//! This will tell the object to extract the max data into IGame data
/*! Some extraction processes are time and memory consuming. This method allows the developer to specify when
they want the data to be converted - this prevents any unwanted data being converted. This is important for
IGameMesh class - if you are just after parameter data, you don't want the whole vertex array being sorted. Calling
this tells the object that you want the data converted.
\returns It will return FALSE when data has not been converted, this object should not be exported. Usually this is
due to a standin or in the case of a GeomObject, it can't be converted to a Tri Object.
*/
virtual bool InitializeData(){return false;}
virtual ~IGameObject() = 0;
};
//!Simple wrapper for light objects
/*! An IGame Wrapper around Max's lights. This is a generic interface for all the lights
*/
class IGameLight : public IGameObject {
public:
//! Various Light types used by Max
enum LightType{
IGAME_OMNI, /*!< Omnidirectional Light*/
IGAME_TSPOT, /*!< Targeted Spot Light*/
IGAME_DIR, /*!< Directional Light*/
IGAME_FSPOT, /*!< Free spot Light*/
IGAME_TDIR, /*!< Targeted Directional Light*/
};
//! Get the Light Color Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightColor()=0;
//! Get the Light Multiplier Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightMultiplier()=0;
//! Get the Light Attenuation End Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightAttenEnd()=0;
//! Get the Light Attenuation Start Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightAttenStart()=0;
//! Get the Light Falloff Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightFallOff()=0;
//! Get the Light Hot spot Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightHotSpot()=0;
//! Get the Aspect Ratio Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetLightAspectRatio()=0;
//! Get the Light type as defined in the UI
/*!
\return the Light Type - This can be OMNI_LIGHT etc..
*/
virtual LightType GetLightType()=0;
/*! Does the light overshoot
\return TRUE if the light supports overshoot
*/
virtual int GetLightOvershoot()=0;
/*! The shape of the light
\return The shape can be one of the following
\n
RECT_LIGHT\n
CIRCLE_LIGHT\n
*/
virtual int GetSpotLightShape()=0;
/*! If the light is of type Spot light then this provides access to the target
\return a pointer to IGameNode for the target. This will be NULL for non target lights
*/
virtual IGameNode * GetLightTarget()=0;
/*! Is the light on or not
\return True if it is on
*/
virtual bool IsLightOn() = 0;
/*! This determines whether the exclude list actually maintains a list that is infact included by the light
\return TRUE if it maintains an included list
*/
virtual bool IsExcludeListReversed()=0;
/*! Get the number of excluded nodes from the light. This list contains nodes that should not be included in lighting
calculations. It can also contain a list of only those lights that SHOULD be included. This all depends on the state
of IsExcludedListReversed.
\return The total number of excluded nodes
*/
virtual int GetExcludedNodesCount() = 0;
/*! Get the excluded node based on the index pass in
\param index The index of the node to access
\return An IGameNode pointer for the excluded node
*/
virtual IGameNode * GetExcludedNode(int index) = 0;
};
//!Simple wrapper for camera objects
/*! An IGame Wrapper around Max's cameras. This is a generic interface for all the cameras
*/
class IGameCamera : public IGameObject {
public:
//! Get the Camera Field of View Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetCameraFOV()=0;
//! Get the Camera Far Clip plane Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetCameraFarClip()=0;
//! Get the Camera Near Clip plane Data
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetCameraNearClip()=0;
//! Get the Camera Target Distance
/*!
\return A pointer to IGameProperty
*/
virtual IGameProperty * GetCameraTargetDist()=0;
/*! If the camera is target camera then this provides access to the target
\return a pointer to IGameNode for the target. This will be NULL for non target cameras
*/
virtual IGameNode * GetCameraTarget()=0;
};
//!Simple extension to the max Face class
/*!simple class to store extended data about the face. The indexing works as a regular
max Face but mirroring has been taken account of, in the construction.
*/
class FaceEx
{
public:
//! Index into the vertex array
DWORD vert[3];
//! Index into the standard mapping channel
DWORD texCoord[3];
//! Index into the normal array. <b>In 3ds max 6 and above this can be used to index the Binormal and Tangent arrays</b>\n
/*!
This is ONLY used if SetCreateOptimizedNormalArray() has been called.
*/
DWORD norm[3];
//! Index into the vertex color array
DWORD color[3];
//! Index into the vertex illumination array
DWORD illum[3];
//! Index into the vertex alpha array
DWORD alpha[3];
//! The smoothing group
DWORD smGrp;
//! The material ID of the face
int matID;
//! additional flags
DWORD flags;
//! index of corresponding face in the original mesh
int meshFaceIndex;
};
//!Simple wrapper for tri mesh objects
/*! An IGame wrapper around the standard max Mesh class. It provides unified support for Vertex colors and normals
Mirroring is taken into account so the data you retrieve is swapped to take this into account.\n
Many of the geometry lookups used by IGameObject use the Max Template Class Tab. You can use the Tab returned to find out whether the call
was successful as the Tab count would be greater then zero.\n
In 3ds max 6 and above version of IGame, Tangent space is calculated. For this to work, each face <b>must</b> be a member of a smoothing group.
*/
class IGameMesh: public IGameObject {
public:
//! Number of Vertices
/*! The total number of vertices found in the mesh
\return The number of Vertices
*/
virtual int GetNumberOfVerts()=0;
//! Number of Texture Vertices
/*! The total number of Texture vertices found in the mesh
\return The number of TextureVertices
*/
virtual int GetNumberOfTexVerts()=0;
//!Get the actual Vertex
/*! Get the vertex at the specified index. This is in the World Space Coordinate System
\param index The index of the vertex
\param ObjectSpace Defines whats space the vertex is in. This defaults to World space to be compatible
with previous versions \return A Point3 representing the position of the vertex
*/
virtual Point3 GetVertex(int index, bool ObjectSpace = false)=0;
//!Get the actual Vertex
/*! Get the vertex at the specified index. This is in the World Space Coordinate System
\param index The index of the vertex
\param &vert A Point3 to receive the data
\param ObjectSpace Defines whats space the vertex is in. This defaults to World space to be compatible
with previous versions
\return TRUE if successful
*/
virtual bool GetVertex(int index, Point3 & vert, bool ObjectSpace = false) = 0;
//!Get the actual Texture Vertex
/*! Get the Texture vertex at the specified index
\param index The index of the Texture vertex
\return A Point2 representing the Texture vertex
*/
virtual Point2 GetTexVertex(int index)=0;
//!Get the actual Texture Vertex
/*! Get the Texture vertex at the specified index
\param index The index of the Texture vertex
\param &tex A Point2 to receive the data.
\return TRUE if successful
*/
virtual bool GetTexVertex(int index, Point2 & tex) = 0;
//! Specifies whether normals are calculated based on face angles
/*! To tell IGame to calculate normals based on a weight made from the angle of the edges at the vertex, the developer
needs to call this <b><i>before</i></b> IGameObject::InitializeData() is called. The default is not to use weighted normals
which is also the default in 3ds max 4
*/
virtual void SetUseWeightedNormals() = 0;
//! Number of Normals
/*! The total number of normals found in the mesh
\return The number of normals
*/
virtual int GetNumberOfNormals()=0;
//!Get the actual normal
/*! Get the normal at the specified index.This is only available if SetCreateOptimizedNormalList()
has been set. IGame will return set an error, and return Point3(0,0,0);
\param index The index of the normal
\return A Point3 representing the normal
*/
virtual Point3 GetNormal(int index)=0;
//!Get the actual normal
/*! Get the normal at the specified index. This is only available if SetCreateOptimizedNormalList()
has been set. IGame will return set an error, and false will be returned
\param index The index of the normal
\param &norm A Point3 to receive the data.
\return TRUE if successful
*/
virtual bool GetNormal(int index, Point3 & norm) = 0;
//!Get the normal based on face and corner
/*!
\param faceIndex The index into the face array
\param corner The vertex whose normal is requested
\param &norm A point3 to receive the data
\return TRUE if successful
*/
virtual bool GetNormal(int faceIndex, int corner, Point3 & norm) = 0;
//!Get the normal based on face and corner
/*!
\param face The pointer of the face whose normals are to be accessed
\param corner The vertex whose normal is requested
\return A Point3 containing the normal
*/
virtual Point3 GetNormal ( FaceEx * face, int corner) = 0;
//!Get the normal based on face and corner
/*!
\param face The pointer of the face whose normals are to be accessed
\param corner The vertex whose normal is requested
\param &norm A point3 to receive the data
\return TRUE if successful
*/
virtual bool GetNormal(FaceEx * face, int corner, Point3 &norm) =0;
//!Get the normal based on face and corner
/*!
\param faceIndex The index into the face array
\param corner The vertex whose normal is requested
\return A Point3 containing the normal
*/
virtual Point3 GetNormal(int faceIndex, int corner) = 0;
//! Number of Illuminated Vertices
/*! The total number of Illuminated Vertices found in the mesh
\return The number of Illuminated Vertices
*/
virtual int GetNumberOfIllumVerts()=0;
//! Number of Alpha Vertices
/*! The total number of Alpha Vertices found in the mesh
\return The number of Alpha Vertices
*/
virtual int GetNumberOfAlphaVerts()=0;
//! Number of Vertex Colors
/*! The total number of Vertex Colors found in the mesh
\return The number of Vertex Colors
*/
virtual int GetNumberOfColorVerts()=0;
//!Get the actual Color Vertex
/*! Get the color vertex at the specified index
\param index The index of the color vertex
\return A Point3 representing the color of the vertex. This will be Point3(-1,-1,-1) if the index is invalid
*/
virtual Point3 GetColorVertex(int index)=0;
//!Get the actual Color Vertex
/*! Get the color vertex at the specified index
\param index The index of the color vertex
\param &col A Point3 to receive the color data
\return TRUE if successful
*/
virtual bool GetColorVertex(int index, Point3 & col) = 0;
//!Get the actual Alpha Vertex
/*! Get the Alpha vertex at the specified index
\param index The index of the Alpha vertex
\return A float representing the Alpha value of the vertex. This will be -1 if the index is invalid
*/
virtual float GetAlphaVertex(int index)=0;
//!Get the actual Alpha Vertex
/*! Get the Alpha vertex at the specified index
\param index The index of the Alpha vertex
\param &alpha A float to receive the value
\return TRUE if successful
*/
virtual bool GetAlphaVertex(int index, float & alpha) = 0;
//!Get the actual Illuminated Vertex
/*! Get the Illuminated vertex at the specified index
\param index The index of the Illuminated vertex
\return A float representing the Illuminated value of the vertex. This will be -1 if the index is invalid
*/
virtual float GetIllumVertex(int index)=0;
//!Get the actual Illuminated Vertex
/*! Get the Illuminated vertex at the specified index
\param index The index of the Illuminated vertex
\param &illum A float to receive the data
\return TRUE if successful
*/
virtual bool GetIllumVertex(int index, float &illum) = 0;
//! The num of faces in the mesh
/*! The total number of faces contained in the mesh
\return The number of faces
*/
virtual int GetNumberOfFaces()=0;
//! The actual face
/*! The face represented by the index. The data in FaceEx can be used to lookup into the various arrays
\param index The index of the face to return
\return A pointer to FaceEx, or NULL if an invalid index is passed in
*/
virtual FaceEx * GetFace(int index)=0;
//!The number of verts in a mapping channel
/*! Get the number of the vertices for a particular mapping channel
\param ch The mapping channel to use
\return The number of verts
*/
virtual int GetNumberOfMapVerts(int ch) = 0;
//! The mapping vert
/*! Get the actual mapping vert for the channel
\param ch The channel to query
\param index The vertex index
\return The actual mapping data. This will be zero if the Mapping channel is not found
*/
virtual Point3 GetMapVertex(int ch, int index) = 0;
//! The mapping vert
/*! Get the actual mapping vert for the channel
\param ch The channel to query
\param index The vertex index
\param &mVert A Point3 to receive the data
\return TRUE if successful
*/
virtual bool GetMapVertex(int ch, int index, Point3 & mVert) = 0;
//!The number of Binormals <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*! Get the number of the binormals
\return The number of binormals
*/
virtual int GetNumberOfBinormals() = 0;
//!Get the actual Binormal <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*! Get the Binormal at the specified index
\param index The index of the Binormal
\return A Point3 representing the Binormal
*/
virtual Point3 GetBinormal(int index)=0;
//!Get the actual Binormal <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*! Get the Binormal at the specified index
\param index The index of the Binormal
\param biNormal A point3 to receive the Binormal
\return TRUE if successful
*/
virtual bool GetBinormal(int index, Point3 & biNormal) = 0;
//!The number of Tangents <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*! Get the number of the Tangents
\return The number of Tangents
*/
virtual int GetNumberOfTangents() = 0;
//!Get the actual Tangent <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*! Get the Tangent at the specified index
\param index The index of the Tangent
\return A Point3 representing the Tangent
*/
virtual Point3 GetTangent(int index)=0;
//!Get the actual Tangent <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*! Get the Tangent at the specified index
\param index The index of the Tangent
\param Tangent A point3 to receive the Tangent
\return TRUE if successful
*/
virtual bool GetTangent(int index, Point3 & Tangent) = 0;
//! The the active mapping channels
/*! Extracts the active mapping channels in use by the object. This will not include the standard channels such as
Texture Coordinates and Vertex Colors, Illum, and Alpha.
\return A tab containing the active Mapping channels. The size of the Tab will be zero if no channels were found
*/
virtual Tab<int> GetActiveMapChannelNum() = 0;
//! Get the face index into the mapping channel array
/*! Get the actual index into the mapping channel for the supplied face.
\param ch The mapping channel to use
\param faceNum The face to use
\param index An array of three indices to receive the indexing into the vertices
\return TRUE if the channel was accessed correctly. False will mean that the channel was not present.
*/
virtual bool GetMapFaceIndex(int ch, int faceNum, DWORD *index) = 0;
//!Get all the smoothing groups found on a mesh
/*!
\return A tab containing the smoothing groups. If the count is zero it means that no smoothing groups were found
*/
virtual Tab<DWORD> GetActiveSmgrps() = 0;
//!Get all the material IDs found on a mesh
/*!
\return A tab containing the Material IDs
*/
virtual Tab<int> GetActiveMatIDs() = 0;
//!Get the face for a particular smoothing group
/*! Get all the faces belonging to a particular smoothing group
\param smgrp THe smoothing group to use
\return A tab containing all the faces
*/
virtual Tab<FaceEx *> GetFacesFromSmgrp(DWORD smgrp) = 0;
//!Get the face index for a particular smoothing group
/*! Get all the faces belonging to a particular smoothing group as a set of indexes into the main face list
\param smgrp THe smoothing group to use
\return A tab containing all the indexes
*/
virtual Tab<int> GetFaceIndexFromSmgrp(DWORD smgrp)=0;
//! Get the faces for a particular Material ID
/*! Get all the faces belonging to a particular material ID
\param matID The material ID to use
\return A tab containing all the faces
*/
virtual Tab<FaceEx *> GetFacesFromMatID(int matID) = 0;
//!The actual material used by the Face
/*!This will provide access to the material used by the Face whose index is passed in. This means the mesh can be broken down
into smaller meshes if the material is a subObject material. This can be used in conjunction with GetFacesFromMatID() to rebuild a face
with the material assigned via a material ID.
\param FaceNum The index of the face whose material is needed.
\returns A pointer to a material. The is the actual material, so in the case of the SubObject material the material whose mat ID
matches.
*/
virtual IGameMaterial * GetMaterialFromFace(int FaceNum) = 0;
//!The actual material used by the Face
/*!This will provide access to the material used by the Face. This means the mesh can be broken down
into smaller meshes if the material is a subObject material. This can be used in conjunction with GetFacesFromMatID() to rebuild a face
with the material assigned via a material ID.
\param face A pointer to the face whose material is needed.
\returns A pointer to a material. The is the actual material, so in the case of the SubObject material the material whose mat ID
matches.
*/
virtual IGameMaterial * GetMaterialFromFace(FaceEx * face) = 0;
//! The actual max Mesh representation
/*! The Mesh pointer used by max. This allows the developer further access if required to the mesh or data structures
\return A Mesh pointer
*/
virtual Mesh * GetMaxMesh()=0;
//! Access the color data for the face specified.
/*! The surface color can be obtained from the RenderedSurface interface. Before this function can be used the Surface
data needs to be initialised before hand. Please see the IGameRenderedSurface for more information
\param FaceIndex The face index whose color is being evaluated
\param *result A pointer to a Color Array that receives the 3 vertices for the face. This should initialised as Color res[3]
\return TRUE is successful. Possible errors include the object not being renderable or is hidden.
\sa IGameRenderedSurface
*/
virtual bool EvaluateSurface(int FaceIndex, Color * result) = 0;
//!Tell IGame to create a flattened Normals Array <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*!IGame can create a a flattened list of normals for export much like Vertices and Texture Coordinates. However this
operation can be expensive especially on large objects with mixed smoothing groups. This flag determines whether this is
available for use. <b>If it is not set, then vertex normals can only be looked up on a per face basis </b>.<br><br>
Due to some internal changes, this method is not really needed. However some builds of IGame did require it so it has
been kept in. This method should ideally "ALWAYS" be called so as to provide the full IGameMesh support.
*/
virtual void SetCreateOptimizedNormalList() = 0;
};
//!Simple wrapper for spline knots
/*! An IGame wrapper for Knot information
*/
class IGameKnot
{
public:
enum KnotType{
KNOT_AUTO, /*!< Auto generate Knot*/
KNOT_CORNER, /*!< A corner knot*/
KNOT_BEZIER, /*!< A bezier knot*/
KNOT_BEZIER_CORNER, /*!< A bezier corner knot*/
};
enum KnotData{
KNOT_INVEC, /*!< The in vector*/
KNOT_OUTVEC, /*!< The out vector*/
KNOT_POINT, /*!< The actual knot position*/
};
//! Get the in vector
/*!
\return the in vector
*/
virtual Point3 GetInVec()=0;
//! Get the out vector
/*!
\return the out vector
*/
virtual Point3 GetOutVec()=0;
//! Get actual knot position
/*!
\return The knot position
*/
virtual Point3 GetKnotPoint()=0;
//! The type of knot
/*!
\return The knot as a KnotType
*/
virtual KnotType GetKnotType()=0;
//! The knot controller
/*! Get the actual IGameController for the knot - this provides access to any animated data
\param kd THe knot to access
\return The controller for the specified knot
*/
virtual IGameControl * GetKnotControl(KnotData kd)=0;
};
//! A wrapper class for splines
/*! This provides information about the actual splines making up the spline object in Max. Access to the knot data is
provided with this class
*/
class IGameSpline3D
{
public:
//! Access the individual knot
/*!
\return The knot for the index passed in
*/
virtual IGameKnot * GetIGameKnot(int index) = 0;
//! The knot count
/*!
\return The total number of knots in the spline
*/
virtual int GetIGameKnotCount()=0;
};
//!Simple wrapper for Splines
/*! An IGame wrapper around the standard Max spline object. IGameSpline acts as a container for all the individual splines
that make up the object
*/
class IGameSpline : public IGameObject
{
public:
//! The number of splines
/*! The number of splines that make up this object
\return The total number of splines
*/
virtual int GetNumberOfSplines()=0;
//! Get an individual Spline
/*! Get a spline based on the index.
\param index The index of the spline to access
\return a pointer to the spline.
*/
virtual IGameSpline3D * GetIGameSpline3D(int index) =0;
//! Get the Max object
/*!
\return The ShapeObject used by max
*/
virtual ShapeObject * GetMaxShape()=0;
// IGameSpline(INode * node) : IGameObject(node){};
};
//!Simple wrapper for IKChains
/*! An IGame wrapper around the IKChain object.
\br
This object be used as a basis for character export. All nodes used in the chain are maintained by the IGameIKChain
interface. This allows animation to be exported based on whether it is in IK or FK mode. If the IK is enabled then
the IGameControl retrieved from the IGameNode will be that of the End Effector for the chain. If it is in FK mode then
the IGameControl from the nodes in the chain would be used for the FK calculation.
*/
class IGameIKChain : public IGameObject
{
public:
//! The number of nodes that make up the chain
/*!
\return The number of nodes in the chain
*/
virtual int GetNumberofBonesinChain() =0;
//! Access to the n'th node in the chain
/*!
\param index The index of the node to access
\return An IGameNode representation of the node
*/
virtual IGameNode * GetIGameNodeInChain(int index) =0;
//! The swivel data
/*! The swivel data used in the IK calculation
\return The IGameProperty for the swivel data
*/
virtual IGameProperty * GetSwivelData() = 0;
//! The controller for the IK enable
/*! Access to the Enabled controller - this defines whether IK or FK are used. When IK the end effector
is used to control the transforms, in FK the individual nodes can be positioned independent of the effector
\return An IGameControl pointer for the Enabled controller. This controller does not have direct access, so
should be sampled using IGAME_FLOAT
*/
virtual IGameControl * GetIKEnabledController() = 0;
};
//! Base class for "support" objects, such as bone, helpers dummies etc..
/*!These types of objects are really supported for their parameter access. However a pointer
to the Mesh representation is provided if for example bone geometry is needed. This class can be used
to check for BONES, DUMMYS etc..
*/
class IGameSupportObject : public IGameObject
{
public:
//! Access to the mesh
/*! If required access to the mesh is provided here
\return A pointer to an IGameMesh object
*/
virtual IGameMesh * GetMeshObject() = 0;
//!Is the bone a funky r4 bone with wings ?
/*!
\return TRUE if it is an R4 bone.
*/
virtual bool PreR4Bone() = 0;
};
//! An interface into an XRef Object Currently not implemented
class IGameXRefObject : public IGameObject
{
public:
virtual TCHAR * GetOriginalFileName() = 0;
};
//! A Generic Object for IGame
/*! This object represents any object that is unknown to IGame - this could be a new pipeline object for example
It will return IGAME_UNKOWN for its ObjectTypes
*/
class IGameGenObject : public IGameObject
{
public:
virtual IPropertyContainer * GetIPropertyContainer()=0;
};
#endif

View File

@ -0,0 +1,255 @@
/**********************************************************************
*<
FILE: IGameProperty.h
DESCRIPTION: IGameProperty interfaces for IGame
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 02/02/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
#ifndef __IGAMEPROPERTY__H
#define __IGAMEPROPERTY__H
#pragma once
/*!\file IGameProperty.h
\brief IParamBlock and IParamBlock2 property access.
All properties found by IGame are stored as an IGameProperty. This gives developers a unified way of accessing
IParamBlock and IParamBlock2 based properties used in max
*/
enum PropType{
IGAME_UNKNOWN_PROP, /*!<Unkown property Type*/
IGAME_FLOAT_PROP, /*!<Property of Type float*/
IGAME_POINT3_PROP, /*!<Property of Type Point3*/
IGAME_INT_PROP, /*!<Property of Type int*/
IGAME_STRING_PROP, /*!<Property of Type TCHAR*/
IGAME_POINT4_PROP, /*!<Property of Type Point4*/
};
class IGameControl;
//!Main property definition
/*! IGameProperty provides a wrapper around the standard max ParamBlock system. It works for both
IParamBlock and IParamBlock2. It provides access to IGameControl and also data access for floats, ints, and Point3
It performs the type checking for you so the Paramblock system will not assert if you ask for the wrong data type
The properties the IGame stores are defined in the IGameProp.XML file. The data there is used to find the parameters
in the various paramblock hosted by the objects,
\n
The data is provided by look up from the IGameProperties.xml file. This provides the properties that IGame will look for in
its evaluation. This included User Properties and general Paramblock data.
*/
class IGameProperty
{
public:
//!The name of the Property
/*! This is the name defined in the XML file
\return The parameter name
*/
virtual TCHAR * GetName() =0;
//! Is the parameter a IParamBlock2 or not
/*!
\return TRUE if IParamBlock2 else it is a IParamBlock
*/
virtual bool IsPBlock2()=0;
//! Is is animated
/*! Use this to decided whether you want to access the controller
\return TRUE if animated
*/
virtual bool IsPropAnimated()=0;
//! The controller for the Property
/*!
\return A pointer to IGameContorl
*/
virtual IGameControl * GetIGameControl() =0;
//! Direct access to the IParamBlock2
/*! for those who like a little more control
\return a pointer to IParamBlock2
*/
virtual IParamBlock2 * GetMaxParamBlock2() =0;
//! Direct access to the IParamBlock
/*! for those who like a little more control
\return a pointer to IParamBlock
*/
virtual IParamBlock * GetMaxParamBlock() =0;
//! Is the parameter ParamBlock based
/*! Specifies whether this parameter is based on either IParamBlock, or IParamBlock2. This is useful as some IGameProperties
are based on Non paramblocks. For example node/user data is accessed as an IGame Property but in max has no Paramblock representation
\return TRUE if it is based on a either IParamBlock or IParamBlock2.
*/
virtual bool IsParamBlock()=0;
//! The data type of the Property
/*! This is used to find out the data type of the property. It is used so the correct GetPropertyValue method can be
used
\return The data type. This will be a value from PropType enumeration.
*/
virtual PropType GetType() =0;
//! Whether this is Parameter is directly supported and has a entry in the Properties file
/*! Uses this method to decide whether a property is directly supported via the XML file
\return True if it directly supported with access from the XML file
*/
virtual bool IsParameterSupported() = 0;
//! The index of the parameter
/*! The actual index of the parameter as used by the Paramblock system. This can be used for direct access to the
property from the parmblock container. This can be used for GetValue/SetValue calls.
\return The index in the parameter block
*/
virtual int GetParamBlockIndex() = 0;
//! Access to the actual Parameter Data
/*!
\param &f The float to receive the data
\param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame
\return TRUE if succesful
\sa IGameScene::SetStaticFrame
*/
virtual bool GetPropertyValue(float &f, TimeValue t=TIME_NegInfinity)=0;
//! Access to the actual Parameter Data
/*!
\param &i The int to receive the data
\param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame
\return TRUE if succesful
\sa IGameScene::SetStaticFrame
*/
virtual bool GetPropertyValue(int &i, TimeValue t=TIME_NegInfinity)=0;
//! Access to the actual Parameter Data
/*!
\param &p The Point3 to receive the data
\param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame
\return TRUE if succesful
\sa IGameScene::SetStaticFrame
*/
virtual bool GetPropertyValue(Point3 &p, TimeValue t=TIME_NegInfinity)=0;
//! Access to the actual Parameter Data <b><i>This function is only available in 3ds max 6.0 and above</i></b>
/*!
\param &p The Point4 to receive the data
\param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame
\return TRUE if succesful
\sa IGameScene::SetStaticFrame
*/
virtual bool GetPropertyValue(Point4 &p, TimeValue t=TIME_NegInfinity)=0;
//! Access to the actual Parameter Data -
/*!
\param v The TCHAR to receive the data
\param t The time to retrieve the value. If the default is used then the static frame is used. This is set by SetStaticFrame
\return TRUE if successful
\sa IGameScene::SetStaticFrame
*/
virtual bool GetPropertyValue(TCHAR*& v, TimeValue t=TIME_NegInfinity)=0;
};
//!Property Enumeration
/*! PropertyEnum allows a developer to define a callback for use with EnumerateProperties. It will be called for
every parameter stored in the system
*/
class PropertyEnum
{
public:
//! The call back function
/*! This is called for every property in the system, providing a way of stopping the enumeration if need be
\param *prop The actual property found
\return TRUE to stop the enumeration
*/
virtual bool Proc(IGameProperty* prop) = 0;
};
//! Property container
/*! This class provide an extension mechanism that IGame can use - an Entity is free to use them
the idea here, is that a developer can extend the properties that are "known" to IGame
this way the property can be retrieved directly by the developer. As it is "known" to
the developer the property type is also known and can be accessed directly
*/
class IPropertyContainer
{
public:
//! Property Access
/*!Using the unique ID in the XML file, the property can be queried directly
\param PropID The identifier used in the XML file
\return A pointer to IGameProperty if found - NULL if not
*/
virtual IGameProperty * QueryProperty(DWORD PropID) {return NULL;}
//! The number of Properties for the Entity
/*!
\return The number of properties found. The default is 0. This only counts the supported properties as defined
in the property file
*/
virtual int GetNumberOfProperties(){return 0;}
//!Direct Property Access
/*! The property can be accessed directly from the index provided from the XML file. You can use the IGame Editor to
write out the index for the properties as a Header file for easy access. This only works for Supported Parameters,
i.e. Properties found in the properties file
\param index The index of the property to return
\return A pointer to the IGameProperty. The default is NULL
*/
virtual IGameProperty * GetProperty(int index) {return NULL;}
//! Property Access
/*!Using the name in the XML file, the property can be queried directly
\param propName The name identifier used in the XML file
\return A pointer to IGameProperty if found The default is NULL
*/
virtual IGameProperty * QueryProperty(const TCHAR * propName) {return NULL;}
//!Enumerate the Properties
/*!All properties can be enumerated by using this method. A user defined callback is used to provide access to
the properties.
\param &Enum The callback object to use.
*/
virtual void EnumerateProperties(PropertyEnum & Enum) = 0;
};
//!Main property access
/*!base Class used by all exporters wanting to take part in the properties system
*/
class IExportEntity
{
public:
//!Retrieve the Property Container
/*!
\return The PropertyContainer for this entity.
*/
virtual IPropertyContainer * GetIPropertyContainer(){return NULL;}
//! Is the Entity directly supported
/*!IGame provides direct support for certain max object and materials. If the IGameProp.xml file
contains additional properties on unknown ClassIDs, for example a new Object then this method is used to find out whether IGame supports
them directly. IGame supports the standard material directly, i.e provides direct API calls to get the properties. If a material was
found that was not a standard material, then the parameters can be access by using the IGameProp file and the IPropertyContainer file.
\return TRUE if IGame supports the parameters for a particular ClassID directly through its API
*/
virtual bool IsEntitySupported() {return false;}
};
#endif

View File

@ -0,0 +1,70 @@
/**********************************************************************
*<
FILE: IGameRenderedSurface.h
DESCRIPTION: IGameRenderSurface interfaces for IGame. This interface
provide access to the lighting and color of an object at the face level.
Any IGame Object can provide access to the data calculated here. It uses
the same basic approach as the Vertex Color Utility
CREATED BY: Neil Hazzard, Discreet
HISTORY: created 12/11/02
IGame Version: 1.122
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
#ifndef __IGAMERENDERSURFACE__H
#define __IGAMERENDERSURFACE__H
#pragma once
/*!\file IGameRenderedSurface.h
\brief Access to the main render routines to calculate surface data such as Lighting and color.
Lighting and color can be calculated on a per face/vertex level. This data is the same technique that
the Apply Vertex color utility uses. The difference here is that you are provided the color independently of the
vertex color channel. THis leaves that channel for other data and provides more options at export time.
*/
#define EVAL_MAPS (1<<0)
#define EVAL_SHADOWS (1<<1)
//!class IGameRenderedSurface
/*! Access to the main render surface interface. Methods are available to setup the system and define the lighting models
used. Actual access to the data is provided through the IGameMesh class
*/
class IGameRenderedSurface
{
public:
enum LightingModel{
SHADED,
LIGHTING_ONLY,
SHADED_ONLY
};
//! Setup the database for rendering.
virtual bool InitialiseRenderedSurfaceData() = 0;
//! Clean it all up
virtual void ReleaseRenderedSurfaceData() = 0 ;
//! Define the type of model be used in the render
virtual void SetLightingModel(LightingModel lm) = 0;
//! Defines the usage of Maps and shadows
virtual void SetFlag(DWORD mask) = 0;
//! defines the usage of Maps and shadows
virtual void ClearFlag(DWORD mask) = 0;
};
//! Get the main interface pointer.
IGAMEEEXPORT IGameRenderedSurface *GetIGameRenderedSurfaceInterface();
#endif

View File

@ -0,0 +1,47 @@
/**********************************************************************
FILE: IGlobalDXDisplayManager.h
DESCRIPTION: Public interface controlling the display of the Dx Effect
in the Viewport
CREATED BY: Neil Hazzard, Discreet
HISTORY: Created 21 May 2003
*> Copyright (c) 2003, All Rights Reserved.
**********************************************************************/
#ifndef __IGLOBALDXDISPLAYMANAGER_H__
#define __IGLOBALDXDISPLAYMANAGER_H__
#include "iFnPub.h"
#define GLOBAL_DX_DISPLAY_MANAGER_INTERFACE Interface_ID(0x7ebe15d6, 0x2b7b422b)
class IGlobalDXDisplayManager : public FPStaticInterface
{
public:
// Sets a global overide to turn off display of Dx Shaders in the viewport
virtual void SetForceSoftware(BOOL set=TRUE)=0;
// Sets the force display of Dx Effects when an object is selected. This only works
// if SetForceSoftware is set to TRUE
virtual void SetForceSelected(BOOL set =TRUE )=0;
//Gets the state of the Force Software flag
virtual BOOL IsForceSoftware()=0;
//Gets the state of the Force Selected falg
virtual BOOL IsForceSelected()=0;
//Queries whether DX is available - useful for UI handlers
virtual BOOL IsDirectXActive()=0;
};
inline IGlobalDXDisplayManager* GetGlobalDXDisplayManager() { return (IGlobalDXDisplayManager*)GetCOREInterface(GLOBAL_DX_DISPLAY_MANAGER_INTERFACE); }
#endif

View File

@ -0,0 +1,88 @@
/**********************************************************************
*<
FILE: ILayerProperties.h
DESCRIPTION: Declare the function published interface to layers
note: This interface is a facade over disparate property sets on layers:
1) Node-based properties:
it currently spans the traditional INode properties and the GI properties.
This is a convenience interface and provides only control of "coarse" properties:
those access iconically in the layer UI.
2) Additional properties unique to layers: Current.
3) membership
CREATED BY: John Hutchinson
HISTORY: created Aug 6, 2001
add Aug 9, 2001 add interface for layermanager
add Sept 3, 2001 adding properties for color and GIExclusion
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef __ILAYERPROPERTIES__H__
#define __ILAYERPROPERTIES__H__
#include "ifnpub.h"
// The interface ID for class ILayerProperties
#define LAYERPROPERTIES_INTERFACE Interface_ID(0x202e0798, 0x3589129b)
// Provides access to a layer's properties
class ILayerProperties : public FPMixinInterface
{
public:
//membership
virtual void addNode (INode *) = 0;
virtual void select (BOOL) = 0;
//properties
virtual BOOL getCurrent (void) = 0;
//The semantics of setCurrent are special,
//You can set it to be current, but can't set it _not_ current
virtual void setCurrent (BOOL) = 0;
virtual BOOL getOn (void) = 0;
virtual void setOn (BOOL) = 0;
virtual BOOL getLock (void) = 0;
virtual void setLock (BOOL) = 0;
//JH 9.03.01
virtual Color getWireColor(void) = 0;
virtual void setWireColor(Color) = 0;
virtual BOOL getGIIsExcluded() const = 0;
virtual void setGIIsExcluded(BOOL) = 0;
//JH 09.28.01
virtual TCHAR* getName (void) = 0;
// not a property, per se, since it can fail due to uniqueness of layer names
virtual BOOL setName (TCHAR *) = 0;
// 030415 --prs.
virtual BOOL Nodes(Tab<INode*>& layerNodes) = 0;
};
#define LAYERMANAGER_INTERFACE Interface_ID(0x77ff1709, 0x19186e96)
// Provides access to the layer manager
class IFPLayerManager : public FPStaticInterface
{
public:
//access to the layers
virtual ILayerProperties* getLayer (int which) = 0;
virtual ILayerProperties* newLayer (void) = 0;
//JH 09.28.01
//overloads for access by name
virtual ILayerProperties* getLayer (TCHAR *) = 0;
virtual ILayerProperties* newLayer (TCHAR *) = 0;
//
//read only properties
virtual int getCount (void) = 0;
virtual ILayerProperties* getCurrent (void) = 0;
//TODO allow purging empty layers
};
#endif //__ILAYERPROPERTIES__H__

View File

@ -0,0 +1,66 @@
/**********************************************************************
*<
FILE: ILightingUnits.h
DESCRIPTION: Function-published interface to access the lighting units display system.
CREATED BY: David Cunningham
HISTORY: October 15, 2001 file created
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef __ILIGHTUNIT__
#define __ILIGHTUNIT__
#include "iFnPub.h"
#define ILIGHT_UNITS_FO_INTERFACE Interface_ID(0x7246dc, 0x4384dc)
typedef struct {
int lightingSystem; // Lighting unit display system {LIGHTING_UNIT_DISPLAY_INTERNATIONAL,
// LIGHTING_UNIT_DISPLAY_AMERICAN }
TSTR luminanceUnits; // The string describing the luminance units
TSTR illuminanceUnits; // The string describing the illuminance units
} LightDispInfo;
/**
* The interface used to access the lighting system.
*/
class ILightingUnits : public FPStaticInterface {
public:
enum LightingSystems {
DISPLAY_INTERNATIONAL,
DISPLAY_AMERICAN,
DISPLAY_TYPE_COUNT
};
virtual TCHAR *GetFirstLightingSystemName() = 0;
virtual TCHAR *GetNextLightingSystemName() = 0;
virtual int GetLightingSystem() = 0;
virtual void SetLightingSystem(int system) = 0;
virtual TCHAR *GetLuminanceUnits() = 0;
virtual TCHAR *GetIlluminanceUnits() = 0;
virtual double ConvertLuminanceToCurrSystem(double luminanceValue) = 0;
virtual double ConvertLuminanceToCurrSystem(double luminanceValue, int inputType) = 0;
virtual double ConvertLuminanceToSI(double AS_LuminanceValue) = 0;
virtual double ConvertLuminanceToAS(double SI_LuminanceValue) = 0;
virtual double ConvertIlluminanceToCurrSystem(double illuminanceValue) = 0;
virtual double ConvertIlluminanceToCurrSystem(double illuminanceValue, int inputType) = 0;
virtual double ConvertIlluminanceToSI(double AS_IlluminanceValue) = 0;
virtual double ConvertIlluminanceToAS(double SI_IlluminanceValue) = 0;
virtual void GetLightingUnitDisplayInfo(LightDispInfo* info) = 0;
};
#endif

View File

@ -0,0 +1,164 @@
/**********************************************************************
FILE: IMtlBrowserFilter.h
DESCRIPTION: Public interface for filtering the contents of the
material/map browser.
CREATED BY: Daniel Levesque, Discreet
HISTORY: Created 23 February 2003
*> Copyright (c) 2003, All Rights Reserved.
**********************************************************************/
#ifndef _IMTLBROWSERFILTER_H_
#define _IMTLBROWSERFILTER_H_
#include <Windows.h>
#include <max.h>
#include <ifnpub.h>
#include <baseinterface.h>
#define IMTLBROWSERFILTER_MANAGER_INTERFACEID Interface_ID(0x371b4b10, 0x6c715bbc)
#define IMTLBROWSERFILTER_INTERFACEID Interface_ID(0x1d1f513b, 0x6f315a24)
#define ISUBMTLMAP_BROWSERFILTER_INTERFACEID Interface_ID(0x17304fc3, 0x1ad25941)
class IMtlBrowserFilter;
class MtlBase;
class ClassDesc;
//==============================================================================
// class IMtlBrowserFilter_Manager
//
// This is the manager for the mtl/map browser filters. It is used to add/remove
// and access filters for the mtl/map browser.
//==============================================================================
class IMtlBrowserFilter_Manager : public FPStaticInterface {
public:
// Add a filter to the list. Returns false if filter could not be added because duplicate.
virtual bool AddFilter(IMtlBrowserFilter& filter) = 0;
// Remove a filter from the list. Returns false if filter could not be removed because not found.
virtual bool RemoveFilter(IMtlBrowserFilter& filter) = 0;
// Query the list of filters
virtual int GetNumberFilters() = 0;
virtual IMtlBrowserFilter* GetFilter(unsigned int i) = 0;
// Returns whether the i-th filter is enabled
virtual bool FilterEnabled(unsigned int i) = 0;
// Enables/disables the i-th filter
virtual void EnableFilter(unsigned int i, bool enable) = 0;
// Get the name of the i-th filter
virtual const TCHAR* GetFilterName(unsigned int i) = 0;
// Run the given material/map through all the filters in the list, returning
// true if and only if all filters accept to include that material/map.
virtual bool Include(
MtlBase& mtlBase, // The material/texmap to be filtered
DWORD flags // The browser flags, as passed to Interface::DoMaterialBrowseDlg()
) = 0;
// Run the given class descriptor through all the filters in the list,
// returning true if and only if all filters accept to include that classdesc.
virtual bool Include(
ClassDesc& classDesc, // The material/map class descriptor to be filtered
DWORD flags // The browser flags, as passed to Interface::DoMaterialBrowseDlg()
) = 0;
};
inline IMtlBrowserFilter_Manager* Get_IMtlBrowserFilter_Manager() {
return static_cast<IMtlBrowserFilter_Manager*>(GetCOREInterface(IMTLBROWSERFILTER_MANAGER_INTERFACEID));
};
//==============================================================================
// class IMtlBrowserFilter
//
// This is the base class for all mtl/map browser filters.
//==============================================================================
class IMtlBrowserFilter : public BaseInterface {
public:
// Returns the name of the filter
virtual const TCHAR* FilterName() = 0;
// Used to enable/disable this filter. The filter manager will not call
// disabled filters.
virtual bool Enabled() = 0;
virtual void Enable(bool enable) = 0;
// Called when this filter is added to the manager
virtual void Registered() = 0;
// Called when a filter is removed from the manager
virtual void Unregistered() = 0;
// Returns whether the given material/map should be included in the browser,
// when browsing for existing materials/maps.
virtual bool Include(
MtlBase& mtlBase, // The material/texmap to be filtered
DWORD flags // The browser flags, as passed to Interface::DoMaterialBrowseDlg()
) = 0;
// Returns whether the given material/map should be included in the browser,
// when browsing for 'new'.
virtual bool Include(
ClassDesc& classDesc, // The material/map class descriptor to be filtered
DWORD flags // The browser flags, as passed to Interface::DoMaterialBrowseDlg()
) = 0;
// -- from BaseInterface
virtual Interface_ID GetID();
};
//==============================================================================
// class ISubMtlMap_BrowserFilter
//
// A Mtl/Texmap plugin which wishes to specify filters for its submaps/submaterials
// may implement this interface. The material editor will use the filters returned
// by this interface when browsing for sub materials or texmaps.
//==============================================================================
class ISubMtlMap_BrowserFilter : public BaseInterface {
public:
// Returns a filter for the i-th sub-texmap (indices are identical to
// those used with class ISubMap).
virtual IMtlBrowserFilter* GetSubMapFilter(unsigned int i) = 0;
// Returns a filter for the i-th sub-material (indices are identical to
// those used with class Mtl). Note that this is only useful for Mtl plugins.
// Texmap plugins should return NULL.
virtual IMtlBrowserFilter* GetSubMtlFilter(unsigned int i) = 0;
// -- from BaseInterface
virtual Interface_ID GetID();
};
inline ISubMtlMap_BrowserFilter* Get_ISubMtlMap_BrowserFilter(InterfaceServer* iserver) {
return static_cast<ISubMtlMap_BrowserFilter*>(iserver->GetInterface(ISUBMTLMAP_BROWSERFILTER_INTERFACEID));
}
//==============================================================================
// class IMtlBrowserFilter inlined methods
//==============================================================================
inline Interface_ID IMtlBrowserFilter::GetID() {
return IMTLBROWSERFILTER_INTERFACEID;
}
//==============================================================================
// class ISubMapBrowserFilter inlined methods
//==============================================================================
inline Interface_ID ISubMtlMap_BrowserFilter::GetID() {
return ISUBMTLMAP_BROWSERFILTER_INTERFACEID;
}
#endif

View File

@ -0,0 +1,174 @@
/**********************************************************************
FILE: IMtlRender_Compatibility.h
DESCRIPTION: Public interface for determining compatibility
between a material/texmap and a renderer.
The interface also allows 3rd party material/map plugins to
use custom icons in the material/map browser.
CREATED BY: Daniel Levesque, Discreet
HISTORY: Created 14 April 2003
*> Copyright (c) 2003, All Rights Reserved.
**********************************************************************/
#ifndef _IMTLRENDER_COMPATIBILITY_H_
#define _IMTLRENDER_COMPATIBILITY_H_
#include <Windows.h>
#include <max.h>
#include <baseinterface.h>
class Renderer;
class MtlBase;
#define IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID Interface_ID(0x5537445b, 0x70a97e02)
#define IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID Interface_ID(0x25d24114, 0xdbe505f)
//==============================================================================
// class IMtlRender_Compability_MtlBase
//
// Implementation instructions:
// To be subclassed by a ClassDesc or ClassDesc2 of a Texmap or Mtl plugin.
// The subclass needs to call Init(*this) in its constructor.
//
// Description:
// This interface is used to determine whether a material/map flags itself as
// being compatible with a specific renderer plugin. If the material/map flags
// itself as being compatible with a renderer, then it is deemed compatible with
// that renderer regardless of what class IMtlRender_Compatibility_Renderer
// might say.
//
// Default compatibility: If neither the renderer nor the material/map implements
// the compatibility interface, they are considered compatible by default.
//
// Material/map browser icon: This interface may also be used to provide custom
// icons for the material/map browser.
//
//==============================================================================
class IMtlRender_Compatibility_MtlBase : public FPStaticInterface {
public:
// Initialization method. MUST be called from the constructor of the subclass. i.e. "Init(*this);".
void Init(
ClassDesc& classDesc // Reference to sub-class instance
);
// Returns wethere this material/map is compatible with the given renderer.
// (Use the class ID of the renderer to determine compatibility).
virtual bool IsCompatibleWithRenderer(
ClassDesc& rendererClassDesc // Class descriptor of a Renderer plugin
) = 0;
// Provides custom icons for the material/map browser. Returns true if custom
// icons are provided.
// ImageList owner: The derived class has complete ownership over the image list.
// The derived class handles both creation and deletion of the image list.
virtual bool GetCustomMtlBrowserIcon(
HIMAGELIST& hImageList, // The image list from which the icons are extracted. The images should have a mask.
int& inactiveIndex, // Index (into image list) of icon to be displayed when the material/map has the "Show Maps in Viewport" flag turned OFF.
int& activeIndex, // Index (into image list) of icon to be displayed when the material/map has the "Show Maps in Viewport" flag turned ON.
int& disabledIndex // Index (into image list) of icon to be displayed when the material/map is NOT COMPATIBLE with the current renderer.
)
{
return false;
}
};
// Given the class descriptor of a Mtl/Texmap plugin, this returns its compatibility interface (if it exists).
inline IMtlRender_Compatibility_MtlBase* Get_IMtlRender_Compability_MtlBase(ClassDesc& mtlBaseClassDesc) {
return static_cast<IMtlRender_Compatibility_MtlBase*>(mtlBaseClassDesc.GetInterface(IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID));
}
//==============================================================================
// class IMtlRender_Compatibility_Renderer
//
// Implementation instructions:
// To be subclassed by a ClassDesc or ClassDesc2 of a Renderer plugin.
// The subclass needs to call Init(*this) in its constructor.
//
// Description:
// This interface is used to determine whether a Renderer flags itself as
// being compatible with a specific material/map plugin. If the Renderer flags
// itself as being compatible with a material/map, then it is deemed compatible with
// that material/map regardless of what class IMtlRender_Compatibility_MtlBase
// might say.
//
// Default compatibility: If neither the renderer nor the material/map implements
// the compatibility interface, they are considered compatible by default.
//
//==============================================================================
class IMtlRender_Compatibility_Renderer : public FPStaticInterface {
public:
// Initialization method. MUST be called from the constructor of the subclass. i.e. "Init(*this);".
void Init(
ClassDesc& classDesc // Reference to sub-class instance
);
// Returns wethere this material/map is compatible with the given renderer.
// (Use the class ID of the renderer to determine compatibility).
virtual bool IsCompatibleWithMtlBase(
ClassDesc& mtlBaseClassDesc // Class descriptor of Mtl or Texmap plugin
) = 0;
};
// Given the class descriptor of a Renderer plugin, this returns its compatibility interface (if it exists).
inline IMtlRender_Compatibility_Renderer* Get_IMtlRender_Compatibility_Renderer(ClassDesc& rendererClassDesc) {
return static_cast<IMtlRender_Compatibility_Renderer*>(rendererClassDesc.GetInterface(IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID));
}
////////////////////////////////////////////////////////////////////////////////
// bool AreMtlAndRendererCompatible(ClassDesc&, ClassDesc&)
//
// Returns whether the given Mtl/Texmap plugin is compatible with the given
// Renderer plugin. Always use this function to determine compatiblity.
//
inline bool AreMtlAndRendererCompatible(ClassDesc& mtlBaseClassDesc, ClassDesc& rendererClassDesc) {
IMtlRender_Compatibility_MtlBase* mtlBaseCompatibility = Get_IMtlRender_Compability_MtlBase(mtlBaseClassDesc);
IMtlRender_Compatibility_Renderer* rendererCompatibility = Get_IMtlRender_Compatibility_Renderer(rendererClassDesc);
if((mtlBaseCompatibility == NULL) && (rendererCompatibility == NULL)) {
// No compatibility info: compatible by default
return true;
}
else if((mtlBaseCompatibility != NULL) && mtlBaseCompatibility->IsCompatibleWithRenderer(rendererClassDesc)) {
// Material says it's compatible with the renderer: compatible
return true;
}
else if((rendererCompatibility != NULL) && rendererCompatibility->IsCompatibleWithMtlBase(mtlBaseClassDesc)) {
// Renderer says it's compatible with the material: compatible
return true;
}
else {
// Neither material nor renderer says it's compatible: incompatible
return false;
}
}
//==============================================================================
// class IMtlRender_Compability_MtlBase inlined methods
//==============================================================================
inline void IMtlRender_Compatibility_MtlBase::Init(ClassDesc& classDesc) {
LoadDescriptor(IMTLRENDER_COMPATIBILITY_MTLBASE_INTERFACEID, _T("IMtlRender_Compability_MtlBase"), 0, &classDesc, 0, end);
}
//==============================================================================
// class IMtlRender_Compatibility_Renderer inlined methods
//==============================================================================
inline void IMtlRender_Compatibility_Renderer::Init(ClassDesc& classDesc) {
LoadDescriptor(IMTLRENDER_COMPATIBILITY_RENDERER_INTERFACEID, _T("IMtlRender_Compability_Renderer"), 0, &classDesc, 0, end);
}
#endif

View File

@ -0,0 +1,226 @@
/**********************************************************************
FILE: INodeBakeProperties.h
DESCRIPTION: Public interface for setting and getting a node's
texture baking properties.
CREATED BY: Kells Elmquist
HISTORY: created 15 december 2001
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _INodeBakeProperties__H_
#define _INodeBakeProperties__H_
#include "ifnpub.h"
//#include "renderElements.h"
class MaxBakeElement;
// The interface ID for class INodeBakeProperties
#define NODE_BAKE_PROPERTIES_INTERFACE Interface_ID(0x3e5d0f38, 0x37e500ac)
// by default use this channel for all baking ops
#define DEFAULT_BAKE_CHANNEL 3
#define DEFAULT_N_DILATIONS 2
//==============================================================================
// class INodeBakeProperties
//
//
// This class defines an interface for accessing a node's texture
// baking properties.
//
// An instance of this interface can be retrieved using the following line of
// code (assuming 'node' is of type INode*):
//
// static_cast<INodeBakeProperties*>(INode*->GetInterface(NODE_BAKE_PROPERTIES_INTERFACE))
//
//
// Description of the node's texture baking properties:
//
//
// GENERAL PROPERTIES:
//
// Enable:
// Texture baking is enabled for this object
//
// Baking Channel:
// Flattening & baking use this uv mapping channel for this object
//
// List of Baking Render Elements:
// each object has a list of render elements for output
//
//==============================================================================
// now the baking properties themselves
class INodeBakeProperties : public FPMixinInterface {
public:
// General properties
virtual BOOL GetBakeEnabled() const = 0;
virtual void SetBakeEnabled( BOOL isExcluded ) = 0;
// mapping channel to use for baking Object level
virtual int GetBakeMapChannel() const = 0;
virtual void SetBakeMapChannel( int mapChannel ) = 0;
// number of dilations after rendering, affects seaming
virtual int GetNDilations() const = 0;
virtual void SetNDilations( int nDilations ) = 0;
virtual int GetBakeFlags() const = 0;
virtual void SetBakeFlags( int flags ) = 0;
virtual float GetSurfaceArea() const = 0;
virtual void SetSurfaceArea( float area ) = 0;
virtual float GetAreaScale() const = 0;
virtual void SetAreaScale( float scale ) = 0;
// bake render elements
virtual int GetNBakeElements() const = 0;
virtual MaxBakeElement* GetBakeElement( int nElement ) = 0;
virtual Tab<MaxBakeElement*> GetBakeElementArray() = 0;
virtual BOOL AddBakeElement( MaxBakeElement* pEle ) = 0;
virtual BOOL RemoveBakeElement( MaxBakeElement* pEle ) = 0;
virtual BOOL RemoveBakeElementByName( char * name ) = 0;
virtual BOOL RemoveBakeElementByIndex( int index ) = 0;
virtual void RemoveAllBakeElements() = 0;
// reset params to default, toss render elements
virtual void ResetBakeProps() = 0;
// enabled & has some elements & sz not 0
virtual BOOL GetEffectiveEnable() = 0;
// largest size of enabled baking elements
virtual IPoint2 GetRenderSize() = 0;
virtual FBox2 GetActiveRegion() =0;
virtual void SetActiveRegion(FBox2 region) = 0;
};
//==============================================================================
// class INodeBakeProjProperties
//
// Properties related to projection mapping with texture baking
//
//==============================================================================
#define NODE_BAKE_PROJ_PROPERTIES_INTERFACE Interface_ID(0x59d919a5, 0x6fb90a85)
class INodeBakeProjProperties : public FPMixinInterface {
public:
//Enabled
virtual BOOL GetEnabled() = 0;
virtual void SetEnabled( BOOL b ) = 0;
//ProjMod - Projection Modifier
virtual ReferenceTarget* GetProjMod() = 0;
virtual void SetProjMod( ReferenceTarget* refTarg ) = 0;
//ProjModTarg - Projection Modifier Target
virtual TCHAR* GetProjModTarg() = 0;
virtual void SetProjModTarg( TCHAR* s ) = 0;
//CropAlpha
virtual BOOL GetCropAlpha() = 0;
virtual void SetCropAlpha( BOOL b ) = 0;
//ProjSpace: XYZ object space, or UVW texture space
enum { enumIdProjSpaceXYZ=0, enumIdProjSpaceUVW };
virtual int GetProjSpace() = 0;
virtual void SetProjSpace( int enum_val ) = 0;
//NormalSpace: World Space, Screen Space, Local Space, or Tangent Space
enum { enumIdNormalSpaceWorld=0, enumIdNormalSpaceScreen, enumIdNormalSpaceLocal, enumIdNormalSpaceTangent };
virtual int GetNormalSpace() = 0;
virtual void SetNormalSpace( int enum_val ) = 0;
//TangentYDir: Y-Up or Y-Down
enum { enumIdTangentDirYUp=0, enumIdTangentDirYDown};
virtual int GetTangentYDir() = 0;
virtual void SetTangentYDir( int enum_val ) = 0;
//TangentXDir: X-Right or X_Left
enum {enumIdTangentDirXRight=0, enumIdTangentDirXLeft };
virtual int GetTangentXDir() = 0;
virtual void SetTangentXDir( int enum_val ) = 0;
//UseCage
virtual BOOL GetUseCage() = 0;
virtual void SetUseCage( BOOL b ) = 0;
//RayOffset
virtual float GetRayOffset() = 0;
virtual void SetRayOffset( float f ) = 0;
//HitResolveMode
enum { enumIdHitResolveClosest=0, enumIdHitResolveFurthest };
virtual int GetHitResolveMode() = 0;
virtual void SetHitResolveMode( int enum_val ) = 0;
//HitMatchMtlID
virtual BOOL GetHitMatchMtlID() = 0;
virtual void SetHitMatchMtlID( BOOL b ) = 0;
//HitWorkingModel
virtual BOOL GetHitWorkingModel() = 0;
virtual void SetHitWorkingModel( BOOL b ) = 0;
//WarnRayMiss
virtual BOOL GetWarnRayMiss() = 0;
virtual void SetWarnRayMiss( BOOL b ) = 0;
//RayMissColor
virtual Color* GetRayMissColor() = 0;
virtual void SetRayMissColor( Color* c ) = 0;
//HeightMapMin - rays of less than this length are output as black pixels by the Height Map
virtual float GetHeightMapMin() = 0;
virtual void SetHeightMapMin( float f ) = 0;
//HeightMapMax - rays of more than this length are output as white pixels by the Height Map
virtual float GetHeightMapMax() = 0;
virtual void SetHeightMapMax( float f ) = 0;
//HeightBufMin - the minimum height value encountered during the last rendering
virtual float GetHeightBufMin() = 0;
virtual void SetHeightBufMin( float f ) = 0;
//HeightBufMax - the maximum height value encountered during the last rendering
virtual float GetHeightBufMax() = 0;
virtual void SetHeightBufMax( float f ) = 0;
//ProportionalOutput
virtual BOOL GetProportionalOutput() = 0;
virtual void SetProportionalOutput( BOOL b ) = 0;
// mapping channel to use for baking SubObject level
virtual int GetBakeMapChannel_SO() const = 0;
virtual void SetBakeMapChannel_SO( int mapChannel ) = 0;
//BakeObjectLevel
virtual BOOL GetBakeObjLevel() = 0;
virtual void SetBakeObjLevel( BOOL b ) = 0;
//BakeSubObjLevels
virtual BOOL GetBakeSubObjLevels() = 0;
virtual void SetBakeSubObjLevels( BOOL b ) = 0;
//useObjectBakeForMtl
virtual BOOL GetObjBakeToMtl() = 0;
virtual void SetObjBakeToMtl( BOOL b ) = 0;
};
#endif

View File

@ -0,0 +1,208 @@
/**********************************************************************
FILE: INodeExposure.h
DESCRIPTION: Public interface for determining if a node should be
exposed in misc. UIs (SelectObjects, TrackView etc).
CREATED BY: Oleg Bayborodin
HISTORY: - created March 21, 2002
*> Copyright (c) 1998-2002, All Rights Reserved.
**********************************************************************/
#ifndef __INODEEXPOSURE__H
#define __INODEEXPOSURE__H
#include "iFnPub.h"
#include "maxtypes.h"
#define NODEEXPOSURE_INTERFACE Interface_ID(0x1b00412c, 0x6ebf48f2)
#define NODEEXPOSURE_INTERFACE_TOAPPEND Interface_ID(0x1b00412c, 0x6ebf48f3)
class INodeExposure : public FPMixinInterface {
public:
enum {
kSelectObjects, kSchematicView, kMaxscript,
kMerge, kMergeAnimation, kReplace,
kKeyEditor, kCurveEditor, kRangeEditor, // three components for TrackView editors
kUI_num // always last in the enum
};
// Utilities:
static INodeExposure* GetINodeExposure(INode& n) {
return static_cast<INodeExposure*>(n.GetInterface(NODEEXPOSURE_INTERFACE)); }
static INodeExposure* AppendINodeExposure(INode& n) {
return static_cast<INodeExposure*>(n.GetInterface(NODEEXPOSURE_INTERFACE_TOAPPEND)); }
// exposure in a specific UI
virtual bool IsExposed(int ui) const =0;
// set exposure in all UIs
virtual void SetExposed(bool state) =0;
// set exposure in a specific UI
virtual void SetExposed(bool state, int ui) =0;
// Derived methods. They are all inline'd at the end of the file.
bool IsExposedInSelectObjects() const;
bool IsExposedInSchematicView() const;
bool IsExposedInMaxscript() const;
bool IsExposedInMerge() const;
bool IsExposedInMergeAnimation() const;
bool IsExposedInReplace() const;
bool IsExposedInTrackView() const;
bool IsExposedInKeyEditor() const;
bool IsExposedInCurveEditor() const;
bool IsExposedInRangeEditor() const;
void SetExposedInSelectObjects(bool state);
void SetExposedInSchematicView(bool state);
void SetExposedInMaxscript(bool state);
void SetExposedInMerge(bool state);
void SetExposedInMergeAnimation(bool state);
void SetExposedInReplace(bool state);
void SetExposedInTrackView(bool state);
void SetExposedInKeyEditor(bool state);
void SetExposedInCurveEditor(bool state);
void SetExposedInRangeEditor(bool state);
virtual IOResult Save(ISave*) const =0;
virtual IOResult Load(ILoad*) =0;
virtual void Copy(INodeExposure*) =0;
// makes exposure parameters to be permanent (not mutable)
virtual void BakeExposure() =0;
// defines if exposure is baked
virtual bool IsExposureBaked() =0;
// Used by implementation class:
virtual const void* ObjectOf(void*) const =0;
virtual void* ObjectOf(void*) =0;
// Due to FPMixinInterface:
FPInterfaceDesc* GetDesc() { return GetDescByID(NODEEXPOSURE_INTERFACE); }
// Function publishings:
//
enum FuncID {
kIsExposed, kSetExposedInAll, kSetExposed, kBakeExposure
};
BEGIN_FUNCTION_MAP
FN_1(kIsExposed, TYPE_bool, IsExposed, TYPE_INT);
VFN_1(kSetExposedInAll, SetExposed, TYPE_bool);
VFN_2(kSetExposed, SetExposed, TYPE_bool, TYPE_INT);
VFN_0(kBakeExposure, BakeExposure );
END_FUNCTION_MAP
};
// inlines for derived methods
//
inline bool INodeExposure::IsExposedInSelectObjects() const
{
return IsExposed(kSelectObjects);
}
inline bool INodeExposure::IsExposedInSchematicView() const
{
return IsExposed(kSchematicView);
}
inline bool INodeExposure::IsExposedInMaxscript() const
{
return IsExposed(kMaxscript);
}
inline bool INodeExposure::IsExposedInMerge() const
{
return IsExposed(kMerge);
}
inline bool INodeExposure::IsExposedInMergeAnimation() const
{
return IsExposed(kMergeAnimation);
}
inline bool INodeExposure::IsExposedInReplace() const
{
return IsExposed(kReplace);
}
inline bool INodeExposure::IsExposedInTrackView() const
{
return (IsExposed(kKeyEditor) || IsExposed(kCurveEditor) || IsExposed(kRangeEditor));
}
inline bool INodeExposure::IsExposedInKeyEditor() const
{
return IsExposed(kKeyEditor);
}
inline bool INodeExposure::IsExposedInCurveEditor() const
{
return IsExposed(kCurveEditor);
}
inline bool INodeExposure::IsExposedInRangeEditor() const
{
return IsExposed(kRangeEditor);
}
inline void INodeExposure::SetExposedInSelectObjects(bool state)
{
SetExposed(state, kSelectObjects);
}
inline void INodeExposure::SetExposedInSchematicView(bool state)
{
SetExposed(state, kSchematicView);
}
inline void INodeExposure::SetExposedInMaxscript(bool state)
{
SetExposed(state, kMaxscript);
}
inline void INodeExposure::SetExposedInMerge(bool state)
{
SetExposed(state, kMerge);
}
inline void INodeExposure::SetExposedInMergeAnimation(bool state)
{
SetExposed(state, kMergeAnimation);
}
inline void INodeExposure::SetExposedInReplace(bool state)
{
SetExposed(state, kReplace);
}
inline void INodeExposure::SetExposedInTrackView(bool state)
{
SetExposed(state, kKeyEditor);
SetExposed(state, kCurveEditor);
SetExposed(state, kRangeEditor);
}
inline void INodeExposure::SetExposedInKeyEditor(bool state)
{
SetExposed(state, kKeyEditor);
}
inline void INodeExposure::SetExposedInCurveEditor(bool state)
{
SetExposed(state, kCurveEditor);
}
inline void INodeExposure::SetExposedInRangeEditor(bool state)
{
SetExposed(state, kRangeEditor);
}
#endif

View File

@ -0,0 +1,161 @@
/**********************************************************************
FILE: INodeGIProperties.h
DESCRIPTION: Public interface for setting and getting a node's
global illumination (radiosity) properties.
CREATED BY: Daniel Levesque, Discreet
HISTORY: created 1 June 2001
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _INODEGIPROPERTIES__H_
#define _INODEGIPROPERTIES__H_
#include "ifnpub.h"
// The interface ID for class INodeGIProperties
#define NODEGIPROPERTIES_INTERFACE Interface_ID(0x3e5d0f37, 0x37e5009c)
//==============================================================================
// class INodeGIProperties
//
//
// This class defines an interface for accessing a node's global illumination
// properties.
//
// An instance of this interface can be retrieved using the following line of
// code (assuming 'node' is of type INode*):
//
// static_cast<INodeGIProperties*>(node->GetInterface(NODEGIPROPERTIES_INTERFACE))
//
//
// Geometric and object objects have different properties. Accessing/setting
// geometric properties of non-geometric objects is safe,
// but will have no effect in the global illumination solution.
//
//
// Here is a description of the global illumination properties:
//
//
// GENERAL PROPERTIES (all types of objects)
//
// Excluded:
// Excluded objects should be ignored by the radiosity engine. The
// should act as if these objects do not exist.
//
// ByLayer:
// Specifies whether the GI properties of this node's layer should be
// used instead of the local settings.
//
//
// GEOMETRIC OBJECTS (affects only geometric objects):
//
// Occluder:
// Occluding objects will block rays of light that hit their surface.
// Non-occluding objects will not block those rays, but will still receive
// illumination if the Receiver property is set.
//
// Receiver:
// Receiver objects will receive and store illumination from rays of light
// that hit their surface.
// Non-receiver objects will not store illumination.
//
// Diffuse:
// Diffuse surfaces will reflect and trasmit light based on their diffuse
// color and transparency value.
//
// Specular:
// Specular surfaces will generate specular reflections and transparency.
// ex.: glass is specular transparent and a mirror is specular reflective.
//
// UseGlobalMeshSettings:
// When subdividing the geometry for a more accurate GI solution,
// this flag specifies whether some 'global' settings, or the node's local
// settings should be used.
//
// MeshingEnabled:
// When using local settings, this specifies whether geometry subdivision
// should occur on this node.
//
// MeshSize:
// The maximum size, in MAX universe units, that a face should have after
// being subdivided.
//
// NbRefineSteps:
// This is the saved number of refining steps to be performed on this node
// by the global illumination engine.
//
// ExcludedFromRegather:
// Set to 'true' to excluded an object from the 'regathering' process.
//
// RayMult:
// Specifies a multiplier that will increase or decrease the number of rays
// cast for this object when regathering.
//
// LIGHT OBJECTS (affects only light sources):
//
// StoreIllumToMesh:
// Specifies whether the light emitted from this object should be stored
// in the GI solution's mesh, and not be re-cast at render-time.
//
//
//==============================================================================
class INodeGIProperties : public FPMixinInterface {
public:
// Copy properties from another interface
virtual void CopyGIPropertiesFrom(const INodeGIProperties& source) = 0;
// General properties
virtual BOOL GIGetIsExcluded() const = 0;
virtual void GISetIsExcluded(BOOL isExcluded) = 0;
// Geometry object properties
virtual BOOL GIGetIsOccluder() const = 0;
virtual BOOL GIGetIsReceiver() const = 0;
virtual BOOL GIGetIsDiffuse() const = 0;
virtual BOOL GIGetIsSpecular() const = 0;
virtual BOOL GIGetUseGlobalMeshSettings() const = 0;
virtual BOOL GIGetMeshingEnabled() const = 0;
virtual unsigned short GIGetNbRefineSteps() const = 0;
virtual unsigned short GIGetNbRefineStepsDone() const = 0;
virtual float GIGetMeshSize() const = 0;
virtual void GISetIsOccluder(BOOL isOccluder) = 0;
virtual void GISetIsReceiver(BOOL isReceiver) = 0;
virtual void GISetIsDiffuse(BOOL isDiffuseReflective) = 0;
virtual void GISetIsSpecular(BOOL isSpecular) = 0;
virtual void GISetUseGlobalMeshSettings(BOOL globalMeshing) = 0;
virtual void GISetMeshingEnabled(BOOL meshingEnabled) = 0;
virtual void GISetNbRefineSteps(unsigned short nbRefineSteps) = 0;
virtual void GISetNbRefineStepsDone(unsigned short nbRefineStepsDone) = 0;
virtual void GISetMeshSize(float size) = 0;
//JH 9.06.01
virtual BOOL GIGetIsExcludedFromRegather() const = 0;
virtual void GISetIsExcludedFromRegather(BOOL isExcluded) = 0;
//JH 9.06.01
// Light object property
virtual BOOL GIGetStoreIllumToMesh() const = 0;
virtual void GISetStoreIllumToMesh(BOOL storeIllum) = 0;
// [dl | 12Nov2001] Get and Set the 'by layer' flag for radiosity properties.
virtual BOOL GIGetByLayer() const = 0;
virtual void GISetByLayer(BOOL byLayer) = 0;
// > 3/9/02 - 2:36pm --MQM-- regathering ray multiplier node property
virtual float GIGetRayMult() const = 0;
virtual void GISetRayMult(float rayMult) = 0;
};
#endif

View File

@ -0,0 +1,45 @@
/**********************************************************************
*<
FILE: INodeLayerProperties.h
DESCRIPTION: Declare Mixin interface class INodeLayerProperties
CREATED BY: John Hutchinson
HISTORY: created Aug 6, 2001
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef __INODELAYERPROPERTIES__H__
#define __INODELAYERPROPERTIES__H__
#include "ifnpub.h"
//Forward decls
class ILayerProperties;
// The interface ID for class INodeLayerProperties
#define NODELAYERPROPERTIES_INTERFACE Interface_ID(0x44e025f8, 0x6b071e44)
// Provides access to the nodes layer and bylayer bits
class INodeLayerProperties : public FPMixinInterface
{
public:
//set and get access to the nodes layer
virtual ILayerProperties* getLayer (void) = 0;
virtual void setLayer (FPInterface *) = 0;
//set and get access to the bylayer bit groups
//access to the individual bits does not seem necessary
virtual BOOL getDisplayByLayer () = 0;
virtual void setDisplayByLayer (BOOL) = 0;
virtual BOOL getRenderByLayer () = 0;
virtual void setRenderByLayer (BOOL) = 0;
virtual BOOL getMotionByLayer () = 0;
virtual void setMotionByLayer (BOOL) = 0;
virtual BOOL getColorByLayer () = 0;
virtual void setColorByLayer (BOOL) = 0;
virtual BOOL getGlobalIlluminationByLayer () = 0;
virtual void setGlobalIlluminationByLayer (BOOL) = 0;
};
#endif //__INODELAYERPROPERTIES__H__

View File

@ -0,0 +1,36 @@
/**********************************************************************
*<
FILE: INodeValidity.h
DESCRIPTION: Declare BaseInterface class INodeValidity
CREATED BY: MIchael Zyracki
HISTORY: created Aug 6, 2004
*> Copyright (c) 2004, All Rights Reserved.
**********************************************************************/
#ifndef __INODEVALIDITY__H__
#define __INODEVALIDITY__H__
#include "baseinterface.h"
// The interface ID for class INodeValidity
#define NODEVALIDITY_INTERFACE Interface_ID(0x15ce0b65, 0x6acd24ba)
// Provides access to the nodes layer and bylayer bits
class INodeValidity : public BaseInterface
{
public:
//get access to the node validity intervals
virtual Interval GetObValid() =0;
virtual Interval GetWSValid() =0;
virtual Interval GetTMValid() =0;
Interface_ID GetID() { return NODEVALIDITY_INTERFACE; }
LifetimeType LifetimeControl() { return wantsRelease; }
void DeleteInterface() { delete this; }
};
#endif //__INODEVALIDITY__H__

View File

@ -0,0 +1,726 @@
#ifndef __IPAINTERINTERFACE__H
#define __IPAINTERINTERFACE__H
/********************************************************************************
IPainterInterface contains all the interfaces to let a plugin interact with
Maxs Paint system
Basically the system consists of 2 components the IPainterInterface and IPainterCanvasInterface
For a plugin to use the paint system it must sub class of IPainterCanvasInterface_V5 or greater
and implement the virtual methods and be a sub class of ReferenceTarget. A canvas is what the
painterInterface paints on. Basically IPainterCanvasInterface_V5 consists of functions to
identify the canvas version and functions that are called a as the system paints, basically a
start stroke, stroke and endstroke.
The IPainterInterface is what does all the hit testing against the mesh using a quad tree.
Basically it tells the canvas what the stroke looks like. In addition the canvas can use it
do additional hit testing not associated with a stroke.
In its simplest from all that needs to be done is
1. Subclass your plugin from IPainterCanvasInterface_V5 and ReferenceTarget
2. Fill out these virtually methods
StartStroke() - called when a stroke is started
PaintStroke()/PaintStroke(<..>) - called as a stroke is going on
EndStroke() - called when the stroke ends and accepted.
EndStroke(<...>) - called when the system is set to non interactive mode.
CancelStroke() - called if a stroke is canceled.
SystemEndPaintSession() - is called when the painter wants to end a paint session for some reason
See the header for me description of the parameters
You also need to add the painter interface to the GetInterface method from ReferenceTarget.
Something along the lines below. This lets the painter set what interfaces the canvas supports.
void* PainterTester::GetInterface(ULONG id)
{
switch(id)
{
case PAINTERCANVASINTERFACE_V5 : return (IPainterCanvasInterface_V5 *) this;
break;
default: return ReferenceTarget::GetInterface(id);
break;
}
}
3. In addition to implementing these methods, The plugin needs to hook up to
the painterInterface. Using these functions. The pointer to the painter
can be gotten by using the CreateInstance(REF_TARGET_CLASS_ID,PAINTERINTERFACE_CLASS_ID).
Once that pointer is gotten you need to grab a specific version of the painterInterface
using GetPaintInterface. See sample below
ReferenceTarget *painterRef = (ReferenceTarge *) GetCOREInterface()->CreateInstance(REF_TARGET_CLASS_ID,PAINTERINTERFACE_CLASS_ID);
//set it to the correct verion
if (painterRef)
IPainterInterface_V5 *painter = (IPainterInterface_V5 *) painterRef->GetInterface(PAINTERINTERFACE_V5);
Once you have a valid pointer you need to hook your self up to the Painter using the
InitializeCallback method. This is should be done just before you want to start a paint seesion.
All you are doing is passing a pointer of yourself to the painter system so it knows where
to send the messages. Note yourself to IPainterCanvasInterface since the Painter will
interogate you to find out which version of the canvas you are.
painter->InitializeCallback((ReferenceTarget *) this);
Once you have called InitializedCallback and are ready to start a paint session you need load up which
Nodes you want to paint on. This is done with InitializeNodes(int flags, Tab<INode*> &nodeList).
painter->InitializeNodes(0, nodes);
Then StartPaintSession() is called. Once this is called everytime the the users drag paints across
the nodes the Canvas's StartStroke/PaintStroke/EndStroke will get called.
painter->StartPaintSession();
If the canvas changes the topology or geometry of the painted nodes UpdateMeshes() needs to be called
so the quad tree gets updated.
painter->UpdateMeshes(BOOL updatePoitnCache);
Once the canvas is done with the painter it needs to call EndPaintSession() so that all the data can
be freed and it can be unhooked. Otherwise the StartStroke/PaintStroke/EndStroke will still be called.
painter->EndPaintSession();
You can also bring up the Painters Option dialog using the BringUpOptions().
painter->BringUpOptions() ;
In addition there will be some helper functions for gathering points within a stroke and their weigths; and
tools for intersecting rays against the quad tree. See the header for more descriptions.
See the PaintTester project for a simple implementation of a canvas and interaction with the painter.
*********************************************************************************/
#include "iFnPub.h"
#include "icurvctl.h"
#define PAINTERINTERFACE_V5 0x78ffe181
#define PAINTERINTERFACE_V7 0x78ffe182
#define PAINTERCANVASINTERFACE_V5 0x29ff7ac9
#define PAINTERCANVASINTERFACE_V5_1 0x29ff7ad0
#define PAINTERCANVASINTERFACE_V7 0x1e962374
#define PAINTERINTERFACE_CLASS_ID Class_ID(0x2f2ef7e9, 0x78ffe181)
#define PAINTERINTERFACEV5_INTERFACE Interface_ID(0x53b4520c, 0x29ff7ac9)
//These are defines used to when mirroring is enabled with point gathering
//a point can be hit by the original brush, the mirror brushed, or both
#define NO_MIRRROR 0
#define MIRRRORED 1
#define MIRRROR_SHARED 2
//These are IDs for the colors of the brush for use with the color manager
#define RINGCOLOR 0x445408e0
#define NORMALCOLOR 0x445408e1
#define RINGPRESSEDCOLOR 0x445408e2
#define NORMALPRESSEDCOLOR 0x445408e3
#define TRACECOLOR 0x445408e4
#define GIZMOCOLOR 0x445408e5
//These are IDs to define what the pressure effects on a stroke
#define PRESSURE_AFFECTS_NONE 0
#define PRESSURE_AFFECTS_STR 1
#define PRESSURE_AFFECTS_SIZE 2
#define PRESSURE_AFFECTS_BOTH 3
class IPainterInterface_V5
{
public:
//these are the esswential tools to get you started
//they cover the basics to get you started
//the canvas passes a pointer of itself to the painter, so the painter
//knows where to send the stroke messages
// ReferenceTarget *canvas - is the pointer to the canvas
virtual BOOL InitializeCallback(ReferenceTarget *canvas) = 0;//tested
//this loads of the nodes that you want to paint on, anytime you want
//to add delete a node this must be called
// int flags - not yet implemented does nothing but there to allow
// flags per node for special conditions
// Tab<INode*> &nodeList - a table of nodes that you want to paint on
virtual BOOL InitializeNodes(int flags, Tab<INode*> &nodeList) = 0;//tested
//This forces the quadtree to rebuilt. Any time you change a geometry or togopology
//of a node you passed to the InitializedNodes methode this must be called.
//Ideally I could listen to the notifyremessage changed and rebuild on that
//but the since rebuilding the quad tree is inetensive, I leave it up to the
//canvas as to when to rebuild so we can better control the amount of stack reevals
// BOOL updatePointGather - determines whether the pointGather data gets updated also
// normally if your mesh does not change shape or topo you dont
// need to update the pointgather. For instance ifyou rotate a view
// your quad tree needs to get updated but not the point list
virtual BOOL UpdateMeshes(BOOL updatePointGather) = 0;
//This is called when the a canvas wants to start a paint session.
virtual BOOL StartPaintSession() = 0;//tested
//This is called when the a canvas wants to end a paint session.
virtual BOOL EndPaintSession() = 0;//tested
//this return whether the user is in the paint mode, so a plugin can
//determine how to paint the UI paint button
virtual BOOL InPaintMode()=0;//tested
//this brings up the Painter Options dialog that lets the users sets various
//setting of the painter system
virtual BOOL BringUpOptions() = 0;//tested
//This lets you access the time stamp of each sample of a stroke. This lets you look at
//the acceleration of the mouse as it moves if say you wanted to paint a stroke and use
//it for an animation path.
virtual int *RetrieveTimeList(int &ct) = 0;
//These functions are additional tools to further hit testing and point gathering
//to help with finding points on a mesh that are within the stroke and theoir weights
//this function lets you hit test against the quad tree given a mouse coord
//it returns TRUE if that point insterects the quad tree
// IPoint2 mousePos - the position in screen space that you want to hit test agains
// Point3 &worldPoint, Point3 &worldNormal - the world hit point normal and position
// Point3 &localPoint, Point3 &localNormal - the local hit point normal and position
// Point3 &bary - the barycentry coord of the face that was hit
// int &index - the index of the face that was hit
// INode *node - the node that was hit
// BOOL &mirrorOn - whether mirroring was on or off
// Point3 &worldMirrorPoint, Point3 &worldMirrorNormal - the world hit point normal and position after it was mirrored
// Point3 &localMirrorPoint, Point3 &localMirrorNormal - the local hit point normal and position after it was mirrored
virtual BOOL TestHit(
IPoint2 mousePos,
Point3 &worldPoint, Point3 &worldNormal,
Point3 &localPoint, Point3 &localNormal,
Point3 &bary, int &index,
INode *node,
BOOL &mirrorOn,
Point3 &worldMirrorPoint, Point3 &worldMirrorNormal,
Point3 &localMirrorPoint, Point3 &localMirrorNormal
) = 0;
//Retrieves a random hit point around the last hit point or a specified hit point within the brush
//Useful if you want to do airbrush type effects or to just sample around the hit point
//it returns FALSE if a hit point was not found
// Point3 &worldPoint, Point3 &worldNormal - the world hit point normal and position
// Point3 &localPoint, Point3 &localNormal - the local hit point normal and position
// Point3 &bary - the barycentry coord of the face that was hit
// int &index - the index of the face that was hit
// float &strFromFalloff - the strength of the point based on the fall off of the brush
// INode *node - the node that was hit
// BOOL &mirrorOn - whether mirroring was on or off
// Point3 &worldMirrorPoint, Point3 &worldMirrorNormal - the world hit point normal and position after it was mirrored
// Point3 &localMirrorPoint, Point3 &localMirrorNormal - the local hit point normal and position after it was mirrored
// tabIndex is what hit you want to sample around if 0 or less it will hit around the last hit test
virtual BOOL RandomHit(Point3 &worldPoint, Point3 &worldNormal,
Point3 &localPoint, Point3 &localNormal,
Point3 &bary, int &index,
float &strFromFalloff, INode *node,
BOOL &mirrorOn,
Point3 &worldMirrorPoint, Point3 &worldMirrorNormal,
Point3 &localMirrorPoint, Point3 &localMirrorNormal,
int tabIndex) = 0;
//This will do random hit point along the stroke segment
//It will return FALSE if it does not find a hit
// Point3 &worldPoint, Point3 &worldNormal - the world hit point normal and position
// Point3 &localPoint, Point3 &localNormal - the local hit point normal and position
// Point3 &bary - the barycentry coord of the face that was hit
// int &index - the index of the face that was hit
// float &strFromFalloff - the strength of the point based on the fall off of the brush
// INode *node - the node that was hit
// BOOL &mirrorOn - whether mirroring was on or off
// Point3 &worldMirrorPoint, Point3 &worldMirrorNormal - the world hit point normal and position after it was mirrored
// Point3 &localMirrorPoint, Point3 &localMirrorNormal - the local hit point normal and position after it was mirrored
// tabIndex is what segment you want to sample around if 0 or less it will hit around the last segment
virtual BOOL RandomHitAlongStroke(Point3 &worldPoint, Point3 &worldNormal,
Point3 &localPoint, Point3 &localNormal,
Point3 &bary, int &index,
float &strFromFalloff, INode *node,
BOOL &mirrorOn,
Point3 &worldMirrorPoint, Point3 &worldMirrorNormal,
Point3 &localMirrorPoint, Point3 &localMirrorNormal,
int tabIndex) = 0;
//These next 2 methods are used if you want to do a custom stroke. Say for instance
//you wanted to just stroke a straight line, by default the painter uses a path stroke.
//so what you do on the PaintStroke method record the first and last mousePos, clear all the
//stroke data and then Add your custom stroke to the system.
//this clears out all the stroke data for the current stroke
virtual BOOL ClearStroke()=0;
//this adds a hit test to the current stroke
// IPoint2 mousePos the point that want to test to add
// BOOL rebuildPointGatherData this determines whether the poing gather data get rebuilt
// this allows you to delay the building of the data if you are addding mulitple
// points at once
// BOOL updateViewport determines if the viewports get updated after this call
virtual BOOL AddToStroke(IPoint2 mousePos, BOOL rebuildPointGatherData, BOOL updateViewport)=0;
//These are direct to stroke data lists if you are doing your own point gather
//Each stroke contains an arrays of data that are used to describe it such as
//position, str, radius etc.
//returns the number of sample points in the current stroke
virtual int GetStrokeCount() = 0;
//this returns a pointer to an array of floats where each entry is the str of a point sample
virtual float *GetStrokeStr() = 0;
//this returns a pointer to an array of floats where each entry is the radius of a point sample
virtual float *GetStrokeRadius() = 0;
//this returns a pointer to an array of point3s where each entry is the world space hit point of the sample
virtual Point3 *GetStrokePointWorld() = 0;
//this returns a pointer to an array of point3s where each entry is the world space normal of the sample
virtual Point3 *GetStrokeNormalWorld() = 0;
//this returns a pointer to an array of point3s where each entry is the world space hit point of the sample after it has been mirrored
virtual Point3 *GetStrokePointWorldMirror() = 0;
//this returns a pointer to an array of point3s where each entry is the world space normal of the sample after it has been mirrored
virtual Point3 *GetStrokeNormalWorldMirror() = 0;
//this returns a pointer to an array of floats where each entry is the pressure of a point sample either from a pressure sensitive tablet
//or from a predefined presssure graph
virtual float *GetStrokePressure() = 0;
//this returns a pointer to an array of point3s where each entry is the local space hit point of the sample
virtual Point3 *GetStrokePointLocal() = 0;
//this returns a pointer to an array of point3s where each entry is the local space normal of the sample
virtual Point3 *GetStrokeNormalLocal() = 0;
//this returns a pointer to an array of point3s where each entry is the local space hit point of the sample after it has been mirrored
virtual Point3 *GetStrokePointLocalMirror() = 0;
//this returns a pointer to an array of point3s where each entry is the world space normal of the sample after it has been mirrored
virtual Point3 *GetStrokeNormalLocalMirror() = 0;
//this returns a pointer to an array of Ipoint2s where each entry is the mouse pos in screen space for the sample
virtual IPoint2 *GetStrokeMousePos() = 0;
//this returns a pointer to an array of s where each entry is whether the sample hit the mesh or not
//the system allows the user to paint off the mesh, where all hitpoint are projected onto a plane
//based on the last hit point and norml,
virtual BOOL *GetStrokeHitList() = 0;
//this returns a pointer to an array of point3s where each entry is the barycentri coords of the sample
virtual Point3 *GetStrokeBary() = 0;
//this returns a pointer to an array of ints where each entry is the index of the face of the sample
virtual int *GetStrokeIndex() = 0;
//this returns a pointer to an array of bools where each entry is the state of the shift of the sample
virtual BOOL *GetStrokeShift() = 0;
//this returns a pointer to an array of bools where each entry is the state of the ctrl of the sample
virtual BOOL *GetStrokeCtrl() = 0;
//this returns a pointer to an array of bools where each entry is the state of the alt of the sample
virtual BOOL *GetStrokeAlt() = 0;
//this returns a pointer to an array of INode where each entry is the INode of the sample
virtual INode **GetStrokeNode() = 0;
//this returns a pointer to an array of ints where each entry is the time stamp of the sample
virtual int *GetStrokeTime() = 0;
//given a point in world space it returns the str of that point based on the current stroke
virtual float GetStrFromPoint(Point3 point) = 0;
//These functions let you interogate and set the state of the options dialog
//this is used to ask the system if a stroke str or size changes as it is painted
//the user can set predetermined shapes graphs and attach them to the str or size
//of brush based on the position of the in the curve it is. If you are in an interactive
//mode this data will always be changing so you can use this to get the current str/sizes
//of th hit points. If you are in a non interactive mode you do not need to call this
//since all the correct sizes/str are sent to the end stroke arrays. If the user has not
//specified any predetermined graphs the arrays will be NULL
// int &ct - count of the arrays
// float *radius - array of radii size
//these return array of floats one entry for each point on the stroke
virtual float *GetPredefineStrStrokeData(int &ct)=0;
virtual float *GetPredefineSizeStrokeData(int &ct)=0;
//put in access to all the dialog properties
//This will build a vertex normal list that you can access through RetrievePointGatherNormals
//This is by default is off to save memory. Also if you use a custom point list through
//LoadCustomPointGather no normals will be built since there is no topo data to build them from
virtual BOOL GetBuildNormalData() = 0;
virtual void SetBuildNormalData(BOOL enable) = 0;
//These functions deal with the point gather. The painter can automatically determines the weights
//of points by using the PointGather
//These let turns on/off the point gather and get its stae. If this is enabled,
//the points of the mesh will be used as your points
virtual BOOL GetEnablePointGather() = 0;
virtual void SetEnablePointGather(BOOL enable) = 0;//tested
//This lets you set up a custom list of points to weight to override the currentlist
//for instance if you have a non mesh you will need to do this since by default the
//point gather uses the mesh points to weight
// int ct the number of points that you want to add
// Point3 *points the points you want to add in world space?
// INode *node which node you want to assign them to
virtual BOOL LoadCustomPointGather(int ct, Point3 *points, INode *node) = 0;//tested
//Once a stroke has started you can retrieve data about you point list such
//as weigths, str etc.
//This retrieves the weight of the points based on the current stroke
// INode *node the node that you want to inspect
// int &ct the number of points in the array
virtual float *RetrievePointGatherWeights(INode *node, int &ct) = 0;
//This retrieves the strength of the points based on the current stroke
// INode *node the node that you want to inspect
// int &ct the number of points in the array
virtual float *RetrievePointGatherStr(INode *node, int &ct) = 0;//tested
//This retrieves the whether the point was affected by a mirror stroke
// INode *node the node that you want to inspect
// int &ct the number of points in the array
virtual BOOL *RetrievePointGatherIsMirror(INode *node, int &ct) = 0;//tested
//This retrieves the the array of the points
// INode *node the node that you want to inspect
// int &ct the number of points in the array
virtual Point3 *RetrievePointGatherPoints(INode *node, int &ct) = 0;//tested
//Normals are in local space and only valid if you do not use a CustomPointGather
//This retrieves the the array of the normals
// INode *node the node that you want to inspect
// int &ct the number of points in the array
virtual Point3 *RetrievePointGatherNormals(INode *node, int &ct) = 0;
//This retrieves the the array of the U vals, this is how far along the stroke that point is
// INode *node the node that you want to inspect
// int &ct the number of points in the array
virtual float *RetrievePointGatherU(INode *node, int &ct) = 0;
//functions to get the mirror plane data
//NOTE all mirror function work in world space
//returns if the mirror plane is on or off
virtual BOOL GetMirrorEnable() = 0 ;//tested
//lets you set whether the mirror plane is on/off
virtual void SetMirrorEnable(BOOL enable) = 0;
//returns the center of the mirror plane in world space coords
//the mirror plane is always aligned to the world axis
virtual Point3 GetMirrorPlaneCenter() = 0;//tested
//returns which mirror axis is active
// 0 = x axis
// 1 = y axis
// 2 = z axis
virtual int GetMirrorAxis() = 0;//tested
//lets you set the mirror axis where
// 0 = x axis
// 1 = y axis
// 2 = z axis
virtual void SetMirrorAxis(int dir) = 0;
virtual float GetMirrorOffset() = 0;//tested
virtual void SetMirrorOffset(float offset) = 0;//tested
//These 2 function let you get and set the quad tree depth
//The deeper the quad tree the more memory you consume, but the
//more memory you consume (the memory consumption is exponential so becarefule)
virtual int GetTreeDepth() = 0;//tested
virtual void SetTreeDepth(int depth) = 0;//tested
//These 2 function let you get and set the Update on Mouse Up option
//When this is enabled you will not get PaintStroke calls.
//Instead you will get all the points at the end through the endStoke function
virtual BOOL GetUpdateOnMouseUp() = 0;
virtual void SetUpdateOnMouseUp(BOOL update) = 0;
//These 2 function let you get and set the lag rate
//When this is enabled you get PaintStroke delayed by the lag rate calls.
//every x(lagrate) stroke points you willget the strokes.
virtual int GetLagRate() = 0;
virtual void SetLagRate(int lagRate) = 0;
//These functions control how the brush behaves
//These 4 functions let you set the min/max strength for a brush.
//If there is no pressure sensitive device attached only the max str is used
virtual float GetMinStr() = 0;//tested
virtual void SetMinStr(float str) = 0;//tested
virtual float GetMaxStr() = 0;//tested
virtual void SetMaxStr(float str) = 0;//tested
//These 4 functions let you set the min/max radius for a brush.
//If there is no pressure sensitive device attached only the max radius is used
virtual float GetMinSize() = 0;//tested
virtual void SetMinSize(float str) = 0;//tested
virtual float GetMaxSize() = 0;//tested
virtual void SetMaxSize(float str) = 0;//tested
//These 2 functions get/set the aditive mode
//When additive mode is off the weight is absolutely set based on the current stroke hit.
//Previous stroke data is over written. In Additive mode the strength is added to current
//strength and is not capped.
virtual BOOL GetAdditiveMode()=0;//tested
virtual void SetAdditiveMode(BOOL enable)=0;//tested
//This returns the brush falloff curve if you want to handle the doing the brush
//falloff yourself
virtual ICurve *GetFalloffGraph()=0;
//These functions allow you to control the display of a stroke
//Colors are stored in the color manager. See the color ID defines at the top
//This lets you get/set whether the ring is drawn around the hit point
virtual BOOL GetDrawRing()=0;//tested
virtual void SetDrawRing(BOOL draw)=0;//tested
//This lets you get/set whether the normal vector is drawn at the hit point
virtual BOOL GetDrawNormal()=0;//tested
virtual void SetDrawNormal(BOOL draw)=0;//tested
//This lets you get/set whether the a line is left behind a stroke as it is drawn
virtual BOOL GetDrawTrace()=0;//tested
virtual void SetDrawTrace(BOOL draw)=0;//tested
//These functions deal with the pressure sensitive devices and mimicing pressure sensitivity
//These 2 functions let you get/set whether pressure sensistivity is turned on
//when Pressure is enabled it can affect Str, Radius, Both Str and Radius or Nothing
//You would nothing fr instance if you wanted to do a custom affect for pressure.
virtual BOOL GetPressureEnable()=0;//tested
virtual void SetPressureEnable(BOOL enable)=0;//tested
//These 2 functions Get/Set what the pressure of a brush affects
//You can affact Str. Radius, Str and Radius or None
//See the defines at top
virtual BOOL GetPressureAffects()=0;//tested
virtual void SetPressureAffects(int affect)=0;//tested
//These function let you get/set whether a predefined str is enabled for a stroke.
//A predefined str stroke lets the user graph the str of stroke over the length of stroke
virtual BOOL GetPredefinedStrEnable()=0;//tested
virtual void SetPredefinedStrEnable(BOOL enable)=0;//tested
//These function let you get/set whether a predefined radius is enabled for a stroke.
//A predefined radius stroke lets the user graph the radius of stroke over the length of stroke
virtual BOOL GetPredefinedSizeEnable()=0;//tested
virtual void SetPredefinedSizeEnable(BOOL enable)=0;//tested
virtual ICurve *GetPredefineSizeStrokeGraph()=0;
virtual ICurve *GetPredefineStrStrokeGraph()=0;
virtual float GetNormalScale() = 0;
virtual void SetNormalScale(float scale) = 0;
virtual BOOL GetMarkerEnable() = 0;
virtual void SetMarkerEnable(BOOL on) = 0;
virtual float GetMarker() = 0;
virtual void SetMarker(float pos) = 0;
// 0 = creates a plance based on your last hit point and normal
// 1 = a zdepth into the screen
// 2 = a point in world space aligned to current view
virtual int GetOffMeshHitType() = 0;
virtual void SetOffMeshHitType(int type) = 0;
virtual float GetOffMeshHitZDepth() = 0;
virtual void SetOffMeshHitZDepth(float depth) = 0;
virtual Point3 GetOffMeshHitPos() = 0;
virtual void SetOffMeshHitPos(Point3 pos) = 0;
};
// This is a class that lets you go from mesh space to patch space
// basically the painter only paints on meshes
// you can create an array of this type so you can look up a hit face
// and then get a patch index from it and the UVW of the hit space on the patch
class FaceDataFromPatch
{
public:
int owningPatch; // the patch that own this face
Point2 st[3]; // the UVW space of the corners of the patch
};
class IPainterRightClickHandler
{
public:
virtual void RightClick ()=0;
};
class IPainterInterface_V7 : public IPainterInterface_V5
{
public:
//this loads of the nodes that you want to paint on, anytime you want
//to add delete a node this must be called. This use the object state passed ot it
//instead of the one gotten from the node to get the hit mesh. NOTE I do not hang onto
//any of the data in the ObjectState. I just get the a copy of the mesh from it.
// int flags - not yet implemented does nothing but there to allow
// flags per node for special conditions
// Tab<INode*> &nodeList - a table of nodes that you want to paint on
// Tab<ObjectState*> objList - a table of objects states one per node to use as your hit node
virtual BOOL InitializeNodesByObjState(int flags, Tab<INode*> &nodeList, Tab<ObjectState> &objList) = 0;//tested
//This forces the quadtree to rebuilt. Any time you change a geometry or togopology
//of a node you passed to the InitializedNodes methode this must be called.
//Ideally I could listen to the notifyremessage changed and rebuild on that
//but the since rebuilding the quad tree is inetensive, I leave it up to the
//canvas as to when to rebuild so we can better control the amount of stack reevals
//NOTE I do not hang onto
//any of the data in the ObjectState. I just get the a copy of the mesh from it.
// BOOL updatePointGather - determines whether the pointGather data gets updated also
// normally if your mesh does not change shape or topo you dont
// need to update the pointgather. For instance ifyou rotate a view
// your quad tree needs to get updated but not the point list
// Tab<ObjectState*> objList - a table of objects states one per node to use as your hit node
virtual BOOL UpdateMeshesByObjState(BOOL updatePointGather, Tab<ObjectState> &objList) = 0;
//This lets you take a patch and get a list or tri mesh faces wher each tri has an owning
//patch index and the UVW space of that face. This lets you get patch UVW space
virtual void GetPatchFaceData(PatchMesh &patch, Tab<FaceDataFromPatch> &faceData) = 0;
// This overload of the method used to start a paint session allows you to submit a class
// which will handle right-click events in the paint mouse proc.
// This allows you to end the paint proc however you need to.
// If rightClicker is NULL, or if the no-argument version of StartPaintSession is used,
// nothing will happen on right-click.
virtual BOOL StartPaintSession (IPainterRightClickHandler *rightClicker) = 0;
// I have to add this one over again, otherwise it doesn't show up in the V7 interface:
//This is called when the a canvas wants to start a paint session.
virtual BOOL StartPaintSession() = 0;//tested
//this set the str limit min/max for while dragging to chnage the str
virtual float GetStrDragLimitMin() = 0;
virtual void SetStrDragLimitMin(float l) = 0;
virtual float GetStrDragLimitMax() = 0;
virtual void SetStrDragLimitMax(float l) = 0;
};
//This is the Max5 version of a PainterCanvas. Any plugin that wants to be able to be painted
//on must sub class from this class or a later version of it.
//Basically this calls contains all the methods that deal with a paint stroke.
class IPainterCanvasInterface_V5
{
public:
// This is called when the user tart a pen stroke
virtual BOOL StartStroke() = 0;
//This is called as the user strokes across the mesh or screen with the mouse down
//This only gets called if the interactive mode is off (the user has turned off Update on Mouse Up)
// BOOL hit - if this is a hit or not, since the user can paint off a mesh
// IPoint2 mousePos - this is mouse coords of the current hit in view space
// Point3 worldPoint - this is the hit point on the painted mesh in world space
// Point3 worldNormal - this is the normal of the hit point on the painted mesh in world space
// Point3 localPoint - this is the hit point on the painted mesh in local space of the mesh that was hit
// Point3 localNormal - this is the normal of the hit point on the painted mesh in local space of the mesh that was hit
// Point3 bary - this the barcentric coords of the hit point based on the face that was hit
// this may or may not be valid depending on the state of the stack. For instance
// if a paint modifier was below a MeshSmooth, the barycentric coords would be based on
// the MeshSmooth'ed mesh and not the mesh at the point of the paint modifier
// int index - the index of the face that was hit. See the warning in Point3 bary above.
// BOOL shift, ctrl, alt - the state of the shift, alt, and ctrl keys when the point was hit
// float radius - of the radius of the brush when the point was hit, this is after all modifiers
// have been applied like pressure or predefined radius etc
// float str - of the strength of the brush when the point was hit, this is after all modifiers
// have been applied like pressure or predefined radius etc
// float pressure - if a pressure sensitive tablet is used this value will be the pressure of the stroke
// ranging from 0 to 1
// INode *node - this node that got hit
// BOOL mirrorOn - whther the user had mirror on for the stroke, you can ignore the next for params if false
// Point3 worldMirrorPoint, Point3 worldMirrorNormal - the mirrored stroke pos
// Point3 localMirrorPoint, Point3 localMirrorNormal - the mirros stroke normals
virtual BOOL PaintStroke(
BOOL hit,
IPoint2 mousePos,
Point3 worldPoint, Point3 worldNormal,
Point3 localPoint, Point3 localNormal,
Point3 bary, int index,
BOOL shift, BOOL ctrl, BOOL alt,
float radius, float str,
float pressure, INode *node,
BOOL mirrorOn,
Point3 worldMirrorPoint, Point3 worldMirrorNormal,
Point3 localMirrorPoint, Point3 localMirrorNormal
) = 0;
// This is called as the user ends a strokes when the users has it set to always update
virtual BOOL EndStroke() = 0;
// This is called as the user ends a strokes when the users has it set to update on mouse up only
// the canvas gets a list of all points, normals etc instead of one at a time
// int ct - the number of elements in the following arrays
// <...> see paintstroke() these are identical except they are arrays of values
virtual BOOL EndStroke(int ct, BOOL *hit, IPoint2 *mousePos,
Point3 *worldPoint, Point3 *worldNormal,
Point3 *localPoint, Point3 *localNormal,
Point3 *bary, int *index,
BOOL *shift, BOOL *ctrl, BOOL *alt,
float *radius, float *str,
float *pressure, INode **node,
BOOL mirrorOn,
Point3 *worldMirrorPoint, Point3 *worldMirrorNormal,
Point3 *localMirrorPoint, Point3 *localMirrorNormal ) = 0;
// This is called as the user cancels a stroke by right clicking
virtual BOOL CancelStroke() = 0;
//This is called when the painter want to end a paint session for some reason.
virtual BOOL SystemEndPaintSession() = 0;
//this is called when the painter updates the view ports
//this will let you do custom drawing if you need to
virtual void PainterDisplay(TimeValue t, ViewExp *vpt, int flags) = 0;
};
//This is the Max5.1 version of a PainterCanvas.
//This interface changes how the command mode behaves
//It adds the ability to send back to the canvas whether to start or end the paint mode
//This bacially replaces the SystemEndPaintSession and also
class IPainterCanvasInterface_V5_1
{
public:
//the painter interface will call these when it wants to start the painter or end it
//an example of this is when the user scrubs the time slider whne in a paint session
//the system will turn off the paint mode while scrubbing so you will get a CanvasEndPaint
//then when the user stops srcubing it will try to turn it back on using CanvasStartPaint
//so if you use this interface after you call StartPaintSession() you will imediately get
//a CanvasStartPaint callback where all your setup code and UI code shoudl be handled
virtual void CanvasStartPaint()=0;
virtual void CanvasEndPaint()=0;
};
class IPainterCanvasInterface_V7
{
public:
virtual void OnPaintBrushChanged() = 0;
};
#endif

View File

@ -0,0 +1,620 @@
/**********************************************************************
*<
FILE: IParticleObjectExt.h
DESCRIPTION: API extension for a ParticleObject class
the interface is used by particles systems and
particle groups. The time parameter does not
used in property access since the particle system
gives out property of the current state. You can
change the state by using UpdateParticles method
with the time specified.
CREATED BY: Oleg Bayborodin
HISTORY: created 10-30-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLEOBEJCTEXT_H_
#define _IPARTICLEOBEJCTEXT_H_
#include "Max.h"
// interface ID
#define PARTICLEOBJECTEXT_INTERFACE Interface_ID(0x66c2429a, 0x38d60a0b)
#define GetParticleObjectExtInterface(obj) ((IParticleObjectExt*)obj->GetInterface(PARTICLEOBJECTEXT_INTERFACE))
class IParticleObjectExt : public FPMixinInterface
{
public:
// function IDs
enum { kUpdateParticles,
kSetEveryStepUpdateScriptLine,
kSetEveryStepUpdateScriptFile,
kSetFinalStepUpdateScriptLine,
kSetFinalStepUpdateScriptFile,
kExecuteEveryStepUpdateScript,
kExecuteFinalStepUpdateScript,
kGetUpdateTime,
kGetUpdateInterval,
kNumParticles,
kNumParticlesGenerated,
kAddParticle,
kAddParticles,
kDeleteParticle,
kDeleteParticles,
kGetParticleBornIndex,
kHasParticleBornIndex,
kGetParticleGroup,
kGetParticleIndex,
kGetCurrentParticleIndex,
kGetCurrentParticleBornIndex,
kSetCurrentParticleIndex,
kSetCurrentParticleBornIndex,
kGetParticleAgeByIndex,
kGetParticleAgeByBornIndex,
kSetParticleAgeByIndex,
kSetParticleAgeByBornIndex,
kGetParticleAge,
kSetParticleAge,
kGetParticleLifeSpanByIndex,
kGetParticleLifeSpanByBornIndex,
kSetParticleLifeSpanByIndex,
kSetParticleLifeSpanByBornIndex,
kGetParticleLifeSpan,
kSetParticleLifeSpan,
kGetParticleGroupTimeByIndex,
kGetParticleGroupTimeByBornIndex,
kSetParticleGroupTimeByIndex,
kSetParticleGroupTimeByBornIndex,
kGetParticleGroupTime,
kSetParticleGroupTime,
kGetParticlePositionByIndex,
kGetParticlePositionByBornIndex,
kSetParticlePositionByIndex,
kSetParticlePositionByBornIndex,
kGetParticlePosition,
kSetParticlePosition,
kGetParticleSpeedByIndex,
kGetParticleSpeedByBornIndex,
kSetParticleSpeedByIndex,
kSetParticleSpeedByBornIndex,
kGetParticleSpeed,
kSetParticleSpeed,
kGetParticleOrientationByIndex,
kGetParticleOrientationByBornIndex,
kSetParticleOrientationByIndex,
kSetParticleOrientationByBornIndex,
kGetParticleOrientation,
kSetParticleOrientation,
kGetParticleSpinByIndex,
kGetParticleSpinByBornIndex,
kSetParticleSpinByIndex,
kSetParticleSpinByBornIndex,
kGetParticleSpin,
kSetParticleSpin,
kGetParticleScaleByIndex,
kGetParticleScaleByBornIndex,
kSetParticleScaleByIndex,
kSetParticleScaleByBornIndex,
kGetParticleScale,
kSetParticleScale,
kGetParticleScaleXYZByIndex,
kGetParticleScaleXYZByBornIndex,
kSetParticleScaleXYZByIndex,
kSetParticleScaleXYZByBornIndex,
kGetParticleScaleXYZ,
kSetParticleScaleXYZ,
kGetParticleTMByIndex,
kGetParticleTMByBornIndex,
kSetParticleTMByIndex,
kSetParticleTMByBornIndex,
kGetParticleTM,
kSetParticleTM,
kGetParticleSelectedByIndex,
kGetParticleSelectedByBornIndex,
kSetParticleSelectedByIndex,
kSetParticleSelectedByBornIndex,
kGetParticleSelected,
kSetParticleSelected,
kGetParticleShapeByIndex,
kGetParticleShapeByBornIndex,
kSetParticleShapeByIndex,
kSetParticleShapeByBornIndex,
kGetParticleShape,
kSetParticleShape,
kSetGlobalParticleShape,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kUpdateParticles, UpdateParticles, TYPE_INODE, TYPE_TIMEVALUE);
VFN_1(kSetEveryStepUpdateScriptLine, SetEveryStepUpdateScriptLine, TYPE_STRING);
VFN_1(kSetEveryStepUpdateScriptFile, SetEveryStepUpdateScriptFile, TYPE_FILENAME);
VFN_1(kSetFinalStepUpdateScriptLine, SetFinalStepUpdateScriptLine, TYPE_STRING);
VFN_1(kSetFinalStepUpdateScriptFile, SetFinalStepUpdateScriptFile, TYPE_FILENAME);
VFN_0(kExecuteEveryStepUpdateScript, ExecuteEveryStepUpdateScript );
VFN_0(kExecuteFinalStepUpdateScript, ExecuteFinalStepUpdateScript );
FN_0(kGetUpdateTime, TYPE_TIMEVALUE, GetUpdateTime );
VFN_2(kGetUpdateInterval, GetUpdateInterval, TYPE_TIMEVALUE_BR, TYPE_TIMEVALUE_BR);
RO_PROP_FN(kNumParticles, NumParticles, TYPE_INT);
RO_PROP_FN(kNumParticlesGenerated, NumParticlesGenerated, TYPE_INT);
FN_0(kAddParticle, TYPE_bool, AddParticle );
FN_1(kAddParticles, TYPE_bool, AddParticles, TYPE_INT);
FN_1(kDeleteParticle, TYPE_bool, DeleteParticle, TYPE_INDEX);
FN_2(kDeleteParticles, TYPE_bool, DeleteParticles, TYPE_INDEX, TYPE_INT);
FN_1(kGetParticleBornIndex, TYPE_INDEX, GetParticleBornIndex, TYPE_INDEX);
FN_2(kHasParticleBornIndex, TYPE_bool, HasParticleBornIndex, TYPE_INDEX, TYPE_INDEX_BR);
FN_1(kGetParticleGroup, TYPE_INODE, GetParticleGroup, TYPE_INDEX);
FN_1(kGetParticleIndex, TYPE_INDEX, GetParticleIndex, TYPE_INDEX);
PROP_FNS(kGetCurrentParticleIndex, GetCurrentParticleIndex, kSetCurrentParticleIndex, SetCurrentParticleIndex, TYPE_INDEX);
PROP_FNS(kGetCurrentParticleBornIndex, GetCurrentParticleBornIndex, kSetCurrentParticleBornIndex, SetCurrentParticleBornIndex,TYPE_INDEX);
FN_1(kGetParticleAgeByIndex, TYPE_TIMEVALUE, GetParticleAgeByIndex, TYPE_INDEX);
FN_1(kGetParticleAgeByBornIndex, TYPE_TIMEVALUE, GetParticleAgeByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleAgeByIndex, SetParticleAgeByIndex, TYPE_INDEX, TYPE_TIMEVALUE);
VFN_2(kSetParticleAgeByBornIndex, SetParticleAgeByBornIndex, TYPE_INDEX, TYPE_TIMEVALUE);
PROP_FNS(kGetParticleAge, GetParticleAge, kSetParticleAge, SetParticleAge, TYPE_TIMEVALUE);
FN_1(kGetParticleLifeSpanByIndex, TYPE_TIMEVALUE, GetParticleLifeSpanByIndex, TYPE_INDEX);
FN_1(kGetParticleLifeSpanByBornIndex, TYPE_TIMEVALUE, GetParticleLifeSpanByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleLifeSpanByIndex, SetParticleLifeSpanByIndex, TYPE_INDEX, TYPE_TIMEVALUE);
VFN_2(kSetParticleLifeSpanByBornIndex, SetParticleLifeSpanByBornIndex, TYPE_INDEX, TYPE_TIMEVALUE);
PROP_FNS(kGetParticleLifeSpan, GetParticleLifeSpan, kSetParticleLifeSpan, SetParticleLifeSpan, TYPE_TIMEVALUE);
FN_1(kGetParticleGroupTimeByIndex, TYPE_TIMEVALUE, GetParticleGroupTimeByIndex, TYPE_INDEX);
FN_1(kGetParticleGroupTimeByBornIndex, TYPE_TIMEVALUE, GetParticleGroupTimeByBornIndex,TYPE_INDEX);
VFN_2(kSetParticleGroupTimeByIndex, SetParticleGroupTimeByIndex, TYPE_INDEX, TYPE_TIMEVALUE);
VFN_2(kSetParticleGroupTimeByBornIndex, SetParticleGroupTimeByBornIndex,TYPE_INDEX, TYPE_TIMEVALUE);
PROP_FNS(kGetParticleGroupTime, GetParticleGroupTime, kSetParticleGroupTime, SetParticleGroupTime, TYPE_TIMEVALUE);
FN_1(kGetParticlePositionByIndex, TYPE_POINT3, GetParticlePositionByIndex, TYPE_INDEX);
FN_1(kGetParticlePositionByBornIndex, TYPE_POINT3, GetParticlePositionByBornIndex, TYPE_INDEX);
VFN_2(kSetParticlePositionByIndex, SetParticlePositionByIndex, TYPE_INDEX, TYPE_POINT3);
VFN_2(kSetParticlePositionByBornIndex, SetParticlePositionByBornIndex, TYPE_INDEX, TYPE_POINT3);
PROP_FNS(kGetParticlePosition, GetParticlePosition, kSetParticlePosition, SetParticlePosition, TYPE_POINT3);
FN_1(kGetParticleSpeedByIndex, TYPE_POINT3, GetParticleSpeedByIndex, TYPE_INDEX);
FN_1(kGetParticleSpeedByBornIndex, TYPE_POINT3, GetParticleSpeedByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleSpeedByIndex, SetParticleSpeedByIndex, TYPE_INDEX, TYPE_POINT3);
VFN_2(kSetParticleSpeedByBornIndex, SetParticleSpeedByBornIndex, TYPE_INDEX, TYPE_POINT3);
PROP_FNS(kGetParticleSpeed, GetParticleSpeed, kSetParticleSpeed, SetParticleSpeed, TYPE_POINT3);
FN_1(kGetParticleOrientationByIndex, TYPE_POINT3, GetParticleOrientationByIndex, TYPE_INDEX);
FN_1(kGetParticleOrientationByBornIndex, TYPE_POINT3, GetParticleOrientationByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleOrientationByIndex, SetParticleOrientationByIndex, TYPE_INDEX, TYPE_POINT3);
VFN_2(kSetParticleOrientationByBornIndex, SetParticleOrientationByBornIndex, TYPE_INDEX, TYPE_POINT3);
PROP_FNS(kGetParticleOrientation, GetParticleOrientation, kSetParticleOrientation, SetParticleOrientation, TYPE_POINT3);
FN_1(kGetParticleSpinByIndex, TYPE_ANGAXIS, GetParticleSpinByIndex, TYPE_INDEX);
FN_1(kGetParticleSpinByBornIndex, TYPE_ANGAXIS, GetParticleSpinByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleSpinByIndex, SetParticleSpinByIndex, TYPE_INDEX, TYPE_ANGAXIS);
VFN_2(kSetParticleSpinByBornIndex, SetParticleSpinByBornIndex, TYPE_INDEX, TYPE_ANGAXIS);
PROP_FNS(kGetParticleSpin, GetParticleSpin, kSetParticleSpin, SetParticleSpin, TYPE_ANGAXIS);
FN_1(kGetParticleScaleByIndex, TYPE_FLOAT, GetParticleScaleByIndex, TYPE_INDEX);
FN_1(kGetParticleScaleByBornIndex, TYPE_FLOAT, GetParticleScaleByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleScaleByIndex, SetParticleScaleByIndex, TYPE_INDEX, TYPE_FLOAT);
VFN_2(kSetParticleScaleByBornIndex, SetParticleScaleByBornIndex, TYPE_INDEX, TYPE_FLOAT);
PROP_FNS(kGetParticleScale, GetParticleScale, kSetParticleScale, SetParticleScale, TYPE_FLOAT);
FN_1(kGetParticleScaleXYZByIndex, TYPE_POINT3,GetParticleScaleXYZByIndex, TYPE_INDEX);
FN_1(kGetParticleScaleXYZByBornIndex, TYPE_POINT3,GetParticleScaleXYZByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleScaleXYZByIndex, SetParticleScaleXYZByIndex, TYPE_INDEX, TYPE_POINT3);
VFN_2(kSetParticleScaleXYZByBornIndex, SetParticleScaleXYZByBornIndex, TYPE_INDEX, TYPE_POINT3);
PROP_FNS(kGetParticleScaleXYZ, GetParticleScaleXYZ, kSetParticleScaleXYZ, SetParticleScaleXYZ, TYPE_POINT3);
FN_1(kGetParticleTMByIndex, TYPE_MATRIX3, GetParticleTMByIndex, TYPE_INDEX);
FN_1(kGetParticleTMByBornIndex, TYPE_MATRIX3, GetParticleTMByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleTMByIndex, SetParticleTMByIndex, TYPE_INDEX, TYPE_MATRIX3);
VFN_2(kSetParticleTMByBornIndex, SetParticleTMByBornIndex, TYPE_INDEX, TYPE_MATRIX3);
PROP_FNS(kGetParticleTM, GetParticleTM, kSetParticleTM, SetParticleTM, TYPE_MATRIX3);
FN_1(kGetParticleSelectedByIndex, TYPE_bool, GetParticleSelectedByIndex, TYPE_INDEX);
FN_1(kGetParticleSelectedByBornIndex, TYPE_bool, GetParticleSelectedByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleSelectedByIndex, SetParticleSelectedByIndex, TYPE_INDEX, TYPE_bool);
VFN_2(kSetParticleSelectedByBornIndex, SetParticleSelectedByBornIndex, TYPE_INDEX, TYPE_bool);
PROP_FNS(kGetParticleSelected, GetParticleSelected, kSetParticleSelected, SetParticleSelected, TYPE_bool);
FN_1(kGetParticleShapeByIndex, TYPE_MESH, GetParticleShapeByIndex, TYPE_INDEX);
FN_1(kGetParticleShapeByBornIndex, TYPE_MESH, GetParticleShapeByBornIndex, TYPE_INDEX);
VFN_2(kSetParticleShapeByIndex, SetParticleShapeByIndex, TYPE_INDEX, TYPE_MESH);
VFN_2(kSetParticleShapeByBornIndex, SetParticleShapeByBornIndex, TYPE_INDEX, TYPE_MESH);
VFN_1(kSetGlobalParticleShape, SetGlobalParticleShape, TYPE_MESH);
PROP_FNS(kGetParticleShape, GetParticleShape, kSetParticleShape, SetParticleShape, TYPE_MESH);
END_FUNCTION_MAP
// Implemented by the Plug-In.
// Since particles may have different motion, the particle system should supply speed information
// on per vertex basis for a motion blur effect to be able to generate effect.
// the method is not exposed in maxscript
// returns true if the object supports the method
// Parameters:
// TimeValue t
// The time to get the mesh vertices speed.
// INode *inode
// The node in the scene
// View& view
// If the renderer calls this method it will pass the view information here.
// Tab<Point3>& speed
// speed per vertex in world coordinates
virtual bool GetRenderMeshVertexSpeed(TimeValue t, INode *inode, View& view, Tab<Point3>& speed) { return false; }
// Implemented by the Plug-In.
// Particle system may supply multiple render meshes. If this method returns a positive number,
// then GetMultipleRenderMesh and GetMultipleRenderMeshTM will be called for each mesh,
// instead of calling GetRenderMesh. The method has a current time parameter which is not
// the case with the NumberOfRenderMeshes method of GeomObject class
// the method is not exposed in maxscript
// Parameters:
// TimeValue t
// Time for the number of render meshes request.
// INode *inode
// The node in the scene
// View& view
// If the renderer calls this method it will pass the view information here.
virtual int NumberOfRenderMeshes(TimeValue t, INode *inode, View& view) { return 0; }
// For multiple render meshes, if it supports vertex speed for motion blur, this method must be implemented
// Since particles may have different motion, the particle system should supply speed information
// on per vertex basis for a motion blur effect to be able to generate effect.
// the method is not exposed in maxscript
// returns true if the particular render mesh supports the method
// Parameters:
// TimeValue t
// The time to get the mesh vertices speed.
// INode *inode
// The node in the scene
// View& view
// If the renderer calls this method it will pass the view information here.
// int meshNumber
// Specifies which of the multiple meshes is being asked for.
// Tab<Point3>& speed
// speed per vertex in world coordinates
virtual bool GetMultipleRenderMeshVertexSpeed(TimeValue t, INode *inode, View& view, int meshNumber, Tab<Point3>& speed) { return false; }
// Implemented by the Plug-In.
// This method is called so the particle system can update its state to reflect
// the current time passed. This may involve generating new particle that are born,
// eliminating old particles that have expired, computing the impact of collisions or
// force field effects, and modify properties of the particles.
// Parameters:
// TimeValue t
// The particles should be updated to reflect this time.
// INode *node
// This is the emitter node.
// the method is not exposed in maxscript
virtual void UpdateParticles(INode *node, TimeValue t) { ; }
// Implemented by the Plug-in
// This method defines a maxscript to be executed after every step of particle system
// update integration. When a particle system updates itself from frame 0 to frame 10,
// it goes through a series of integration steps: frame 1, frame 2, frame 3, ... or even
// smaller steps up to the frame 10. The script will be called after each integration
// step to update particle properties. Name of the file is stored by the particle system
// Parameters:
// TCHAR *script
// The maxscript
// TCHAR *file
// The file name for the script file.
virtual void SetEveryStepUpdateScriptLine(TCHAR* script) { ; }
virtual void SetEveryStepUpdateScriptFile(TCHAR* file) { ; }
// Implemented by the Plug-in
// This method defines a maxscript to be executed after last step of particle system
// update integration. When a particle system updates itself from frame 0 to frame 10,
// it goes through a series of integration steps: frame 1, frame 2, frame 3, ... or even
// smaller steps up to the frame 10. The script will be called after the last integration
// step at frame 10. If you don't need to update particle properties in intermediate steps
// then use this method, i.e. if you can define particle position given the current
// frame without speed data.
// You can use both SetUpdateScript and SetFinalUpdateScript methods at the same time.
// Name of the file is stored by the particle system.
// Parameters:
// TCHAR *script
// The maxscript
// TCHAR *file
// The file name for the script file.
virtual void SetFinalStepUpdateScriptLine(TCHAR* script) { ; }
virtual void SetFinalStepUpdateScriptFile(TCHAR* file) { ; }
// Implemented by the Plug-in
// This methods envokes execution of update scripts
// -- for internal use only (may-21-2002)
virtual void ExecuteEveryStepUpdateScript() { ; }
virtual void ExecuteFinalStepUpdateScript() { ; }
// Implemented by the Plug-in
// Use this method to retrieve time of the current update step. The update time maybe unrelated to
// the current time of the scene.
virtual TimeValue GetUpdateTime() { return 0; }
// Implemented by the Plug-in
// Use this method to retrieve time interval of the current update step. The update time maybe unrelated to
// the current time of the scene. The GetUpdateTime method above retrieves the finish time.
virtual void GetUpdateInterval(TimeValue& start, TimeValue& finish) { ; }
// Implemented by the Plug-In.
// The method returns how many particles are currently in the particle system.
// Some of these particles may be dead or not born yet (indicated by GetAge(..) method =-1).
virtual int NumParticles() = 0;
// Implemented by the Plug-In.
// The method returns how many particles were born. Since particle systems have
// a tendency of reusing indices for newly born particles, sometimes it's necessary
// to keep a track for particular particles. This method and the methods that deal with
// particle IDs allow us to accomplish that.
virtual int NumParticlesGenerated() { return NumParticles(); }
// Implemented by the Plug-in
// The following four methods modify amount of particles in the particle system
// Returns true if the operation was completed successfully
// Add a single particle
virtual bool AddParticle() { return false; }
// Add "num" particles into the particle system
virtual bool AddParticles(int num) { return false; }
// Delete a single particle with the given index
virtual bool DeleteParticle(int index) { return false; }
// List-type delete of "num" particles starting with "start"
virtual bool DeleteParticles(int start, int num) { return false; }
// Implemented by the Plug-In.
// Each particle is given a unique ID (consecutive) upon its birth. The method
// allows us to distinguish physically different particles even if they are using
// the same particle index (because of the "index reusing").
// Parameters:
// int i
// index of the particle in the range of [0, NumParticles-1]
virtual int GetParticleBornIndex(int i) { return 0; }
// Implemented by the Plug-In.
// the methods verifies if a particle with a given particle id (born index) is present
// in the particle system. The methods returns Particle Group node the particle belongs to,
// and index in this group. If there is no such particle, the method returns false.
// Parameters:
// int bornIndex
// particle born index
// INode*& groupNode
// particle group the particle belongs to
// int index
// particle index in the particle group or particle system
virtual bool HasParticleBornIndex(int bornIndex, int& index) { return false; }
virtual INode* GetParticleGroup(int index) { return NULL; }
virtual int GetParticleIndex(int bornIndex) { return 0; }
// Implemented by the Plug-In.
// The following four methods define "current" index or bornIndex. This index is used
// in the property methods below to get the property without specifying the index.
virtual int GetCurrentParticleIndex() { return 0; }
virtual int GetCurrentParticleBornIndex() { return 5; }
virtual void SetCurrentParticleIndex(int index) { ; }
virtual void SetCurrentParticleBornIndex(int bornIndex) { ; }
// Implemented by the Plug-In.
// The following six methods define age of the specified particle. Particle is specified by either its
// index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// TimeValue age
// new age value to set for a particle
virtual TimeValue GetParticleAgeByIndex(int index) { return 0; }
virtual TimeValue GetParticleAgeByBornIndex(int id) { return 0; }
virtual void SetParticleAgeByIndex(int index, TimeValue age) { ; }
virtual void SetParticleAgeByBornIndex(int id, TimeValue age) { ; }
virtual TimeValue GetParticleAge() { return 0; }
virtual void SetParticleAge(TimeValue age) { ; }
// Implemented by the Plug-In.
// The following six methods define lifespan of the specified particle. Particle is specified by either its
// index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// TimeValue lifespan
// new lifespan value to set for a particle
virtual TimeValue GetParticleLifeSpanByIndex(int index) { return TIME_PosInfinity; }
virtual TimeValue GetParticleLifeSpanByBornIndex(int id) { return TIME_PosInfinity; }
virtual void SetParticleLifeSpanByIndex(int index, TimeValue LifeSpan) { ; }
virtual void SetParticleLifeSpanByBornIndex(int id, TimeValue LifeSpan) { ; }
virtual TimeValue GetParticleLifeSpan() { return TIME_PosInfinity; }
virtual void SetParticleLifeSpan(TimeValue lifespan) { ; }
// Implemented by the Plug-In.
// The following six methods define for how long the specified particle was staying in the current
// particle group. Particle is specified by either its
// index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// TimeValue time
// how long particle was staying in the current particle group
virtual TimeValue GetParticleGroupTimeByIndex(int index) { return 0; }
virtual TimeValue GetParticleGroupTimeByBornIndex(int id) { return 0; }
virtual void SetParticleGroupTimeByIndex(int index, TimeValue time) { ; }
virtual void SetParticleGroupTimeByBornIndex(int id, TimeValue time) { ; }
virtual TimeValue GetParticleGroupTime() { return 0; }
virtual void SetParticleGroupTime(TimeValue time) { ; }
// Implemented by the Plug-In.
// The following six methods define position of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// Point3 pos
// position of the particle
virtual Point3* GetParticlePositionByIndex(int index) { return NULL; }
virtual Point3* GetParticlePositionByBornIndex(int id) { return NULL; }
virtual void SetParticlePositionByIndex(int index, Point3 pos) { ; }
virtual void SetParticlePositionByBornIndex(int id, Point3 pos) { ; }
virtual Point3* GetParticlePosition() { return NULL; }
virtual void SetParticlePosition(Point3 pos) { ; }
// Implemented by the Plug-In.
// The following six methods define speed of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// Point3 speed
// speed of the particle in units per frame
virtual Point3* GetParticleSpeedByIndex(int index) { return NULL; }
virtual Point3* GetParticleSpeedByBornIndex(int id) { return NULL; }
virtual void SetParticleSpeedByIndex(int index, Point3 speed) { ; }
virtual void SetParticleSpeedByBornIndex(int id, Point3 speed) { ; }
virtual Point3* GetParticleSpeed() { return NULL; }
virtual void SetParticleSpeed(Point3 speed) { ; }
// Implemented by the Plug-In.
// The following six methods define orientation of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// Point3 orient
// orientation of the particle. The orientation is defined by incremental rotations
// by world axes X, Y and Z. The rotation values are in degrees.
virtual Point3* GetParticleOrientationByIndex(int index) { return NULL; }
virtual Point3* GetParticleOrientationByBornIndex(int id) { return NULL; }
virtual void SetParticleOrientationByIndex(int index, Point3 orient) { ; }
virtual void SetParticleOrientationByBornIndex(int id, Point3 orient) { ; }
virtual Point3* GetParticleOrientation() { return NULL; }
virtual void SetParticleOrientation(Point3 orient) { ; }
// Implemented by the Plug-In.
// The following six methods define angular speed of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// AngAxis spin
// angular speed of the particle in rotation per frame
// axis defines rotation axis, angle defines rotation amount per frame
virtual AngAxis* GetParticleSpinByIndex(int index) { return NULL; }
virtual AngAxis* GetParticleSpinByBornIndex(int id) { return NULL; }
virtual void SetParticleSpinByIndex(int index, AngAxis spin) { ; }
virtual void SetParticleSpinByBornIndex(int id, AngAxis spin) { ; }
virtual AngAxis* GetParticleSpin() { return NULL; }
virtual void SetParticleSpin(AngAxis spin) { ; }
// Implemented by the Plug-In.
// The following twelve methods define scale factor of the specified particle in the current state.
// The XYZ form is used for non-uniform scaling
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// float scale
// uniform scale factor
// Point3 scale
// scale factor for each local axis of the particle
virtual float GetParticleScaleByIndex(int index) { return 1.0f; }
virtual float GetParticleScaleByBornIndex(int id) { return 1.0f; }
virtual void SetParticleScaleByIndex(int index, float scale) { ; }
virtual void SetParticleScaleByBornIndex(int id, float scale) { ; }
virtual float GetParticleScale() { return 1.0f; }
virtual void SetParticleScale(float scale) { ; }
virtual Point3* GetParticleScaleXYZByIndex(int index) { return NULL; }
virtual Point3* GetParticleScaleXYZByBornIndex(int id) { return NULL; }
virtual void SetParticleScaleXYZByIndex(int index, Point3 scale) { ; }
virtual void SetParticleScaleXYZByBornIndex(int id, Point3 scale) { ; }
virtual Point3* GetParticleScaleXYZ() { return NULL; }
virtual void SetParticleScaleXYZ(Point3 scale) { ; }
// Implemented by the Plug-In.
// The following six methods define transformation matrix of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// Matrix3 tm
// transformation matrix of the particle
virtual Matrix3* GetParticleTMByIndex(int index) { return NULL; }
virtual Matrix3* GetParticleTMByBornIndex(int id) { return NULL; }
virtual void SetParticleTMByIndex(int index, Matrix3 tm) { ; }
virtual void SetParticleTMByBornIndex(int id, Matrix3 tm) { ; }
virtual Matrix3* GetParticleTM() { return NULL; }
virtual void SetParticleTM(Matrix3 tm) { ; }
// Implemented by the Plug-In.
// The following six methods define selection status of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// bool selected
// selection status of the particle
virtual bool GetParticleSelectedByIndex(int index) { return true; }
virtual bool GetParticleSelectedByBornIndex(int id) { return true; }
virtual void SetParticleSelectedByIndex(int index, bool selected) { ; }
virtual void SetParticleSelectedByBornIndex(int id, bool selected) { ; }
virtual bool GetParticleSelected() { return true; }
virtual void SetParticleSelected(bool selected) { ; }
// Implemented by the Plug-In.
// The following seven methods define shape of the specified particle in the current state.
// Particle is specified by either its index in the particle group or particle system, or by its born index
// if no index is specified then the "current" index is used
// Parameters:
// int id
// particle born index
// int index
// particle index in the particle group
// Mesh* shape
// shape of the particle
virtual Mesh* GetParticleShapeByIndex(int index) { return NULL; }
virtual Mesh* GetParticleShapeByBornIndex(int id) { return NULL; }
virtual void SetParticleShapeByIndex(int index, Mesh* shape) { ; }
virtual void SetParticleShapeByBornIndex(int id, Mesh* shape) { ; }
virtual Mesh* GetParticleShape() { return NULL; }
virtual void SetParticleShape(Mesh* shape) { ; }
// set the same shape for all particles
virtual void SetGlobalParticleShape(Mesh* shape) { ; }
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLEOBJECTEXT_INTERFACE); }
};
#endif // _IPARTICLEOBJECTEXT_H_

View File

@ -0,0 +1,233 @@
/**********************************************************************
*<
FILE: IProjectionMod.h
DESCRIPTION: Interface for Projection Modifier
CREATED BY: Michael Russo
HISTORY: 02-23-2004
*> Copyright (c) 2004, All Rights Reserved.
**********************************************************************/
#ifndef __IPROJECTIONMOD__H
#define __IPROJECTIONMOD__H
#include "ObjectWrapper.h"
#define PROJECTIONMOD_CLASS_ID Class_ID(0x166c301c, 0x19f90c49)
#define IPROJECTIONMOD_INTERFACE_ID Interface_ID(0x6b231b96, 0xb26a72)
#define IPROJECTIONMODDATA_INTERFACE_ID Interface_ID(0x341e47bc, 0x1f923a2f)
class IProjectionModData;
//=============================================================================
//
// Class IProjectionMod
//
//=============================================================================
class IProjectionMod : public FPMixinInterface
{
public:
// IProjectionMod
// Geometry Selection Methods
enum { PM_SL_OBJECT, PM_SL_VERT, PM_SL_FACE, PM_SL_ELEM };
// Access to Geom Selections by Node/Object Index
virtual int NumObjects() = 0;
virtual INode* GetObjectNode(int iIndex) = 0;
virtual TCHAR* GetObjectName(int iIndex) = 0;
virtual int GetObjectSelLevel(int iIndex) = 0;
virtual void DeleteObjectNode(int iIndex) = 0;
// Access to Geom Selections by Geom Selections
virtual int NumGeomSels() = 0;
virtual TCHAR* GetGeomSelName( int iSelIndex ) = 0;
virtual int GetGeomSelSelLevel( int iSelIndex ) = 0;
virtual int NumGeomSelNodes( int iSelIndex ) = 0;
virtual INode* GetGeomSelNode( int iSelIndex, int iNodeIndex ) = 0;
virtual void SetGeomSelMapProportion( int iSelIndex, float fProportion ) = 0;
virtual float GetGeomSelMapProportion( int iSelIndex ) = 0;
virtual void DeleteGeomSel( int iSelIndex ) = 0;
virtual void DeleteGeomSelNode( int iSelIndex, int iNodeIndex ) = 0;
virtual IProjectionModData* GetProjectionModData(INode *pNode) = 0;
// Modifier Access
virtual bool IsValidObject( INode *pNode ) = 0;
virtual bool AddObjectNode( INode *pNode ) = 0;
virtual void DeleteAll() = 0;
virtual void SetGeomSelNodesVisibility( bool bVisible ) = 0;
virtual bool GetGeomSelNodesVisibility() = 0;
virtual void UpdateProjectionTypeList() = 0;
virtual void AutoWrapCage() = 0;
virtual void ResetCage() = 0;
virtual void PushCage(float fAmount) = 0;
virtual int fpGetObjectSelMtlIDs(INode *pNode, int iIndex, Tab<int> &mtlIDs) = 0;
virtual int fpGetGeomSelMtlIDs(INode *pNode, int iSelIndex, Tab<int> &mtlIDs) = 0;
virtual float fpGetGeomSelFaceArea(INode *pNode, int iSelIndex) = 0;
virtual int fpCheckDuplicateMatIDs( INode *pNode, BitArray &bitFaceDups ) = 0;
virtual int fpCheckDuplicateSels( INode *pNode, BitArray &bitFaceDups ) = 0;
virtual void fpSelectByMtlID( int iMtlID ) = 0;
virtual void fpSelectBySG( int iSG ) = 0;
virtual int fpGetNumProjectionTypes() = 0;
virtual ReferenceTarget* fpGetProjectionType(int iIndex) = 0;
virtual void fpRemoveProjectionType(int iIndex) = 0;
virtual void fpProject(int iIndex) = 0;
virtual void fpProjectAll() = 0;
virtual int fpGetNumRegisteredProjectionTypes() = 0;
virtual void fpAddRegisteredProjectionType(int iIndex) = 0;
virtual void fpGetRegisteredProjectionTypeClassID(int iIndex, Tab<int> &classid) = 0;
virtual void fpShowAlignment() = 0;
virtual void fpClearAlignment() = 0;
};
//=============================================================================
//
// Class IProjectionModData
//
//=============================================================================
class IProjectionModData : public BaseInterface
{
public:
// GenericInterface
virtual Interface_ID GetID() { return IPROJECTIONMODDATA_INTERFACE_ID; }
// IProjectionModData
virtual ObjectWrapper &GetBaseObject() = 0; // Object with Projection Modifier
virtual ObjectWrapper &GetCage() = 0; // Cage mesh
// Access to Geom Selections by Node/Object Index
virtual bool GetObjectSel(int iIndex, BitArray& sel) = 0;
virtual int GetObjectSelMtlIDs(int iIndex, Tab<int> &mtlIDs) = 0;
// Access to Geom Selections by Geom Selections
virtual bool GetGeomSel(int iSelIndex, BitArray& sel) = 0;
virtual int GetGeomSelMtlIDs(int iSelIndex, Tab<int> &mtlIDs) = 0;
virtual float GetGeomSelFaceArea(int iSelIndex) = 0;
// Returns number of material ids that conflict within SO Geometry selections.
// bitFaceDups is a bitarray of the faces containing the conflict.
virtual int CheckDuplicateMatIDs( BitArray &bitFaceDups ) = 0;
// Returns number of face selections conflict within SO Geometry selections.
// bitFaceDups is a bitarray of the faces containing the conflict.
virtual int CheckDuplicateSels( BitArray &bitFaceDups ) = 0;
};
//=============================================================================
//
// Class IProjectionModType
//
// Class Category: ProjectionModType
//
//=============================================================================
class IProjectionModType : public ReferenceTarget
{
public:
virtual void SetIProjectionMod( IProjectionMod *pPMod ) {}
virtual bool CanProject(Tab<INode*> &tabSourceNodes, int iSelIndex, int iNodeIndex) { return false; }
virtual void Project(Tab<INode*> &tabSourceNodes, int iSelIndex, int iNodeIndex) {}
virtual void SetInitialName(int iIndex) {}
virtual TCHAR *GetName(){return NULL;}
virtual void SetName(TCHAR *name) {}
virtual void Enable(bool enable) {}
virtual bool IsEditing() { return false; }
virtual void EndEditing() {}
virtual void EnableEditing(bool enable) {}
virtual RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, PartID& partID, RefMessage message )
{ return REF_SUCCEED; }
virtual IOResult Load(ILoad *iload) {return IO_OK;}
virtual IOResult Save(ISave *isave) {return IO_OK;}
virtual void ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *inode, IProjectionModData *pPModData) {}
virtual void BeginEditParams(IObjParam *ip, ULONG flags,Animatable *prev) {}
virtual void EndEditParams(IObjParam *ip,ULONG flags,Animatable *next) {}
virtual void NotifyInputChanged(Interval changeInt, PartID partID, RefMessage message, ModContext *mc, IProjectionModData *pPModData) {}
virtual void GetWorldBoundBox(TimeValue t,INode* inode, ViewExp *vpt, Box3& box, ModContext *mc){}
virtual int Display(TimeValue t, GraphicsWindow *gw, Matrix3 tm ) { return 1;}
virtual int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt, ModContext* mc, Matrix3 tm) {return 0;}
virtual void SelectSubComponent(HitRecord *hitRec, BOOL selected, BOOL all, BOOL invert=FALSE) {}
virtual void Move( TimeValue t, Matrix3& partm, Matrix3& tmAxis, Point3& val, Matrix3 tm, BOOL localOrigin=FALSE ) {}
virtual void GetSubObjectCenters(SubObjAxisCallback *cb,TimeValue t,INode *node, Matrix3 tm) {}
virtual void GetSubObjectTMs(SubObjAxisCallback *cb,TimeValue t,INode *node, Matrix3 tm) {}
virtual void ClearSelection(int selLevel) {}
virtual void SelectAll(int selLevel) {}
virtual void InvertSelection(int selLevel) {}
};
//=============================================================================
//
// Class IProjectionIntersector
//
// Ray-intersection for projection mapping
//
//=============================================================================
class IProjectionIntersector {
public:
IProjectionIntersector() {}
virtual ~IProjectionIntersector() {}
virtual void DeleteThis() {}
// The root is normally the object on which the projection modifier is applied.
// The cage is optional, it may be NULL or empty;
// if supplied, the cage must have the same topology as the root.
virtual BOOL InitRoot( MNMesh* root, MNMesh* cage, Matrix3& objectToWorldTM ) = 0;
virtual BOOL InitRoot( ObjectWrapper& root, ObjectWrapper& cage, Matrix3& objectToWorldTM ) = 0;
virtual BOOL RootValid() = 0; //true if initialized, false when free'd
// A leaf is normally one of the objects targeted by the projection modifier.
virtual BOOL InitLeaf( MNMesh* leaf, Matrix3& objectToWorldTM ) = 0;
virtual BOOL InitLeaf( ObjectWrapper& leaf, Matrix3& objectToWorldTM ) = 0;
virtual BOOL LeafValid() = 0; //true if initialized, false when free'd
// releases memory allocated by the Init functions
virtual void Free() = 0;
// --- Root functions: Require the root be initialized first
//Given a point in root object space, and a normal for the point (optional - may be zero),
//find the closest face, and barycentric coordinates of the point as projected onto the face
enum {FINDCLOSEST_CAGED=1, FINDCLOSEST_IGNOREBACKFACING=2};
virtual BOOL RootClosestFace( Ray& pointAndNormal, int flags, float& dist, DWORD& rootFaceIndex, Tab<float>& rootFaceBary ) = 0;
// --- Leaf functions: Require a leaf be initialized first
//Find an intersection on a leaf, given a ray
virtual BOOL LeafIntersectRay( Ray& ray, float& dist, DWORD& leafFaceIndex, Tab<float>& leafFaceBary ) = 0;
// --- General functions: Require that BOTH the root and a leaf are initialized
//Find an intersection on a leaf, given a point on the root mesh
virtual BOOL LeafIntersectRay( DWORD rootFaceIndex, Point3& rootFaceBary, float& dist, DWORD& leafFaceIndex, Tab<float>& leafFaceBary ) = 0;
};
// Manager class, creates instances of IProjectionIntersector
class IProjectionIntersectorMgr : public FPStaticInterface {
public:
virtual IProjectionIntersector* CreateProjectionIntersector() = 0;
};
#define IPROJECTIONINTERSECTORMGR_INTERFACE_ID Interface_ID(0x457d402d, 0x36e81f43)
#define GetIProjectionIntersectorMgr() \
((IProjectionIntersectorMgr*)GetCOREInterface(IPROJECTIONINTERSECTORMGR_INTERFACE_ID))
#endif // __IPROJECTIONMOD__H

View File

@ -0,0 +1,153 @@
/**********************************************************************
*<
FILE: ProjectionRenderHandler.h
DESCRIPTION: Render time functionality for projection mapping
CREATED BY: Michaelson Britt
HISTORY: 05-01-2004
*> Copyright (c) 2004, All Rights Reserved.
**********************************************************************/
#ifndef __PROJECTIONRENDERHANDLER_H__
#define __PROJECTIONRENDERHANDLER_H__
#include "Max.h"
#include "resource.h"
#include "istdplug.h"
#include "iparamb2.h"
#include "iparamm2.h"
//-----------------------------------------------------------------------------
// Types
class IMeshWrapper;
class IProjectionRenderMgr;
typedef struct {
int v0, v1, v2;
} GenTri;
typedef struct {
Point3 v0, v1, v2;
} GenTriPoints;
typedef struct {
Point3 uBasis, vBasis;
} TangentBasis;
//===========================================================================
//
// Class IProjectionRenderHandler
//
//===========================================================================
class IProjectionRenderHandler {
public:
typedef struct {
RenderInstance* inst;
IMeshWrapper* mesh; //CAMERA SPACE mesh wrapper for the inst
float dist;
int faceIndex;
Point3 faceBary;
BOOL isBackfacing;
int err; //used when Project() returns FALSE
} ProjectionResult;
enum { ERR_NONE=0,
ERR_RAYMISS, //ray did not hit a reference model
ERR_NONSELFACE, //the working model face is not in the active selection, skipped
};
virtual ~IProjectionRenderHandler() {}
virtual void DeleteThis() = 0;
virtual int RenderBegin(TimeValue t, ULONG flags=0) = 0;
virtual int RenderEnd(TimeValue t) = 0;
// NOTE: Init() may require several seconds to calculate sorting structures for the reference models
virtual BOOL Init( RenderInstance* workingModelInst, RenderGlobalContext* rgc ) = 0;
virtual BOOL Valid() = 0; //true if initialized, false otherwise
// Reference & working model info
virtual void GetReferenceModels( Tab<RenderInstance*>& refModels ) = 0;
virtual IMeshWrapper* GetWorkingModelMesh() = 0;
virtual RenderInstance* GetWorkingModelInst() = 0;
virtual void GetWorkingModelMask( BitArray& mask ) = 0;
// Do the projection from working model to reference model
virtual BOOL Project( int faceIndex, Point3& faceBary, Point3& faceNorm, ProjectionResult& result ) = 0;
};
// Manager class to create render handler instances
#define IPROJECTIONRENDERMGR_INTERFACE_ID Interface_ID(0x45390e61, 0x42de3b37)
inline IProjectionRenderMgr* GetIProjectionRenderMgr()
{return (IProjectionRenderMgr*)GetCOREInterface(IPROJECTIONRENDERMGR_INTERFACE_ID);}
class IProjectionRenderMgr : public FPStaticInterface {
public:
virtual IProjectionRenderHandler* CreateProjectionRenderHandler() = 0;
};
//===========================================================================
//
// Class IMeshWrapper
// An object defined as a set of triangles
//
//===========================================================================
//FIXME: hopefully this can become a subclass of ObjectWrapper
class IMeshWrapper {
public:
virtual void DeleteThis() = 0;
virtual int NumTriangles() = 0;
// For a given triangle, find the face number, and the index of the triangle within the face
virtual void Translate( int rawTriIndex, int& faceIndex, int& faceTriIndex ) = 0;
// Transform affects the geometry & geom normals, but not the mapping data
virtual Matrix3 GetTM() = 0;
virtual void SetTM( Matrix3 tm ) = 0;
// Geom triangles & verts
virtual GenTri GetTri( int triIndex ) = 0;
virtual void GetTriPoints( int triIndex, GenTriPoints& triPoints ) = 0;
virtual Point3 GetVert( int vertIndex ) = 0;
virtual int NumVerts() = 0;
// Map triangles & verts
virtual BOOL GetChannelSupport( int mapChannel ) = 0;
virtual GenTri GetMapTri( int triIndex, int mapChannel ) = 0;
virtual void GetMapTriPoints( int triIndex, int mapChannel, GenTriPoints& triPoints ) = 0;
virtual Point3 GetMapVert( int vertIndex, int mapChannel ) = 0;
virtual int NumMapVerts( int mapChannel ) = 0;
// Normals
virtual Point3 GetNormal( int triIndex ) = 0;
virtual TangentBasis GetTangentBasis( int triIndex, int mapChannel ) = 0;
virtual Point3 GetVertexNormal( int vertIndex, DWORD smGroup ) = 0;
virtual TangentBasis GetVertexTangentBasis( int vertIndex, DWORD smGroup, int mapChannel ) = 0;
virtual Point3 GetMapNormal( int triIndex, int mapChannel ) = 0; //UVW space
// Face properties
virtual MtlID GetMtlID( int triIndex ) = 0;
virtual DWORD GetSmoothingGroup( int triIndex ) = 0;
// Helpers
virtual void GetPoint( int triIndex, const Point3& triBary, Point3& point ) = 0;
virtual void GetMapPoint( int triIndex, const Point3& triBary, int mapChannel, Point3& uvw ) = 0;
virtual void GetNormal( int triIndex, const Point3& triBary, Point3& point ) = 0;
virtual void GetTangentBasis( int triIndex, const Point3& triBary, int mapChannel, TangentBasis& tangentBasis ) = 0;
};
#endif //__PROJECTIONRENDERHANDLER_H___

View File

@ -0,0 +1,92 @@
/*==============================================================================
file: IProjection_WorkingModelInfo.h
author: Daniel Levesque
created: 19 May 2004
description:
Definition of an interface that gives access to basic shade context information
on the working model of a bake projection.
This interface is to be used along with the bake projection feature, which
allows using high-res objects when baking maps for low-res objects.
modified:
<EFBFBD> 2004 Autodesk
==============================================================================*/
#ifndef _IPROJECTION_WORKINGMODELINFO_H_
#define _IPROJECTION_WORKINGMODELINFO_H_
#include <BaseInterface.h>
class RenderInstance;
class Point3;
//==============================================================================
// class IProjection_WorkingModelInfo
//
// This interface provides access to some shade context information for the
// working model.
//
// When a bake projection is done, all the information in the shade context
// is overriden to represent the intersection point on the projected object.
// If a bake render element still needs access to shade context information
// from the original object (the working model), then this interface may be used.
//
// This interface should be queried from the shade context through GetInterface().
// A NULL pointer will be returned if no projection was done.
//==============================================================================
class IProjection_WorkingModelInfo : public BaseInterface {
public:
// Query this interface on a shade context
static IProjection_WorkingModelInfo* GetInterface(ShadeContext& shadeContext);
// Returns the render instance of the working model
virtual RenderInstance* GetRenderInstance() = 0;
// Returns the face number of that hit face
virtual int GetFaceNumber() = 0;
// Returns the original interpolated normal
virtual const Point3& GetOrigNormal() = 0;
// Returns the barycentric coordinates of the hit point
virtual void GetBarycentricCoords(Point3& bary) = 0;
virtual void GetBarycentricCoords(float& b0, float& b1, float& b2) = 0;
// Returns whether the backface was hit
virtual BOOL GetBackFace() = 0;
// Returns the point that was hit, in camera space
virtual const Point3& GetPoint() = 0;
// Get the view direction, in camera space (equivalent to SContext::V())
virtual const Point3& GetViewDir() = 0;
// Get the original view direction, in camera space (equivalent to SContext::OrigView())
virtual const Point3& GetOriginalViewDir() = 0;
// Get the material number of the hit face
virtual int GetMaterialNumber() = 0;
// Get the bump basis vectors of the hit face (equivalent to SContext::BumpBasisVectors())
virtual void BumpBasisVectors(Point3 dP[2], int axis, int channel) = 0;
// Get the map basis vectors (aks bump basis vectors) interpolated at the current position
virtual void TangentBasisVectors(Point3 dP[2], int mapChannel) = 0;
// -- from BaseInterface
virtual Interface_ID GetID();
};
#define IPROJECTION_WORKINGMODELINFO_INTERFACE_ID Interface_ID(0x79907259, 0xbf05948)
inline IProjection_WorkingModelInfo* IProjection_WorkingModelInfo::GetInterface(ShadeContext& shadeContext) {
return static_cast<IProjection_WorkingModelInfo*>(shadeContext.GetInterface(IPROJECTION_WORKINGMODELINFO_INTERFACE_ID));
}
inline Interface_ID IProjection_WorkingModelInfo::GetID() {
return IPROJECTION_WORKINGMODELINFO_INTERFACE_ID;
}
#endif

View File

@ -0,0 +1,89 @@
/*==============================================================================
file: IRadiosityPreferences.h
author: Daniel Levesque
created: 7 September 2001
description:
Interface for accessing radiosity preferences.
modified: September 14, 2001 David Cunningham
- added use/compute radiosity file setting access
September 17, 2001 Daniel Levesque
- addition of Get/Set 'Save Geometry' methods
May 20, 2003 Alexandre Cossette
- addition of Get/Set 'Update Data When Required on Start'
June 9, 2003 Alexandre Cossette
- removed 'Display Warning on GI Props Change'
<EFBFBD> 2001 Autodesk
==============================================================================*/
#ifndef _IRADIOSITYPREFERENCES_H_
#define _IRADIOSITYPREFERENCES_H_
#include "ifnpub.h"
#define IRADIOSITYPREFERENCES_INTERFACE Interface_ID(0x54442e40, 0x401621a4)
//==============================================================================
// class IRadiosityPreferences
//
// This class defines the interface for accessing the Radiosity Preferences
// from the 'Radiosity' tab in the preferences dialog.
//
// It also provides access to the use/compute radiosity controls found in the
// Rendering dialog.
//
// To get the a pointer to the interface, call:
// static_cast<IRadiosityPreferences*>(GetCOREInterface(IRADIOSITYPREFERENCES_INTERFACE))
//
//==============================================================================
class IRadiosityPreferences : public FPStaticInterface {
public:
// Global user settings that are stored in a .ini file
// Automatically process refine steps stored in objects
virtual BOOL GetAutoProcessObjectRefine() const = 0;
virtual void SetAutoProcessObjectRefine(BOOL val) = 0;
//Display reflectance/transmittance information in the material editor
virtual BOOL GetDisplayReflectanceInMEditor() const = 0;
virtual void SetDisplayReflectanceInMEditor(BOOL val) = 0;
// Display radiosity in the viewport
virtual BOOL GetDisplayInViewport() const = 0;
virtual void SetDisplayInViewport(BOOL val) = 0;
// Display warning on reset
virtual BOOL GetDisplayResetWarning() const = 0;
virtual void SetDisplayResetWarning(BOOL val) = 0;
// Automatically update solution data when required
virtual BOOL GetUpdateDataWhenRequiredOnStart() const = 0;
virtual void SetUpdateDataWhenRequiredOnStart(BOOL val) = 0;
// Save the geometry along with the solution in the .max file, for faster load times.
virtual BOOL GetSaveScene() const = 0;
virtual void SetSaveScene(BOOL val) = 0;
/**
* The functions below provide access to current radiosity settings.
* These properties are saved on a per file basis, so they
* are not written into the .ini file.
*/
// Use radiosity when rendering
virtual BOOL GetUseRadiosity() const = 0;
virtual void SetUseRadiosity(BOOL val) = 0;
// Automatically compute radiosity when rendering, if necessary.
virtual BOOL GetComputeRadiosity() const = 0;
virtual void SetComputeRadiosity(BOOL val) = 0;
};
#endif

View File

@ -0,0 +1,33 @@
/**********************************************************************
*<
FILE: IRefTargContainer.h
DESCRIPTION: Defines IRefTargContainer class
A Reference Maker class that stores a variable list of ReferenceTarget* items.
All actions performed on this class are undoable.
CREATED BY: Larry Minton
HISTORY: created 5/19/04
*> Copyright (c) 2004, All Rights Reserved.
**********************************************************************/
#ifndef _IREFTARGCONTAINER_H_
#define _IREFTARGCONTAINER_H_
// SClass_ID is REF_TARGET_CLASS_ID
#define REFTARG_CONTAINER_CLASS_ID Class_ID(0xa1692edf, 0xd681173f)
class IRefTargContainer : public ReferenceTarget
{
public:
virtual int GetNumItems()=0; // Return the number of items
virtual ReferenceTarget *GetItem(int i)=0; // Return the specified item, NULL if out of range
virtual int AppendItem(ReferenceTarget *ref)=0; // Append item. Returns index of item.
virtual void SetItem(int i, ReferenceTarget *ref)=0; // Set the specified item.
virtual int InsertItem(int i, ReferenceTarget *ref)=0; // Insert specified item, index clamped to range. Returns index of item.
virtual void RemoveItem(int i)=0; // Remove specified item.
};
#endif

View File

@ -0,0 +1,164 @@
#ifndef __ISKINWRAP__H
#define __ISKINWRAP__H
#define MESHDEFORMPW_CLASS_ID Class_ID(0x22b7bd09, 0x673ac5cf)
#define MESHDEFORMPW_INTERFACE Interface_ID(0xDE21A34f, 0x8A43E3D2)
class IMeshDeformPWMod : public FPMixinInterface
{
FPInterfaceDesc* GetDesc();
/// SelectVertices(BitArray *selList, BOOL updateViews)
/// This selects the control point cage vertices
/// int whichWrapMesh this is which wrap mesh you are getting the selection from
// each wrap mesh keeps it own selection list
/// BitArray *selList the bitarray representing the selection
/// BOOL updateView whether to update the view and the modifier
virtual void SelectVertices(int whichWrapMesh, BitArray *selList, BOOL updateViews)=0;
/// BitArray *GetSelectedVertices()
/// This returns the current selected control points on the cage
/// int whichWrapMesh this is which wrap mesh you are setting the selection to
// each wrap mesh keeps it own selection list
virtual BitArray *GetSelectedVertices(int whichWrapMesh)=0;
/// int GetNumberControlPoints()
/// This returns the number of control points on the cage
/// int whichWrapMesh this is which wrap mesh you are getting the number of control pointss from
virtual int GetNumberControlPoints(int whichWrapMesh)=0;
/// Point3 *GetPointScale(int index)
/// This returns the local scale factor for a control point
/// The total influence area is equal to the control points distance * global distance * local scale
/// int whichWrapMesh this is which wrap mesh you are getting the info from
/// int index this is which control point you want to get
virtual Point3 *GetPointScale(int whichWrapMesh,int index)=0;
/// void SetPointScale(int index, Point3 scale)
/// This lets you set a control points local scale
/// int whichWrapMesh this is which wrap mesh you are setting the info to
/// int index this is the index of the point you want to set
/// Point3 scale this is the scale of the point
virtual void SetPointScale(int whichWrapMesh,int index, Point3 scale)=0;
/// float GetPointStr(int index)
/// this returns the strength of a control point
/// int whichWrapMesh this is which wrap mesh you are getting the info from
/// int index this is the index of the control point you want to get
virtual float GetPointStr(int whichWrapMesh,int index)=0;
/// void SetPointStr(int index, float str)
/// This lets you set the strength of a control point
/// int whichWrapMesh this is which wrap mesh you are setting the info to
/// int index this is the index of the control point you want to set
/// float str this is the strength
virtual void SetPointStr(int whichWrapMesh,int index, float str)=0;
///Matrix3 GetPointInitialTM(int index)
/// This returns the initial tm of the control point
/// int whichWrapMesh this is which wrap mesh you are getting the info from
/// int index the control point index
virtual Matrix3 GetPointInitialTM(int whichWrapMesh,int index)=0;
///Matrix3 GetPointCurrentTM(int index)
/// This returns the current tm of the control point
/// int index the control point index
virtual Matrix3 GetPointCurrentTM(int whichWrapMesh,int index)=0;
///float GetPointDist(int index)
/// This returns the size of the envelope of a control point
/// int whichWrapMesh this is which wrap mesh you are getting the info from
/// int index the control point index
virtual float GetPointDist(int whichWrapMesh,int index) = 0;
///int GetPointXVert(int index)
/// this is the vertex that forms the x axis, the z axis is the normal
/// int whichWrapMesh this is which wrap mesh you are getting the info from
/// int index the control point index
virtual int GetPointXVert(int whichWrapMesh,int index) = 0;
/// MirrorSelectedVerts()
/// This mirrors the current selected control points. This is identical to
/// pushing the Mirro button in the UI
virtual void MirrorSelectedVerts()=0;
/// BakeControlPoints()
/// This bakes the control point data into the app data of the node that is the control mesh. This is identical to
/// pushing the Bake button in the UI
virtual void BakeControlPoints()=0;
/// RetreiveControlPoints()
/// This retrieves the control point data from the app data of the node that is the control mesh. This is identical to
/// pushing the Retrieve button in the UI
virtual void RetreiveControlPoints()=0;
/// Resample()
/// This forces the modifier to resample itself. This will force all weights to be recomputed
virtual void Resample()=0;
/// void SetResampleModContext()
/// same as Resample
virtual void SetResampleModContext() = 0;
/// void SetRebuildNeighborDataModContext()
/// The system keep tracks of a potential weight lists by using neighbor data
/// Any time a selection is changed this potential weight list needs to be updated
/// use this function to update that list. It should be called after any control point selection
/// change.
virtual void SetRebuildNeighborDataModContext() = 0;
/// void SetRebuildSelectedWeightDataModContext()
/// This forces the selected control points to have their weights rebuilt
/// this should be called when you change the str/scaling etc of a control point
virtual void SetRebuildSelectedWeightDataModContext() = 0;
/// int NumberOfVertices()
/// returns the number of deformed vertices
/// INode *node the node that owns the local data
virtual int NumberOfVertices(INode *node) = 0;
/// int VertNumberWeights(INode *node, int vindex)
/// this returns the number of weights of a vertex
/// INode *node the node that owns the local data
/// int vindex the vertex index that you want to get the number of weights from
virtual int VertNumberWeights(INode *node, int vindex) = 0;
/// float VertGetWeight(INode *node, int vindex, int windex)
/// this returns a particular weight of a vertex
/// INode *node the node that owns the local data
/// int vindex the vertex index that you want to get the weight
/// int windex the weight index you want to get
virtual float VertGetWeight(INode *node, int vindex, int windex) = 0;
/// float VertGetDistance(INode *node, int vindex, int windex)
/// this returns a particular distance of a vertex
/// INode *node the node that owns the local data
/// int vindex the vertex index that you want to get the weight
/// int windex the weight index you want to get
virtual float VertGetDistance(INode *node, int vindex, int windex) = 0;
/// int VertGetControlPoint(INode *node, int vindex, int windex)
/// this returns the control point that owns this weight
/// INode *node the node that owns the local data
/// int vindex the vertex index that you want to get the weight
/// int windex the weight index you want to get
virtual int VertGetControlPoint(INode *node, int vindex, int windex) = 0;
/// int VertGetWrapNode(INode *node, int vindex, int windex)
/// this returns the wrap node that owns this weight
/// INode *node the node that owns the local data
/// int vindex the vertex index that you want to get the weight
/// int windex the weight index you want to get
virtual int VertGetWrapNode(INode *node, int vindex, int windex) = 0;
/// Reset()
/// This forces the modifier to reset itself. This is identical to pressing the reset button
/// in the UI. This will force all weights and param space to be recomputed
virtual void Reset()=0;
/// ConvertToSkin()
/// This takes the weighting generated from a wrap modifier and turns it into a skin modifier
/// This requires that the modifier not be instances and all the wrap objects be driven by skin
/// INode *node the node that owns the local data
/// BOOL silent this supresses any warning/error message boxes
virtual void ConvertToSkin(BOOL silent)=0;
};
#endif

View File

@ -0,0 +1,63 @@
#ifndef __ISKINWRAPPATCH__H
#define __ISKINWRAPPATCH__H
#define PATCHDEFORMPW_CLASS_ID Class_ID(0x22b7bd09, 0x673ac5be)
#define PATCHDEFORMPW_INTERFACE Interface_ID(0xDE21A34f, 0x8A43E3E3)
class IPatchDeformPWMod : public FPMixinInterface
{
public:
enum
{
patchdeformpw_params /// This is the parameter rollup fields
};
enum
{
pb_patch, /// this is the patch that is doing the deformation
pb_autoupdate, /// Not used anymore
pb_samplerate, /// this is how far down the system will sample to find hits on the patch
/// the higher the value the more accurate it will be
pb_patchlist /// to be used later
};
FPInterfaceDesc* GetDesc();
/// Resample()
/// This forces the modifier to resample itself. This will force the system to resample the patch
virtual void Resample()=0;
/// int GetNumberOfPoints(INode *node)
/// This returns the number of points that are deformed
virtual int GetNumberOfPoints(INode *node)=0;
/// int Point3 GetPointUVW(INode *node, int index)
/// This returns the closest UVW point on the patch to this point
/// INode *node this is the node that owns the modifier so we can get the right local data
/// int index this is the index of the point you want to lookup
virtual Point3 GetPointUVW(INode *node, int index)=0;
/// int Point3 GetPointUVW(INode *node, int index)
/// This returns the local space point of the deforming point before deformation
/// INode *node this is the node that owns the modifier so we can get the right local data
/// int index this is the index of the point you want to lookup
virtual Point3 GetPointLocalSpace(INode *node, int index)=0;
/// int Point3 GetPointPatchSpace(INode *node, int index)
/// This returns the point in the space of the patch of the deforming point before deformation
/// INode *node this is the node that owns the modifier so we can get the right local data
/// int index this is the index of the point you want to lookup
virtual Point3 GetPointPatchSpace(INode *node, int index)=0;
/// int int GetPointPatchIndex(INode *node, int index)
/// This returns closest patch to this point
/// INode *node this is the node that owns the modifier so we can get the right local data
/// int index this is the index of the point you want to lookup
virtual int GetPointPatchIndex(INode *node, int index)=0;
};
#endif

722
lib/maxsdk70/include/ITabDialog.h Executable file
View File

@ -0,0 +1,722 @@
/**********************************************************************
*<
FILE: ITabDialog.h
DESCRIPTION: Interface for tabbed dialogs
CREATED BY: Cleve Ard
HISTORY: Created 01 October 2002
24 March 2003 - Updated for R6. This update allows the
current renderer to control which tabs are present in the
render dialog.
*> Copyright (c) 2002, All Rights Reserved.
**********************************************************************/
#ifndef __ITABDIALOG_H_
#define __ITABDIALOG_H_
class ITabbedDialog;
class ITabPage;
class ITabRegister;
class ITabDialogProc;
class ITabPageProc;
class ITabDialogFilter;
class IRollupWindow;
class ITabDialogPluginTab;
/***********************************************************************
*
* ITabDialogManager
*
* This interface is used to create tabbed dialogs and to register
* tabs with dialogs that are created by the system or other plugins
*
**********************************************************************/
class ITabDialogManager : public FPStaticInterface {
public:
// Create a tabbed dialog. Parent is the parent window of the dialog,
// Instance is the instance where the dialog tempate is stored, and dlg
// is the name of the dialog template resource. If instance is NULL,
// then dlg is a pointer to the dialog template in memory. MainProc is
// the object that is used to handle messages for the dialog. Mult is
// true if the tab control should be multiline and is only applicable
// when tabID is -1. TabID is the ID of a tab control in the dialog
// template, that is to be used. If tabID is -1, then a tab control
// is created. HelpID is used to bring up context sensitive help
// when the F1 key is pressed.
virtual ITabbedDialog* CreateTabbedDialog(
HWND parent,
HINSTANCE instance,
LPCTSTR dlg,
ITabDialogProc* mainProc,
bool multiline,
DWORD helpID=0,
int tabID = -1,
const Class_ID& dialogID = Class_ID(0,0)
) = 0;
// Register/UnRegister a tab for a dialog, DialogID is the id of the dialog
// this tab is to be used with. Tab is the address of an object that is used
// to add the tab when the dialog is created. Tab must remain valid while
// it is registered.
virtual bool RegisterTab(const Class_ID& dialogID, ITabDialogPluginTab* tab) = 0;
virtual void UnRegisterTab(const Class_ID& dialogID, ITabDialogPluginTab* tab) = 0;
// Set/Get the current plugin tab filter for a dialog. This filter is
// used to determine which tabs will be present when the dialog is created.
virtual void SetTabFilter(const Class_ID& dialogID, ITabDialogFilter* filter) = 0;
virtual ITabDialogFilter* GetTabFilter(const Class_ID& dialogID) = 0;
// Get the ITabbedDialog for the dialog id. Returns NULL if dialog not
// present. Assumes that only one dialog is present for a dialog id at a time.
// Note: NOTIFY_TABBED_DIALOG_CREATED and NOTIFY_TABBED_DIALOG_DELETED sent when
// a tabbed dialog is created or deleted. callparam is point to dialogID
virtual ITabbedDialog* GetTabbedDialog(const Class_ID& dialogID) = 0;
// The return value can be a combination of TAB_DIALOG_REMOVE_TAB and
// TAB_DIALOG_ADD_TAB
static int AcceptTab(
ITabDialogFilter* filter,
ITabDialogPluginTab* tab
);
};
// These are some internally defined dialog ids
// Preferences dialog
#define TAB_DIALOG_PREFERENCES_ID Class_ID(0x16d416fb, 0x1cdd4da5)
// Object Properties dialog
#define TAB_DIALOG_PROPERTIES_ID Class_ID(0x777f709b, 0x44404554)
// Configure Path dilaog
#define TAB_DIALOG_PATH_ID Class_ID(0x2c863840, 0x67b1202f)
// Render dialogs
#define TAB_DIALOG_RENDER_ID Class_ID(0x648636a0, 0xe52086b)
#define TAB_DIALOG_VIDEO_POST_ID Class_ID(0x41be0fad, 0x160c099c)
// Environment Dialog
#if defined(ENVIRONMENT_DIALOG_IN_RENDER_DIALOG)
#define TAB_DIALOG_ENVIRONMENT_ID TAB_DIALOG_RENDER_ID
#else // defined(environment_dialog_in_render_dialog)
#define TAB_DIALOG_ENVIRONMENT_ID Class_ID(0x447f2d77, 0x781268a7)
#endif // defined(environment_dialog_in_render_dialog)
// These are the results of accepting a tab for a dialog
enum {
TAB_DIALOG_REMOVE_TAB = 1,
TAB_DIALOG_ADD_TAB = 2
};
#define TAB_DIALOG_MANAGER_INTERFACE_ID Interface_ID(0x46465ead, 0x6e3cbb)
// This inline will return the ITabDialogManager.
inline ITabDialogManager* GetTabDialogManager()
{
return static_cast<ITabDialogManager*>(
GetCOREInterface(TAB_DIALOG_MANAGER_INTERFACE_ID));
}
/***********************************************************************
*
* ITabDialogPluginTab
*
* This interface is used to add plugin tabs to a tabbed dialog.
*
**********************************************************************/
class ITabDialogPluginTab : public BaseInterface {
public:
// Add your tab(s) to the dialog. This will only be called if
// both this object and the dialog agree that the tab should
// be added. Dialog is the address of the dialog.
virtual void AddTabToDialog(ITabbedDialog* dialog) = 0;
// Accept this tab in this dialog. Dialog is the address of the
// dialog. Return true if the tab should be added. Return false
// if the tab should not be added or should be removed if it
// was added previously. Filter is the dialog filter.
virtual int AcceptDialog(
ITabDialogFilter* filter
) { return TAB_DIALOG_ADD_TAB; }
// These return various information that is likely to be interesting
// when deciding whether or not to use this tab.
// If this tab is the UI for a ReferenceMaker, return it here.
virtual ReferenceMaker* GetReferenceMaker() { return NULL; }
// Otherwise, if this tab is the UI for an Animatable, return it here
virtual Animatable* GetAnimatable() { return GetReferenceMaker(); }
// Otherwise, If this tab has some known class ID and super class ID
virtual Class_ID GetClassID() {
Animatable* a = GetAnimatable();
return a ? a->ClassID() : Class_ID(0, 0);
}
virtual SClass_ID GetSuperClassID() {
Animatable* a = GetAnimatable();
return a ? a->SuperClassID() : 0;
}
// Otherwise, you will need to define a special interface
virtual BaseInterface* GetInterface(const Interface_ID& id) { return NULL; }
};
/***********************************************************************
*
* TabDialogFilter
*
* This interface is used to filter plugin tabs in a tabbed dialog.
*
**********************************************************************/
class ITabDialogFilter : public BaseInterface {
public:
// Return true if the tabs added by the ITabDialogPluginTab tab
// are acceptable for this dialog. Dialog is the dialog being
// filtered.
virtual int AcceptTab(
ITabDialogPluginTab* tab
) { return TAB_DIALOG_ADD_TAB; }
// Launch the dialog for this filter, open the dialog at a specific page
virtual int LaunchDialog(const Class_ID& page = Class_ID(0,0)) { return IDOK; }
// These return various information that is likely to be interesting
// when deciding whether or not to add a tab.
// If this dialog is the UI for a ReferenceMaker, return it here.
virtual ReferenceMaker* GetReferenceMaker() { return NULL; }
// Otherwise, if this dialog is the UI for an Animatable, return it here
virtual Animatable* GetAnimatable() { return GetReferenceMaker(); }
// Otherwise, If this dialog has some known class ID and super class ID
virtual Class_ID GetClassID() {
Animatable* a = GetAnimatable();
return a ? a->ClassID() : Class_ID(0, 0);
}
virtual SClass_ID GetSuperClassID() {
Animatable* a = GetAnimatable();
return a ? a->SuperClassID() : 0;
}
// Otherwise, you will need to define a special interface
virtual BaseInterface* GetInterface(const Interface_ID& id) { return NULL; }
};
/***********************************************************************
*
* TabDialogMessages
*
* Messages used by the tab dialog class
*
**********************************************************************/
enum TabDialogMessages {
TABDLG_SWITCH_FROM = WM_USER + 1, // Switching from this page
TABDLG_SWITCH_TO = WM_USER + 2, // Switching to this page
TABDLG_COMMIT = WM_USER + 3, // Commit the page's working values for real
TABDLG_PRECOMMIT = WM_USER + 4, // Check your values, but don't close the dialog;
// if your page needs to reject an OK, set the
// bool* in LPARAM to false.
TABDLG_CANCEL = WM_USER + 5, // User is cancelling out of the dialog
TABDLG_CLOSE = WM_USER + 6, // User is closing a modeless dialog
TABDLG_INVALIDATE = WM_USER + 7, // The underlying data has changed
TABDLGNOTIFY_GETINITINFO = WM_USER + 8, // WE need to get init, see struct TABDLG_NMHDR
TABDLG_RESIZE_DIALOG= WM_USER + 9 // The tab is too small for the content
};
// The address of this struct passed in LPARAM when
// you get a WM_NOTIFY, with TABDLGNOTIFY_GETINITINFO
// as the notify code. This notification is sent to
// the tab dialog before each page is created. hdr.idFrom
// is the index of the page about to be created. The
// value stored in dwInitParam is passed to the InitPage
// method as lparam.
struct TABDLG_NMHDR
{
NMHDR hdr;//the common denominator
//we use the
LPARAM dwInitParam; //this out param contains the ptr to initialization data for the page.
};
/***********************************************************************
*
* ITabbedDialog
*
* This interface is used to manage a tabbed dialog. You can add pages
* and either display a modal or modeless dialog.
* You can add a rollout page, that can contain MAX rollouts
*
**********************************************************************/
#define TABBED_DIALOG_INTERFACE_ID Interface_ID(0x4128621b, 0x744d5789)
class ITabbedDialog {
public:
enum {
kSystemPage = 20,
kNormalPage = 50,
kMaxPage = 100
};
static ITabbedDialog* GetPointer(HWND dialog) {
return reinterpret_cast<ITabbedDialog*>(GetWindowLongPtr(
dialog, GWLP_USERDATA));
}
// Delete yourself
virtual void DeleteThis() = 0;
// Return the dialogID for this dialog
virtual Class_ID GetDialogID() const = 0;
// Add a page to the dialog. Text is the tab text. Instance and
// tmplt are the instance and resource for the dialog template
// for the page. If instance is NULL, the tmplt is a pointer to
// the dialog template in memory. Proc is the message handler for
// the page. Image is an image for the tab in the image list set
// by SetImageList. Order is the order that the tab will appear
// in the tabs. Two pages with the same order are ordered
// by the order they are added. HelpID is ID used for context
// sensitive help.
virtual ITabPage* AddPage(
LPCTSTR text,
HINSTANCE instance,
LPCTSTR tmplt,
ITabPageProc* proc,
const Class_ID& pageID,
ITabDialogPluginTab* plugin = NULL,
DWORD helpID = 0,
int order = kNormalPage,
int image = -1
) = 0;
// Add a rollout page to the dialog. Text is the tab text. Proc is
// the message handler for the page. The margins give additional
// space between the rollout control and the client are of the tab.
// Image is an image for the tab in the image list set by SetImageList.
// Order is the order that the tab will appear in the tabs. Two
// pages with the same order are ordered by the order they are added.
// HelpID is ID used for context sensitive help.
virtual ITabPage* AddRollout(
LPCTSTR text,
ITabPageProc* proc,
const Class_ID& pageID,
ITabDialogPluginTab* plugin = NULL,
int controlID = -1,
int width = 0,
int bottomMargin = 0,
DWORD helpID = 0,
int order = kNormalPage,
int image = -1
) = 0;
// Add and remove registered tabs to the dialog.
virtual void SyncRegisteredTabs() = 0;
// Get the filter for this dialog
virtual ITabDialogFilter* GetTabFilter() const = 0;
// Get/Set the dialog proc. The previous
// value is returned when setting the proc
virtual ITabDialogProc* GetProc() const = 0;
virtual ITabDialogProc* SetProc(ITabDialogProc* newProc) = 0;
// Display and process modal dialog
virtual INT_PTR DoModal(const Class_ID& page) = 0;
// Display and process modeless dialog
virtual bool DoFloater(const Class_ID& page) = 0;
// Switch to the given page.
virtual void Switch(const Class_ID& page) = 0;
// Invalidate all pages in the dialog.
virtual void Invalidate() = 0;
// Set the image list for the tab control
virtual void SetImageList(HIMAGELIST list) = 0;
// Get the index of the current page
virtual int CurrentPage() const = 0;
// Set the margins for the tab in the dialog. This is
// only applicable if the tabCtrl is not part of the
// dialog template. If SetTabbedRect is called with
// a nonempty rectangle, it is used, otherwise the
// margins are used.
virtual void SetMargins(int left, int top, int right, int bottom) = 0;
virtual void SetTabbedRect(const RECT& rect) = 0;
// Convert indices to pages
virtual int GetNbPages() const = 0;
virtual ITabPage* GetPage(int index) const = 0;
virtual ITabPage* GetPage(const Class_ID& id) const = 0;
// Get the window for the tabbed dialog
virtual HWND GetHWND() const = 0;
// Used for modal dialogs with IDOK and IDCANCEL
virtual bool OkToCommit() = 0;
virtual bool CommitPages() = 0;
// Used for modeless dialogs; note that if the user hits the X in the upper right
// corner, a cancel message will be sent.
virtual void CloseDialog() = 0;
virtual void ClosePages() = 0;
// Used for both.
virtual void CancelDialog() = 0;
virtual void CancelPages() =0;
// Get the window for the tab control
virtual HWND GetTabHWND() const = 0;
protected:
// Don't allow it to be deleted except through DeleteThis
~ITabbedDialog() {}
};
/***********************************************************************
*
* TabDialogPointer
*
* This smart pointer is used to simplify scope management
*
**********************************************************************/
class TabDialogPointer {
public:
TabDialogPointer() : mpDlg(NULL) { }
explicit TabDialogPointer(ITabbedDialog* dlg) : mpDlg(dlg) { }
explicit TabDialogPointer(TabDialogPointer& src) : mpDlg(src.mpDlg) { src.mpDlg = NULL; }
TabDialogPointer(
HWND parent,
HINSTANCE instance,
LPCTSTR dlg,
ITabDialogProc* mainProc,
bool multiline,
DWORD helpID = 0,
int tabID = -1,
const Class_ID& dialogID = Class_ID(0,0)
) : mpDlg(NULL)
{
ITabDialogManager* i = GetTabDialogManager();
if (i != NULL) {
mpDlg = i->CreateTabbedDialog(parent, instance, dlg, mainProc,
multiline, helpID, tabID, dialogID);
}
}
~TabDialogPointer() { free(); mpDlg = NULL; }
TabDialogPointer& operator=(ITabbedDialog* dlg) { free(); mpDlg = dlg; return *this; }
TabDialogPointer& operator=(TabDialogPointer& src) { free(); mpDlg = src.mpDlg; src.mpDlg = NULL; return *this; }
operator ITabbedDialog*() { return mpDlg; }
ITabbedDialog& operator*() { return *mpDlg; }
ITabbedDialog* get() { return mpDlg; }
ITabbedDialog* release() { ITabbedDialog* dlg = mpDlg; mpDlg = NULL; return dlg; }
ITabbedDialog* operator->() { return mpDlg; }
ITabbedDialog** operator&() { return &mpDlg; }
bool Create(
HWND parent,
HINSTANCE instance,
LPCTSTR dlg,
ITabDialogProc* mainProc,
bool multiline,
int tabID = -1,
DWORD helpID = 0,
const Class_ID& dialogID = Class_ID(0,0)
)
{
ITabDialogManager* i = GetTabDialogManager();
if (i != NULL) {
ITabbedDialog* retVal = i->CreateTabbedDialog(parent, instance, dlg, mainProc,
multiline, helpID, tabID, dialogID);
if (retVal != NULL) {
free();
mpDlg = retVal;
return true;
}
}
return false;
}
private:
void free() { if (mpDlg != NULL) mpDlg->DeleteThis(); }
ITabbedDialog* mpDlg;
};
/***********************************************************************
*
* ITabPage
*
* This interface is used to manage a page in a tabbed dialog.
*
**********************************************************************/
class ITabPage : public BaseInterface {
public:
// Get the window for this page
virtual HWND GetHWND() const = 0;
// Get the pageID for this page
virtual Class_ID GetPageID() const = 0;
// Get the help ID for the page
virtual int GetHelpID() const = 0;
// Get the tab dialog containing this page
virtual ITabbedDialog* GetTabDialog() const = 0;
// Get/Set the tab dialog page proc. The previous
// value is returned when setting the proc
virtual ITabPageProc* GetProc() const = 0;
virtual ITabPageProc* SetProc(ITabPageProc* newProc) = 0;
// Get the Plugin that added this page
virtual ITabDialogPluginTab* GetPlugin() const = 0;
// Convert pages to indices
virtual int GetIndex() const = 0;
// Refresh your UI.
virtual void Invalidate() = 0;
// Get the IRollupWindow interface for the rollout
// This interface should not be released, because
// it is release by this object when the rollout
// is destroyed. NULL is returned if the page is
// not a rollout.
virtual IRollupWindow* GetRollout() = 0;
};
/***********************************************************************
*
* ITabDialogProc
*
* This interface is implemented by the code that wants to use the
* tab dialog. The implementer can choose whether to respond to
* the methods or to messages
*
**********************************************************************/
class ITabDialogProc : public BaseInterface {
public:
// Construct
ITabDialogProc() : mpDlg(NULL) {}
// Set the dialog proc
void SetTabDialog(ITabbedDialog* dlg) { mpDlg = dlg; }
ITabbedDialog* GetTabDialog() const { return mpDlg; }
// Delete this dialog proc. This method does nothing, because most
// dialog procs are not scoped by their dialog, but you can override
// it if you want your dialog proc deleted when the dialog is deleted.
virtual void DeleteThis() {}
// Initialize the dialog
INT_PTR InitDialog(HWND focus) {
return dialogProc(WM_INITDIALOG, reinterpret_cast<WPARAM>(focus), 0);
}
// Invalidate the dialog
void Invalidate() {
dialogProc(TABDLG_INVALIDATE, 0, 0);
}
// Used for modal dialogs with IDOK and IDCANCEL
bool OkToCommit() {
bool commit = true;
dialogProc(TABDLG_PRECOMMIT, 0, reinterpret_cast<LPARAM>(&commit));
return commit;
}
void Commit() {
dialogProc(TABDLG_COMMIT, 0, 0);
}
// The dialog is being closed. This is called after
// all of the pages have been committed.
void Close() {
dialogProc(TABDLG_CLOSE, 0, 0);
}
// The dialog is being canceled
void Cancel() {
dialogProc(TABDLG_CANCEL, 0, 0);
}
// Resize the dialog. Delta is the required
// change in size. This method is only called
// if the size needs to be increased.
// Return true if the dialog was resized.
// If the dialog was resize, the dialog manager
// will resize the tab control and the content.
// The dialog proc may change the delta values
// to correspond the the amount the dialog was resized.
bool ResizeDialog(SIZE* delta) {
return dialogProc(TABDLG_RESIZE_DIALOG, 0,
reinterpret_cast<LPARAM>(delta)) != 0;
};
// The general message proc. This proc is like a
// dialog proc, not a window proc
virtual INT_PTR dialogProc(
UINT msg,
WPARAM wParam,
LPARAM lParam
) { return FALSE; }
// Get extension interfaces, if there are any
virtual BaseInterface* GetInterface(const Interface_ID& id) { return NULL; }
private:
ITabbedDialog* mpDlg;
};
/***********************************************************************
*
* ITabPageProc
*
* This interface is used to filter plugin tabs in a tabbed dialog.
*
**********************************************************************/
class ITabPageProc {
public:
// Construct
ITabPageProc() : mpPage(NULL) {}
// Set the dialog proc
void SetTabPage(ITabPage* page) { mpPage = page; }
ITabPage* GetTabPage() const { return mpPage; }
// Delete this page proc. This method does nothing, because most
// page procs are not scoped by their page, but you can override
// it if you want your page proc deleted when the page is deleted.
virtual void DeleteThis() {}
// Initialize the dialog
INT_PTR InitPage(HWND focus, LPARAM lparam) {
return dialogProc(WM_INITDIALOG, reinterpret_cast<WPARAM>(focus), lparam);
}
// Invalidate the dialog
void Invalidate() {
dialogProc(TABDLG_INVALIDATE, 0, 0);
}
// Used for modal dialogs with IDOK and IDCANCEL
bool OkToCommit() {
bool commit = true;
dialogProc(TABDLG_PRECOMMIT, 0, reinterpret_cast<LPARAM>(&commit));
return commit;
}
void Commit() {
dialogProc(TABDLG_COMMIT, 0, 0);
}
// The dialog is being closed. This is called after
// all of the pages have been committed.
void Close() {
dialogProc(TABDLG_CLOSE, 0, 0);
}
// The dialog is being canceled
void Cancel() {
dialogProc(TABDLG_CANCEL, 0, 0);
}
// Switch from this page
void SwitchFrom() {
dialogProc(TABDLG_SWITCH_FROM, 0, 0);
}
// Switch to this page
void SwitchTo() {
dialogProc(TABDLG_SWITCH_TO, 0, 0);
}
// The general message proc. This proc is like a
// dialog proc, not a window proc
virtual INT_PTR dialogProc(
UINT msg,
WPARAM wParam,
LPARAM lParam
) { return FALSE; }
private:
ITabPage* mpPage;
};
/***********************************************************************
*
* ITabDialogObject
*
* This interface is used to allow plugins to interact with a tabbed dialog.
* Objects can expose this interface when they want to participate
* in tab selection in a tabbed dialog.
*
* The dialog defines how objects can participate:
*
* The Render dialog allows the renderer to participate in the dialog tabs.
*
* If the renderer doesn't expose this interface, a single separate
* tab is created for the renderer's paramters, and the renderer is
* allowed to create rollouts in this tab.
*
* If the renderer does expose this interface, its filter is assigned
* to the dialog, to allow it to reject tabs that are not applicable
* to its user interface, and it is informed of different actions
* that are taking place.
*
**********************************************************************/
class ITabDialogObject : public BaseInterface {
public:
// Notify the object that the dialog is activated
// or deactivated in a tabbed dialog
virtual void Activate(ITabbedDialog* dialog) { }
virtual void Deactivate(ITabbedDialog* dialog) { }
// Add your tab(s) to the dialog. This will only be called if
// both this object and the dialog agree that the tab should
// be added. Dialog is the address of the dialog.
virtual void AddTabToDialog(ITabbedDialog* dialog, ITabDialogPluginTab* tab) { }
// Return true if the tabs added by the ITabDialogPluginTab tab
// are acceptable for this dialog. Dialog is the dialog being
// filtered.
virtual int AcceptTab(
ITabDialogPluginTab* tab
) { return TAB_DIALOG_ADD_TAB; }
};
#define TAB_DIALOG_OBJECT_INTERFACE_ID Interface_ID(0x313c6db9, 0x42890bb3)
inline ITabDialogObject* GetTabDialogObject(InterfaceServer* obj)
{
return static_cast<ITabDialogObject*>(obj->GetInterface(
TAB_DIALOG_OBJECT_INTERFACE_ID));
}
inline int ITabDialogManager::AcceptTab(
ITabDialogFilter* filter,
ITabDialogPluginTab* tab
)
{
int dlgResult = filter == NULL ? TAB_DIALOG_ADD_TAB : filter->AcceptTab(tab);
if (dlgResult & TAB_DIALOG_ADD_TAB) {
dlgResult &= ~TAB_DIALOG_ADD_TAB;
dlgResult |= tab->AcceptDialog(filter);
}
return dlgResult;
}
#endif

View File

@ -0,0 +1,56 @@
/**********************************************************************
*<
FILE: IUtilityPanel.h
DESCRIPTION: Function-published interface to access the utility panel
CREATED BY: David Cunningham
HISTORY: August 31, 2001 file created
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef __IUTILPANEL__
#define __IUTILPANEL__
#include "iFnPub.h"
#define IUTIL_FO_INTERFACE Interface_ID(0x7476dc, 0x4364dc)
//==============================================================================
// class IUtilityPanel
//
// The interface to the utility panel manager.
//
// This class defines an interface for opening and closing utility plugins, and
// provides maxscript access to the same.
//
// An instance of this interface can be retrieved using the following line of
// code:
//
// static_cast<IUtilityPanel*>(GetCOREInterface(IUTIL_FO_INTERFACE));
//
// Or, from maxscript (examples):
//
// UtilityPanel.OpenUtility Resource_Collector
// UtilityPanel.OpenUtility Bitmap_Photometric_Path_Editor
// UtilityPanel.CloseUtility
//
// The last example closes the currently open utility, if any.
//
//==============================================================================
// maxscript method enum
enum { util_open, util_close };
class IUtilityPanel : public FPStaticInterface {
public:
virtual BOOL OpenUtility(ClassDesc*) = 0;
virtual void CloseUtility() = 0;
};
#endif

View File

@ -0,0 +1,172 @@
/**********************************************************************
*<
FILE: IViewportManager.h
DESCRIPTION: Viewport Manager for loading up Effects
CREATED BY: Neil Hazzard
HISTORY: Created: 02/15/02
Updated: 05/05/04 New interface added for 3ds max7
*> Copyright (c) 2004, All Rights Reserved.
**********************************************************************/
#ifndef __IVIEWPORTMANAGER_H__
#define __IVIEWPORTMANAGER_H__
#include "iFnPub.h"
#include "custattrib.h"
#include "IHardwareMaterial.h"
#define VIEWPORT_SHADER_MANAGER_INTERFACE Interface_ID(0x5dbe33d6, 0x2e1b422b)
#define VIEWPORT_SHADER_MANAGER_INTERFACE2 Interface_ID(0x5a4d6672, 0x7d8a2857)
#define VIEWPORT_SHADER_CLIENT_INTERFACE Interface_ID(0x40c926b8, 0x7c3a66b7)
#define VIEWPORT_SHADER9_CLIENT_INTERFACE Interface_ID(0x40c926b7, 0x7c3a6347)
#define IDX_SHADER_MANAGER Interface_ID(0x6dce7429, 0x200169ac)
//! An Interface class to access the Viewport Manager
/*! This Interface allows access to the various components of the Viewport Manager. THis includes finding out
how many effects are registered with the system
*/
class IViewportShaderManager : public FPMixinInterface {
public:
enum { get_num_effects, get_active_effect, is_effect_active, is_manager_active,
get_effect_name,set_effect,activate_effect};
FPInterfaceDesc* GetDesc();
/*! Get the number of effects registered with the system
\return The total number of effects
*/
virtual int GetNumEffects()=0;
/*! Get the current active effect. This effect will implement the IDXDataBridge classes
\return A referenceTarget implementing the effect
*/
virtual ReferenceTarget* GetActiveEffect()=0;
/*! Access the UI name for the effect
\param i An index of the effect whose name is required
\return A TCHAR containing the name
*/
virtual TCHAR * GetEffectName(int i)=0;
/*! Set the actual viewport effect to be used.
\param i An index of the effect to set.
\return A pointer to the effect
*/
virtual ReferenceTarget * SetViewportEffect(int i)=0;
/*! Turns on the effect based on the material and state supplied. THis sets the internal flag on the material
that tells the system that a DX shader is present
\param *mtl THe material to activate
\State A boolean value that defines the state of the flag
*/
virtual void ActivateEffect(MtlBase * mtl, BOOL State)=0;
};
//! A new interface for 3dsmax 7
/*! This extends the current interface, and provides support for the new UI options on the Viewport Manager
*/
class IViewportShaderManager2 : public IViewportShaderManager
{
public:
//! Save the current effect based on the Standard Material as an effect file
/*!
\param * filename The name of the file to save
\return The success of the operation
*/
virtual bool SaveFXFile(TCHAR * fileName)=0;
/*! Is the DX Display of the Standard Material enabled
\return TRUE/FALSE
*/
virtual bool IsDxStdMtlEnabled()=0;
/*! Access to set the state of the DX Display of the Standard Material flag
\param state The state of the flag - TRUE to set
*/
virtual void SetDxStdMtlEnabled(bool state)=0;
/*! The name of the current effect as displayed in the UI
\return The name of the effect
*/
virtual TCHAR * GetActiveEffectName() = 0;
};
//! Viewport Effect interface
/*! A Direct X 8.1 shader should implement this class. It is used by the system to get information from the shader
If a material implements this class, then all it needs to do is pass back a pointer in the GetInterface implementation.
All the other methods can simply be a no op.
*/
class IDXDataBridge : public BaseInterface
{
public:
virtual Interface_ID GetID() { return VIEWPORT_SHADER_CLIENT_INTERFACE; }
// Interface Lifetime
virtual LifetimeType LifetimeControl() { return noRelease; }
/*! The Viewport Manager will call this on the effect so that it can draw its dialog
\param hWnd The parent window handle
\param *imp A pointer to IMtlParam - see the main max SDK for info on this class
\return A new ParamDlg pointer which the Viewport Manager will uses as a child of its window
*/
virtual ParamDlg * CreateEffectDlg(HWND hWnd, IMtlParams * imp)= 0;
//! This is no longer used
virtual void DisableUI()=0;
/*! Get the UI name of the effect - this is only used for Viewport MAnager effects - not materials
\return A TCHAR containing the name
*/
virtual TCHAR * GetName()=0;
/*! For effects that will be using the fixed function pipeline. This provided access to the IHArdwareMaterial
allowing access to DirectX FFP.
\param *pHWMtl A pointer to the internal hardware material.
\param *pMtl A pointer to the parent Material
*/
virtual void SetDXData(IHardwareMaterial * pHWMtl, Mtl * pMtl)=0;
};
// If you are creating a DX9 based effect then you need to implement this interface
class IDX9DataBridge : public IDXDataBridge
{
public:
// Interface Lifetime
virtual LifetimeType LifetimeControl() { return noRelease; }
virtual Interface_ID GetID() { return VIEWPORT_SHADER9_CLIENT_INTERFACE; }
//! Versioning
/*! The system uses this to determine whether the effect is compatible to the current GFX loaded on MAX
\return 8.1 or 9.0 etc...
*/
virtual float GetDXVersion() = 0;
};
/*! An Interface that provides access to the actual manager. The manager is responsible for displaying the Viewport Manager which is
implemented as a Cust Attribute on the material
*/
class IDXShaderManagerInterface : public FPStaticInterface
{
public:
virtual CustAttrib* FindViewportShaderManager (MtlBase* mtl)=0;
virtual CustAttrib* AddViewportShaderManager(MtlBase * mtl)=0;
virtual void SetVisible(BOOL show=TRUE)=0;
virtual BOOL IsVisible()=0;
};
inline IDXShaderManagerInterface* GetDXShaderManager() { return (IDXShaderManagerInterface*)GetCOREInterface(IDX_SHADER_MANAGER); }
#endif

109
lib/maxsdk70/include/MAXVERSION.R Executable file
View File

@ -0,0 +1,109 @@
#include "buildver.h" // For product-specific stuff like MAXVER_PRODUCTNAME
#include "maxversion.h" // For build number, etc.
//
// Should be overridden per-project/product
// either use these defaults or define in verroverrides.h and include it in the resource file before
// including this maxversion.r file
// and also make sure the version information has been removed from your resource file
// also see maxversion.h
#ifndef MAXVER_PRODUCTNAME
#if defined(GAME_FREE_VER)
#define MAXVER_PRODUCTNAME "gmax\0"
#elif defined(GAME_VER)
#define MAXVER_PRODUCTNAME "gmax dev\0"
#elif defined(RENDER_VER)
#define MAXVER_PRODUCTNAME "Autodesk VIZ Render\0"
#elif defined(DESIGN_VER)
#define MAXVER_PRODUCTNAME "Autodesk VIZ\0"
#elif defined(WEBVERSION)
#define MAXVER_PRODUCTNAME "plasma\0"
#else
#define MAXVER_PRODUCTNAME "3ds max\0"
#endif
#endif
#ifndef MAXVER_INTERNALNAME
#define MAXVER_INTERNALNAME "\0"
#endif
#ifndef MAXVER_ORIGINALFILENAME
#define MAXVER_ORIGINALFILENAME "\0"
#endif
#ifndef MAXVER_FILEDESCRIPTION
#define MAXVER_FILEDESCRIPTION "\0"
#endif
#ifndef MAXVER_COMMENTS
#define MAXVER_COMMENTS "\0"
#endif
#ifndef MAXVER_COPYRIGHT
#define MAXVER_COPYRIGHT "<22> 1994-2003 Autodesk, Inc. All rights reserved.\0"
#endif
#ifndef MAXVER_LEGALTRADEMARKS
#define MAXVER_LEGALTRADEMARKS "Discreet, Autodesk, Inc., Kinetix, 3D Studio MAX, Autodesk VIZ, Biped, Character Studio, Heidi, Kinetix, Physique, plasma, 3ds max, DWG Unplugged, FLI, FLIC, and DXF are either registered trademarks or trademarks of Discreet Logic Inc./Autodesk, Inc.\0"
#endif
#ifndef MAXVER_COMPANYNAME
#define MAXVER_COMPANYNAME "Discreet, a division of Autodesk, Inc.\0"
#endif
//
// Everything else is fixed...
//
#define _MAXVER_TOSTRING(x) #x
#define _MAXVER_RCVERSION(a, b, c, d) a,b,c,d
#define _MAXVER_RCVERSION_STR(a, b, c, d) _MAXVER_TOSTRING(a##.b##.c##.##d)
#define MAXVER_FILEVERSION _MAXVER_RCVERSION(MAX_VERSION_MAJOR, MAX_VERSION_MINOR, MAX_VERSION_POINT, VERSION_INT)
#define MAXVER_FILEVERSION_STR _MAXVER_RCVERSION_STR(MAX_VERSION_MAJOR, MAX_VERSION_MINOR, MAX_VERSION_POINT, VERSION_INT)
#define MAXVER_PRODUCTVERSION _MAXVER_RCVERSION(MAX_PRODUCT_VERSION_MAJOR, MAX_PRODUCT_VERSION_MINOR, MAX_PRODUCT_VERSION_POINT, VERSION_INT)
#define MAXVER_PRODUCTVERSION_STR _MAXVER_RCVERSION_STR(MAX_PRODUCT_VERSION_MAJOR, MAX_PRODUCT_VERSION_MINOR, MAX_PRODUCT_VERSION_POINT, VERSION_INT)
#define MAXVER_PRIVATE_BUILD VERSION_STRING
//
// Version resource
//
// why not allow this to remain in each .rc file - that way this method can be overridden with per-dll changes as necessary?
//q:would be nice if the below stuff could be kept in the .rc file ...
//A:when msdev writes out an .rc file it does so destructively...
VS_VERSION_INFO VERSIONINFO
FILEVERSION MAXVER_FILEVERSION
PRODUCTVERSION MAXVER_PRODUCTVERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", MAXVER_COMPANYNAME
VALUE "FileVersion", MAXVER_FILEVERSION_STR
VALUE "InternalName", MAXVER_INTERNALNAME
VALUE "LegalCopyright", MAXVER_COPYRIGHT
VALUE "OriginalFilename", MAXVER_ORIGINALFILENAME
VALUE "Private Build Data", MAXVER_PRIVATE_BUILD
VALUE "ProductName", MAXVER_PRODUCTNAME
VALUE "ProductVersion", MAXVER_PRODUCTVERSION_STR
VALUE "FileDescription", MAXVER_FILEDESCRIPTION
VALUE "Comments", MAXVER_COMMENTS
VALUE "LegalTrademarks", MAXVER_LEGALTRADEMARKS
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

1015
lib/maxsdk70/include/MAX_Mem.h Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,194 @@
/**********************************************************************
*<
FILE: MNNormalSpec.h
DESCRIPTION: User-specifiable normals for MNMeshes - Luna task 747
CREATED BY: Steve Anderson
HISTORY: created January 2002
*> Copyright (c) 2002 Autodesk, Inc., All Rights Reserved.
**********************************************************************/
// Necessary prior inclusions: max.h, mnmesh.h
#ifndef __MN_NORMALS_H_
#define __MN_NORMALS_H_
#include "baseinterface.h"
#include "ipipelineclient.h"
#define MN_NORMAL_SPEC_INTERFACE Interface_ID(0x7b7c2c5f, 0xf94260f)
class MNNormalFace {
int mDegree;
int *mpNormalID;
BitArray mSpecified;
public:
MNNormalFace () : mDegree(0), mpNormalID(NULL) { }
DllExport MNNormalFace (int degree);
~MNNormalFace () { Clear(); }
DllExport void Init();
DllExport void Clear();
// Data accessors
int GetDegree() { return mDegree; }
DllExport void SetDegree (int degree);
// Low-level - do not use mSpecified data!
int GetNormalID(int corner) { return (mpNormalID && (corner<mDegree)) ? mpNormalID[corner] : -1; }
void SetNormalID (int corner, int norm) { if (mpNormalID && (corner<mDegree)) mpNormalID[corner] = norm; }
int *GetNormalIDArray () { return mpNormalID; }
bool GetSpecified (int corner) { return (mpNormalID && (corner<mDegree) && mSpecified[corner]) ? true : false; }
void SetSpecified (int corner, bool value=true) { if (mpNormalID && (corner<mDegree)) mSpecified.Set (corner, value); }
void SpecifyAll (bool value=true) { if (value) mSpecified.SetAll(); else mSpecified.ClearAll(); }
DllExport void SpecifyNormalID (int corner, int norm);
DllExport void MakePoly (int degree, int *pNormalID);
DllExport void Insert (int pos, int num=1);
DllExport void Delete (int pos, int num=1);
DllExport void RotateStart (int newstart);
DllExport void Flip (); // Reverses order of verts. 0 remains start.
DllExport MNNormalFace & operator= (const MNNormalFace & from);
DllExport MNNormalFace & operator= (const MNFace & from);
DllExport void ShallowTransfer (MNNormalFace & from);
DllExport void MNDebugPrint (bool printAll=false);
DllExport IOResult Save (ISave *isave);
DllExport IOResult Load (ILoad *iload);
};
// Class MNNormalSpec flags:
#define MNNORMAL_NORMALS_BUILT 0x01
#define MNNORMAL_NORMALS_COMPUTED 0x02
#define MNNORMAL_DISPLAY_HANDLES 0x04
#define MNNORMAL_FACE_ANGLES 0x08 // Used face angles last time we computed normals
// Default length for normal display
#define MNNORMAL_LENGTH_DEFAULT 10.0f
class MNNormalSpec : public IPipelineClient, public FlagUser {
private:
int mNumNormalAlloc, mNumFaceAlloc;
int mNumNormals, mNumFaces;
MNNormalFace *mpFace;
Point3 *mpNormal;
BitArray mNormalExplicit; // Indicates whether mpNormal[i] is explicit or computed from face normals.
// Display and selection data:
BitArray mNormalSel;
float mDisplayLength;
// We also maintain a pointer to the parent MNMesh
// (NOTE that the MNMesh MUST keep this pointer updated at all times!)
MNMesh *mpParent;
public:
MNNormalSpec () : mpFace(NULL), mpNormal(NULL), mNumNormalAlloc(0),
mNumFaceAlloc(0), mNumNormals(0), mNumFaces(0), mpParent(NULL),
mDisplayLength(MNNORMAL_LENGTH_DEFAULT) { }
~MNNormalSpec () { ClearAndFree (); }
// Initialization, allocation:
DllExport void Initialize (); // Initializes all data members - do not use if already allocated!
DllExport bool NAlloc (int num, bool keep=TRUE);
DllExport void NShrink (); // shrinks allocation down to actual number of normals.
DllExport bool FAlloc (int num, bool keep=TRUE);
DllExport void FShrink ();
DllExport void Clear (); // Deletes everything.
DllExport void ClearAndFree (); // Deletes everything, frees all memory
// Data access:
// Lowest level:
int GetNumFaces () const { return mNumFaces; }
DllExport bool SetNumFaces (int numFaces);
int GetNumNormals () const { return mNumNormals; }
DllExport bool SetNumNormals (int numNormals);
Point3 & Normal (int normID) const { return mpNormal[normID]; }
Point3 * GetNormalArray () const { return mpNormal; }
bool GetNormalExplicit (int normID) const { return mNormalExplicit[normID] ? true : false; }
void SetNormalExplicit (int normID, bool value) { mNormalExplicit.Set (normID, value); }
void SetAllExplicit (bool value=true) { if (value) mNormalExplicit.SetAll(); else mNormalExplicit.ClearAll (); }
MNNormalFace & Face(int faceID) const { return mpFace[faceID]; }
MNNormalFace * GetFaceArray () const { return mpFace; }
void SetParent (MNMesh *pMesh) { mpParent = pMesh; }
// Data access - higher level:
DllExport Point3 & GetNormal (int face, int corner);
DllExport void SetNormal (int face, int corner, Point3 & normal);
DllExport int GetNormalIndex (int face, int corner);
DllExport void SetNormalIndex (int face, int corner, int normalIndex);
DllExport int NewNormal (Point3 & normal, bool explic=true);
DllExport void SetSelection (BitArray & newSelection);
BitArray & GetSelection() { return mNormalSel; }
void SetDisplayLength (float displayLength) { mDisplayLength = displayLength; }
float GetDisplayLength () { return mDisplayLength; }
DllExport void CollapseDeadFaces (); // Requires an accurate mpParent pointer.
// Display and hit testing - note that these require an accurate mpParent pointer.
DllExport void Display (GraphicsWindow *gw, bool showSel);
DllExport bool HitTest (GraphicsWindow *gw, HitRegion *hr, DWORD flags, SubObjHitList& hitList);
DllExport Box3 GetBoundingBox (Matrix3 *tm=NULL, bool selectedOnly=false);
// This method dumps all unspecified normals. Best to use only from within CheckNormals.
DllExport void ClearNormals ();
// Fills in the mpSpecNormal data by building all the unspecified normals,
// and computing non-explicit ones.
// Does nothing if normal faces not allocated yet!
// Requires an accurate mpParent pointer.
DllExport void BuildNormals ();
// This method just recomputes the directions of non-explicit normals,
// without rebuilding the normal list.
// Requires an accurate mpParent pointer.
DllExport void ComputeNormals ();
// This checks our flags and calls BuildNormals, ComputeNormals as needed.
// Requires an accurate mpParent pointer.
DllExport void CheckNormals ();
// operators and debug printing
DllExport MNNormalSpec & operator= (const MNNormalSpec & from);
DllExport void CopySpecified (const MNNormalSpec & from); // Like operator=, but omits unspecified.
DllExport MNNormalSpec & operator+= (const MNNormalSpec & from);
DllExport void MNDebugPrint (bool printAll=false);
DllExport bool CheckAllData (int numParentFaces);
DllExport IOResult Save (ISave *isave);
DllExport IOResult Load (ILoad *iload);
// From BaseInterface:
Interface_ID GetID() {return MN_NORMAL_SPEC_INTERFACE;}
DllExport void DeleteInterface();
DllExport BaseInterface* GetInterface(Interface_ID id);
DllExport BaseInterface* CloneInterface(void* remapDir = NULL);
// --- IPipelineClient methods
DllExport void ShallowCopy( IPipelineClient* from, ULONG_PTR channels );
DllExport void DeepCopy( IPipelineClient* from, ULONG_PTR channels );
DllExport void NewAndCopyChannels( ULONG_PTR channels );
DllExport void FreeChannels( ULONG_PTR channels, int zeroOthers = 1 );
DllExport void ZeroChannels( ULONG_PTR channels );
DllExport void AppendAllChannels( IPipelineClient* from );
// Actual operations:
DllExport bool Transform (Matrix3 & xfm, BOOL useSel=false, BitArray *normalSelection=NULL);
DllExport bool Translate (Point3 & translate, BOOL useSel=true, BitArray *normalSelection=NULL);
DllExport bool BreakNormals (BOOL useSel=true, BitArray *normalSelection=NULL, BOOL toAverage=false);
// Requires an accurate mpParent pointer:
DllExport bool UnifyNormals (BOOL useSel=true, BitArray *normalSelection=NULL, BOOL toAverage=false);
DllExport bool AverageNormals (BOOL useThresh=false, float threshold=0.0f, BOOL useSel=true, BitArray *normalSelection=NULL);
DllExport bool SpecifyNormals (BOOL useSel=true, BitArray *normalSelection=NULL);
DllExport bool MakeNormalsExplicit (BOOL useSel=true, BitArray *normalSelection=NULL, bool value=true);
DllExport bool ResetNormals (BOOL useSel=true, BitArray *normalSelection=NULL);
};
#endif //__MN_NORMALS_H_

View File

@ -0,0 +1,208 @@
/**********************************************************************
*<
FILE: MeshNormalSpec.h
DESCRIPTION: User-specifiable normals for Triangle Meshes
CREATED BY: Steve Anderson
HISTORY: created July 2002 during SIGGraph
*> Copyright (c) 2002 Autodesk, Inc., All Rights Reserved.
**********************************************************************/
// Necessary prior inclusions...?
#ifndef __MESH_NORMALS_H_
#define __MESH_NORMALS_H_
#include "baseinterface.h"
#include "ipipelineclient.h"
#define MESH_NORMAL_SPEC_INTERFACE Interface_ID(0xa4e770b, 0x47aa3cf9)
/// <summary>
/// <seealso>class MeshNormalSpec</seealso>
///
/// This class is available in release 6.0 and later only.
///
/// This class is used to store specified normal information for a
/// particular face in a Mesh. An array of these faces is used in
/// class MeshNormalSpec to match vertex normals to vertices.
///
/// Each MeshNormalFace contains a bit indicating whether each corner
/// is specified, and a Normal ID for each specified corner.
/// </summary>
class MeshNormalFace {
int mNormalID[3];
UBYTE mSpecified;
public:
///<summary> Constructor - sets all corners to "unspecified" </summary>
MeshNormalFace () : mSpecified(0x0) { }
///<summary> Resets all corners to "unspecified". </summary>
DllExport void Clear();
///<summary> Accessor for normal in a particular corner of the face. </summary>
///<param name="corner"> The (zero-based) index of the corner of the face </param>
///<returns> The index of the normal (in the owner MeshNormalSpec's normal array)
// used in that corner, or -1 for error </returns>
int GetNormalID(int corner) { return ((corner>-1) && (corner<3)) ? mNormalID[corner] : -1; }
///<summary> Setter for the normal used in a particular corner of the face </summary>
///<param name="corner"> The (zero-based) index of the corner of the face </param>
///<param name="norm"> The index of the normal (in the owner MeshNormalSpec's normal array).</param>
void SetNormalID (int corner, int norm) { if ((corner>-1) && (corner<3)) mNormalID[corner] = norm; }
int *GetNormalIDArray () { return mNormalID; }
bool GetSpecified (int corner) { return ((corner>-1) && (corner<3) && (mSpecified & (1<<corner))) ? true : false; }
DllExport void SetSpecified (int corner, bool value=true);
DllExport void SpecifyNormalID (int corner, int norm);
void SpecifyAll (bool value=true) { mSpecified = value ? 7 : 0; }
DllExport void Flip (); // Reverses order of verts. 0 remains start.
DllExport MeshNormalFace & operator= (const MeshNormalFace & from);
DllExport void MyDebugPrint (bool printAll=false);
DllExport IOResult Save (ISave *isave);
DllExport IOResult Load (ILoad *iload);
};
// Class MeshNormalSpec flags:
#define MESH_NORMAL_NORMALS_BUILT 0x01
#define MESH_NORMAL_NORMALS_COMPUTED 0x02
#define MESH_NORMAL_DISPLAY_HANDLES 0x04
#define MESH_NORMAL_FACE_ANGLES 0x08 // Used face angles last time we computed normals
#define MESH_NORMAL_MODIFIER_SUPPORT 0x20 // When modifying mesh, indicates whether the current modifier supports these Normals.
// Default length for normal display
#define MESH_NORMAL_LENGTH_DEFAULT 10.0f
class MeshNormalSpec : public IPipelineClient {
private:
int mNumNormalAlloc, mNumFaceAlloc;
int mNumNormals, mNumFaces;
MeshNormalFace *mpFace;
Point3 *mpNormal;
BitArray mNormalExplicit; // Indicates whether mpNormal[i] is explicit or computed from face normals.
// Display and selection data:
BitArray mNormalSel;
float mDisplayLength;
DWORD mFlags;
// We also maintain a pointer to the parent Mesh
// (NOTE that the Mesh MUST keep this pointer updated at all times!)
Mesh *mpParent;
public:
MeshNormalSpec () : mpFace(NULL), mpNormal(NULL), mNumNormalAlloc(0),
mNumFaceAlloc(0), mNumNormals(0), mNumFaces(0), mpParent(NULL), mFlags(0),
mDisplayLength(MESH_NORMAL_LENGTH_DEFAULT) { }
~MeshNormalSpec () { ClearAndFree (); }
// Flag Accessors:
void SetFlag (DWORD fl, bool val=true) { if (val) mFlags |= fl; else mFlags &= ~fl; }
void ClearFlag (DWORD fl) { mFlags &= ~fl; }
bool GetFlag (DWORD fl) const { return (mFlags & fl) ? true : false; }
// Initialization, allocation:
DllExport void Initialize (); // Initializes all data members - do not use if already allocated!
DllExport bool NAlloc (int num, bool keep=TRUE);
DllExport void NShrink (); // shrinks allocation down to actual number of normals.
DllExport bool FAlloc (int num, bool keep=TRUE);
DllExport void FShrink ();
DllExport void Clear (); // Deletes everything.
DllExport void ClearAndFree (); // Deletes everything, frees all memory
// Data access:
// Lowest level:
int GetNumFaces () const { return mNumFaces; }
DllExport bool SetNumFaces (int numFaces);
int GetNumNormals () const { return mNumNormals; }
DllExport bool SetNumNormals (int numNormals);
Point3 & Normal (int normID) const { return mpNormal[normID]; }
Point3 * GetNormalArray () const { return mpNormal; }
bool GetNormalExplicit (int normID) const { return mNormalExplicit[normID] ? true : false; }
void SetNormalExplicit (int normID, bool value) { mNormalExplicit.Set (normID, value); }
void SetAllExplicit (bool value=true) { if (value) mNormalExplicit.SetAll(); else mNormalExplicit.ClearAll (); }
MeshNormalFace & Face(int faceID) const { return mpFace[faceID]; }
MeshNormalFace * GetFaceArray () const { return mpFace; }
void SetParent (Mesh *pMesh) { mpParent = pMesh; }
// Data access - higher level:
DllExport Point3 & GetNormal (int face, int corner);
DllExport void SetNormal (int face, int corner, Point3 & normal);
DllExport int GetNormalIndex (int face, int corner);
DllExport void SetNormalIndex (int face, int corner, int normalIndex);
DllExport int NewNormal (Point3 normal, bool explic=true);
DllExport void SetSelection (BitArray & newSelection);
BitArray & GetSelection() { return mNormalSel; }
void SetDisplayLength (float displayLength) { mDisplayLength = displayLength; }
float GetDisplayLength () { return mDisplayLength; }
// Display and hit testing - note that these require an accurate mpParent pointer.
DllExport void Display (GraphicsWindow *gw, bool showSel);
DllExport bool HitTest (GraphicsWindow *gw, HitRegion *hr, DWORD flags, SubObjHitList& hitList);
DllExport Box3 GetBoundingBox (Matrix3 *tm=NULL, bool selectedOnly=false);
// This method dumps all unspecified normals. Best to use only from within CheckNormals.
DllExport void ClearNormals ();
// Fills in the mpSpecNormal data by building all the unspecified normals,
// and computing non-explicit ones.
// Does nothing if normal faces not allocated yet!
// Requires an accurate mpParent pointer.
DllExport void BuildNormals ();
// This method just recomputes the directions of non-explicit normals,
// without rebuilding the normal list.
// Requires an accurate mpParent pointer.
DllExport void ComputeNormals ();
// This checks our flags and calls BuildNormals, ComputeNormals as needed.
// Requires an accurate mpParent pointer.
DllExport void CheckNormals ();
// operators and debug printing
DllExport MeshNormalSpec & operator= (const MeshNormalSpec & from);
DllExport void CopySpecified (const MeshNormalSpec & from); // Like operator=, but omits unspecified.
DllExport MeshNormalSpec & operator+= (const MeshNormalSpec & from);
DllExport void MyDebugPrint (bool printAll=false);
DllExport bool CheckAllData (int numParentFaces);
DllExport IOResult Save (ISave *isave);
DllExport IOResult Load (ILoad *iload);
// From BaseInterface:
Interface_ID GetID() {return MESH_NORMAL_SPEC_INTERFACE;}
DllExport void DeleteInterface();
DllExport BaseInterface* GetInterface(Interface_ID id);
DllExport BaseInterface* CloneInterface(void* remapDir = NULL);
// --- IPipelineClient methods
DllExport void ShallowCopy( IPipelineClient* from, ULONG_PTR channels );
DllExport void DeepCopy( IPipelineClient* from, ULONG_PTR channels );
DllExport void NewAndCopyChannels( ULONG_PTR channels );
DllExport void FreeChannels( ULONG_PTR channels, int zeroOthers = 1 );
DllExport void ZeroChannels( ULONG_PTR channels );
DllExport void AppendAllChannels( IPipelineClient* from );
// Actual operations:
DllExport bool Transform (Matrix3 & xfm, BOOL useSel=false, BitArray *normalSelection=NULL);
DllExport bool Translate (Point3 & translate, BOOL useSel=true, BitArray *normalSelection=NULL);
DllExport bool BreakNormals (BOOL useSel=true, BitArray *normalSelection=NULL, BOOL toAverage=false);
// Requires an accurate mpParent pointer:
DllExport bool UnifyNormals (BOOL useSel=true, BitArray *normalSelection=NULL, BOOL toAverage=false);
DllExport bool AverageNormals (BOOL useThresh=false, float threshold=0.0f, BOOL useSel=true, BitArray *normalSelection=NULL);
DllExport bool SpecifyNormals (BOOL useSel=true, BitArray *normalSelection=NULL);
DllExport bool MakeNormalsExplicit (BOOL useSel=true, BitArray *normalSelection=NULL, bool value=true);
DllExport bool ResetNormals (BOOL useSel=true, BitArray *normalSelection=NULL);
};
#endif //__MESH_NORMALS_H_

View File

@ -0,0 +1,231 @@
/**********************************************************************
*<
FILE: ObjectWrapper.h
DESCRIPTION: Geometry object abstraction layer
CREATED BY: Michaelson Britt
HISTORY: Created Friday, April 18, 2003
*> Copyright (c) 2003, All Rights Reserved.
**********************************************************************/
#ifndef __OBJECTWRAPPER__H
#define __OBJECTWRAPPER__H
#include "triobj.h"
#include "polyobj.h"
#include "meshadj.h"
#include "patchobj.h"
class HitListWrapper;
typedef Tab<float> FloatTab;
//-----------------------------------------------------------------------------
// struct GenFace
// Represents a "face" for any type of object
typedef struct GenFace_tag {
unsigned short numVerts;
DWORD* verts;
} GenFace;
typedef struct GenEdge_tag {
DWORD f[2];
DWORD v[2];
} GenEdge;
typedef struct GenSoftSelData_tag {
BOOL useSoftSel; //whether soft selection is active
BOOL useEdgeDist;
int edgeIts;
BOOL ignoreBack;
float falloff, pinch, bubble;
//float* weights; //the soft selection values
CoreExport GenSoftSelData_tag(); //a struct with a constructor :)
} GenSoftSelData;
BOOL operator==(GenSoftSelData& a, GenSoftSelData& b);
//-----------------------------------------------------------------------------
// class ObjectWrapper
class ObjectWrapper {
protected:
TimeValue t;
//FIXME: change the objectWrapper to store both the mesh and the object
union {
Mesh* mesh;
MNMesh* poly;
PatchMesh* patch;
};
union {
MeshTempData* meshTempData;
MNTempData* polyTempData;
};
BOOL isCopy;
Point3* verts;
GenFace* faces;
GenEdge* edges;
GeomObject* collapsedObj;
BitArray faceSel, vertSel;
GenSoftSelData softSelData;
int invalidMask;
public:
enum { empty=0, triObject, polyObject, patchObject } type;
enum { noneEnable=0, triEnable=1, polyEnable=2, patchEnable=4, allEnable=0x7 };
CoreExport ObjectWrapper();
CoreExport ~ObjectWrapper() {Release();}
CoreExport void Zero();
// The 'enable' parameter will determine the valid object types for ObjectWrapper.
// If the object is not valid (or not supported), it will be converted to the 'nativeType'
CoreExport BOOL Init( TimeValue t, ObjectState& os, BOOL copy=FALSE, int enable=allEnable, int nativeType=polyObject );
CoreExport void Release(); //frees the collapsed object, if any
CoreExport BOOL IsEmpty() {return type==empty;}
CoreExport int Type() {return type;}
CoreExport Mesh* GetTriMesh() {return type==triObject? mesh:NULL;}
CoreExport MNMesh* GetPolyMesh() {return type==polyObject? poly:NULL;}
CoreExport PatchMesh* GetPatchMesh() {return type==patchObject? patch:NULL;}
enum { iv_none=0x000, iv_verts=0x001, iv_faces=0x002, iv_edges=0x004 };
CoreExport void Invalidate( int iInvalid );
CoreExport void InvalidateGeomCache();
//-- Geom vert support
CoreExport int NumVerts(); //geom verts
CoreExport int NumFaces(); //geom faces
CoreExport int NumEdges(); //geom edges
CoreExport Point3* Verts(); //geom verts
CoreExport GenFace* Faces(); //geom faces
CoreExport GenEdge* Edges(); //geom edges
CoreExport Point3* GetVert( int index );
CoreExport void SetVert( int index, Point3 &p );
CoreExport void SetNumVerts( int num );
CoreExport GenFace GetFace( int index );
CoreExport void SetFace( int index, GenFace &face );
CoreExport void SetNumFaces( int num );
CoreExport GenEdge GetEdge( int index );
CoreExport int NumFaceEdges( int faceIndex );
CoreExport int GetFaceEdgeIndex( int faceIndex, int edgeIndex );
CoreExport void GetVertexSpace( int index, Matrix3 & tm );
CoreExport Point3* GetVertexNormal( int index );
//-- Map channel support
CoreExport BOOL GetChannelSupport( int mapChannel );
CoreExport void SetChannelSupport( int mapChannel, BOOL b );
CoreExport int NumMapVerts( int channel );
CoreExport void SetNumMapVerts( int channel, int num );
CoreExport Point3* GetMapVert( int channel, int index );
CoreExport void SetMapVert( int channel, int index, Point3 &p );
CoreExport GenFace GetMapFace( int channel, int index );
CoreExport void SetMapFace( int channel, int index, GenFace &face );
//-- Material ID support
CoreExport MtlID GetMtlID( int index ); // face index
CoreExport void SetMtlID( int index, MtlID mtlID ); // face index
//-- Smoothing Group support
CoreExport DWORD GetSmoothingGroup( int index ); // face index
CoreExport void SetSmoothingGroup( int index, DWORD smGrp ); // face index
//-- Sub-object selection support
enum {SEL_OBJECT, SEL_VERT, SEL_FACE, SEL_ELEM}; //selection enum values
CoreExport int GetSelLevel(); //returns a selection enum value
CoreExport void SetSelLevel(int selLevel); //selLevel is a selection enum value
CoreExport BitArray& GetVertSel();
CoreExport void SetVertSel( BitArray& );
CoreExport BitArray& GetFaceSel();
CoreExport void SetFaceSel( BitArray& sel );
CoreExport BitArray& GetElemSel();
CoreExport void SetElemSel( BitArray& sel );
CoreExport BitArray* GetSel( int selLevel ); //gets the selection of the given type
CoreExport void SetSel( int selLevel, BitArray& sel ); //sets the selection of the given type
CoreExport void FaceToElemSel( BitArray& elemSel, BitArray& faceSel ); //convert face to elem selection
//-- Selection methods
CoreExport void GrowSelection( int selLevel, BitArray& newSel );
CoreExport void ShrinkSelection( int selLevel, BitArray& newSel );
//-- Soft selection support
CoreExport void GetSoftSel( GenSoftSelData& softSelData );
CoreExport void SetSoftSel( GenSoftSelData& softSelData );
CoreExport void UpdateSoftSel();
CoreExport float* SoftSelWeights();
CoreExport Point3 SoftSelColor( float f );
//-- Hit testing and ray intersection
enum { SUBHIT_IGNOREBACKFACING=(1<<5) }; //other SUBHIT_... values defined in Mesh.h are also supported
CoreExport BOOL SubObjectHitTest(
int selLevel, GraphicsWindow* gw, Material* ma, HitRegion *hr,
DWORD flags, HitListWrapper& hitList, int numMat=1, Matrix3 *mat = NULL );
CoreExport int IntersectRay( Ray& ray, float& intersectAt, Point3& norm, int& fi, FloatTab& bary );
CoreExport void Render(GraphicsWindow *gw, Material *ma, RECT *rp, int compFlags, int numMat = 1);
//-- Enum conversion
CoreExport int SelLevel( int selLevel ); //generic enum to object-specific enum //FIXME: should be private?
CoreExport int HitLevel( int selLevel ); //generic enum to object-specific hit level enum //FIXME: should be private?
};
//-----------------------------------------------------------------------------
// class HitListWrapper
class HitListWrapper {
protected:
friend class ObjectWrapper;
union {
SubObjHitList* meshHitList;
SubObjHitList* polyHitList;
SubPatchHitList* patchHitList;
};
union {
MeshSubHitRec* curMeshHitRec;
MeshSubHitRec* curPolyHitRec;
PatchSubHitRec* curPatchHitRec;
};
public:
enum { empty=0, triObject, polyObject, patchObject } type;
CoreExport HitListWrapper() {type=empty;}
CoreExport ~HitListWrapper();
CoreExport bool GoToFirst();
CoreExport bool GoToNext();
CoreExport DWORD GetDist();
CoreExport int GetIndex();
CoreExport void Init( int type );
CoreExport void Release();
};
#endif //__OBJECTWRAPPER__H

View File

@ -0,0 +1,66 @@
/**********************************************************************
*<
FILE: CreatedChannelLinker.h
DESCRIPTION: Class definitions for CreatedChannelLinker
CreatedChannelLinker keeps track of all channels created for
a specific particle container. If an action creates a channel
only under certain condition (for example, if the channel
doesn't exists) then it's the action responsibility to
initialized channel value for all new particles. Therefore
the action should keep track of all channels created by the
action. The class makes this task easier.
CREATED BY: Oleg Bayborodin
HISTORY: created 03-11-2002
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _CREATEDCHANNELLINKER_H
#define _CREATEDCHANNELLINKER_H
#include "max.h"
#include "PFExport.h"
namespace PF {
class CreatedChannelLinker {
public:
PFExport CreatedChannelLinker();
PFExport ~CreatedChannelLinker();
// to indicated that the channel was created in this container
PFExport bool RegisterCreatedChannel(IObject* pCont, Interface_ID channelID);
// to unregister all created channels in the container
PFExport void Release(IObject* pCont);
// verify if the channel was created for the container
PFExport bool IsCreatedChannel(IObject* pCont, Interface_ID channelID) const;
private:
// const access to class members
const Tab<IObject*>& particleContainers() const { return m_particleContainers; }
IObject* particleContainer(int index) const { return m_particleContainers[index]; }
const Tab<Interface_ID>& IDs() const { return m_IDs; }
Interface_ID ID(int index) const { return m_IDs[index]; }
// access to class members
Tab<IObject*>& _particleContainers() { return m_particleContainers; }
IObject*& _particleContainer(int index) { return m_particleContainers[index]; }
Tab<Interface_ID>& _IDs() { return m_IDs; }
Interface_ID& _ID(int index) { return m_IDs[index]; }
protected:
Tab<IObject*> m_particleContainers;
Tab<Interface_ID> m_IDs;
};
} // end of namespace PF
#endif // _CREATEDCHANNELLINKER_H_

View File

@ -0,0 +1,190 @@
/*! \file IChannelContainer.h
\brief An interface to manage channels in ParticleContainer.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-10-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _ICHANNELCONTAINER_H_
#define _ICHANNELCONTAINER_H_
#include "Max.h"
// interface ID
#define CHANNELCONTAINER_INTERFACE Interface_ID(0x74f93c00, 0x1eb34600)
#define GetChannelContainerInterface(obj) ((IChannelContainer*)obj->GetInterface(CHANNELCONTAINER_INTERFACE))
class IChannelContainer : public FPMixinInterface
{
public:
// function IDs
enum {
// kNumChannels,
// kGetChannel,
kGetPublicChannel,
kGetPrivateChannel,
kAddChannel
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
// FN_0(kNumChannels, TYPE_INT, NumChannels);
// FN_1(kGetChannel, TYPE_IOBJECT, GetChannel, TYPE_INT);
FN_2(kGetPublicChannel, TYPE_IOBJECT, GetPublicChannel, TYPE_INT, TYPE_INT);
FN_4(kGetPrivateChannel, TYPE_IOBJECT, GetPrivateChannel, TYPE_INT, TYPE_INT, TYPE_OBJECT, TYPE_INODE);
FN_1(kAddChannel, TYPE_bool, AddChannel, TYPE_IOBJECT);
END_FUNCTION_MAP
/** @defgroup IChannelContainer IChannelContainer.h
* @{
*/
/*! \fn virtual Class_ID GetClassID() = 0;
* \brief Returns the unique ID for the particle container class. ID is used for constructing the container when loading since the particle container class is not inherited from class Animatable
*/
virtual Class_ID GetClassID() = 0;
/*! \fn virtual int NumChannels() const = 0;
* \brief Returns number of channels in the container
*/
virtual int NumChannels() const = 0;
/*! \fn virtual IObject*& GetChannel(int i) = 0;
* \brief Returns i-th channel in the container
*/
virtual IObject*& GetChannel(int i) = 0;
/*! \fn virtual IObject* GetChannel(Interface_ID id, Object* privateOwner=NULL, INode* creatorAction=NULL) = 0;
* \brief Returns a channel with the given interface id. If privateOwner is NULL, then the channel is public. If privateOwner is specified, then the channel is private with the given private owner.
*/
virtual IObject* GetChannel(Interface_ID id, Object* privateOwner=NULL, INode* creatorAction=NULL) = 0;
// FnPub alternatives for the method above
/*! \fn IObject* GetPublicChannel(int id_PartA, int id_PartB)
* \brief FnPub alternative for the method virtual IObject* GetChannel.
* \brief Essentially takes in the two (2) components that make up the full Interface_ID CHANNELCONTAINER_INTERFACE
* \param id_PartA: Corresponds to 0x74f93c00. Look at #define CHANNELCONTAINER_INTERFACE Interface_ID(0x74f93c00, 0x1eb34600)
* \param id_partB: Corresponds to 0x1eb34600. Look at #define CHANNELCONTAINER_INTERFACE Interface_ID(0x74f93c00, 0x1eb34600)
*/
IObject* GetPublicChannel(int id_PartA, int id_PartB)
{ return GetChannel( Interface_ID(id_PartA, id_PartB), NULL); }
/*! \fn IObject* GetPrivateChannel(int id_PartA, int id_PartB, Object* privateOwner, INode* creatorAction)
* \brief FnPub alternative for method virtual IObject* GetChannel.
*/
IObject* GetPrivateChannel(int id_PartA, int id_PartB, Object* privateOwner, INode* creatorAction)
{ return GetChannel( Interface_ID(id_PartA, id_PartB), privateOwner, creatorAction); }
/*! \fn virtual bool AddChannel(IObject* channel) = 0;
* \brief Returns true if the channel has been added. The channel may be rejected if there are duplicate interfaces in the added channel and in the container. The ParticleChannelReadWrite and ParticleChannelAmount interfaces don't count since every channel has them.
*/
virtual bool AddChannel(IObject* channel) = 0;
/*! \fn virtual IObject* EnsureChannel(Interface_ID& iChanID, Class_ID& channelClassID, bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID, bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL, bool* initChannel=NULL) = 0;
* \brief Returns a channel object if a channel with the given interface id is in the container. If such channel
doesn't exist, that container makes an attempt to create and add a channel
for the interface according to the specifications. The method is not for FnPub intentionally.
\param iChanID: interface id of channel to be present in the container\n
\param channelClassID: if interface is not present then create particle channel with the classID\n
\param isWrapper: if true then the created particle channel is wrapper\n
\param wrappingReadID & wrappingWriteID: read & write ID for wrapping the particle channel\n
\param isTransferable: if true then the channel is transferable (contrary to temporary)\n
\param creatorAction: the parameter is used to record an action that created the channel\n
this record can be used later on to identify if the action needs to initialize the
channel values for new particles\n
\param privateOwner: the parameter is used to set a private owner of the channel. Only the action
with the same object pointer may access this channel\n
\param initChannel: if the channel was created by the same action node then it's responsibility of
the action to initialize values\n
*/
virtual IObject* EnsureChannel(Interface_ID& iChanID, Class_ID& channelClassID,
bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID,
bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL,
bool* initChannel=NULL) = 0;
/*! \fn virtual BaseInterface* EnsureInterface(Interface_ID& iChanID, Class_ID& channelClassID, bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID, bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL, bool* initChannel=NULL) = 0;
* \brief Returns an interface if the interface with the given interface id is in the container.
If such interface doesn't exist, that container makes an attempt to
create and add a channel for the interface according to the specifications.
The method is not for FnPub intentionally.
\param iChanID: interface id of channel to be present in the container\n
\param channelClassID: if interface is not present then create particle channel with the classID\n
\param isWrapper: if true then the created particle channel is wrapper\n
\param wrappingReadID & wrappingWriteID: read & write ID for wrapping the particle channel\n
\param isTransferable: if true then the channel is transferable (contrary to temporary)\n
\param creatorAction: the parameter is used to record an action that created the channel\n
this record can be used later on to identify if the action needs to initialize the
channel values for new particles\n
\param privateOwner: the parameter is used to set a private owner of the channel. Only the action
with the same object pointer may access this channel\n
\param initChannel: if the channel was created by the same action node then it's responsibility of
the action to initialize values\n
*/
virtual BaseInterface* EnsureInterface(Interface_ID& iChanID, Class_ID& channelClassID,
bool isWrapper, Interface_ID& wrappingReadID, Interface_ID& wrappingWriteID,
bool isTransferable=TRUE, INode* creatorAction=NULL, Object* privateOwner=NULL,
bool* initChannel=NULL) = 0;
/*! \fn virtual BaseInterface* GetPrivateInterface(Interface_ID id, Object* privateOwner) = 0;
* \brief Returns an interface of a channel with the given interface id and private owner.
\param iChanID: interface id of channel to be present in the container. \n
\param privateOwner: the parameter is used to identify a private owner of the channel.\n
*/
virtual BaseInterface* GetPrivateInterface(Interface_ID id, Object* privateOwner) = 0;
/*! \fn virtual int RemoveNonTransferableChannels(INode* nextParticleGroup=NULL) = 0;
* \brief Returns an interface of a channel with the given interface id and private owner parameters:\n
iChanID: interface id of channel to be present in the container\n
privateOwner: the parameter is used to identify a private owner of the channel.
*/
virtual int RemoveNonTransferableChannels(INode* nextParticleGroup=NULL) = 0;
/*! \fn virtual IObject* Clone() = 0;
* \brief Makes a clone copy of the whole container (all channels), returns new container
*/
virtual IObject* Clone() = 0;
/*! \fn virtual bool Copy(IObject* container) = 0;
* \brief Makes a copy from the other container, returns true if successful
*/
virtual bool Copy(IObject* container) = 0;
/*! \fn virtual IOResult Save(ISave* isave) const = 0;
* \brief Saves content of the channel to file
*/
virtual IOResult Save(ISave* isave) const = 0;
/*! \fn IOResult Load(ILoad* iload) = 0;
* \brief Loads content of the channel from file.
*/
virtual IOResult Load(ILoad* iload) = 0;
/*! \fn int MemoryUsed() const = 0;
* \brief Returns amount of memory used (in bytes) by the channel container to store the information. This is a total sum of the memory used by all channels and the data from the container itself.
*/
virtual int MemoryUsed() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(CHANNELCONTAINER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(CHANNELCONTAINER_INTERFACE); }
/*@}*/
};
#endif // _ICHANNELCONTAINER_H_

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,297 @@
/*! \file IPFAction.h
\brief Action-generic interface IPFAction.
This is a part of every PF Operator & Test.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTION_H_
#define _IPFACTION_H_
#include "ParticleChannelMask.h"
#include "PFExport.h"
#include "Max.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFACTION_INTERFACE Interface_ID(0x74f93d00, 0x1eb34500)
#define GetPFActionInterface(obj) ((IPFAction*)((GetPFObject(obj))->GetInterface(PFACTION_INTERFACE)))
class IPFAction : public FPMixinInterface
{
public:
// function IDs
enum { kInit,
kRelease,
kChannelsUsed, // reserved for future use
kActivityInterval,
kIsFertile,
kIsNonExecutable,
kSupportRand,
kGetRand,
kSetRand,
kNewRand,
kIsMaterialHolder,
kGetMaterial,
kSetMaterial,
kSupportScriptWiring,
kGetUseScriptWiring,
kSetUseScriptWiring
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_5(kInit, TYPE_bool, Init, TYPE_IOBJECT, TYPE_OBJECT, TYPE_INODE, TYPE_OBJECT_TAB_BR, TYPE_INODE_TAB_BR);
FN_1(kRelease, TYPE_bool, Release, TYPE_IOBJECT);
VFN_2(kChannelsUsed, ChannelsUsed, TYPE_INTERVAL_BR, TYPE_FPVALUE); // reserved for future use
FN_0(kActivityInterval, TYPE_INTERVAL_BV, ActivityInterval);
FN_0(kIsFertile, TYPE_bool, IsFertile);
FN_0(kIsNonExecutable, TYPE_bool, IsNonExecutable);
FN_0(kSupportRand, TYPE_bool, SupportRand);
FN_0(kGetRand, TYPE_INT, GetRand);
VFN_1(kSetRand, SetRand, TYPE_INT);
FN_0(kNewRand, TYPE_INT, NewRand);
FN_0(kIsMaterialHolder, TYPE_bool, IsMaterialHolder);
FN_0(kGetMaterial, TYPE_MTL, GetMaterial);
FN_1(kSetMaterial, TYPE_bool, SetMaterial, TYPE_MTL);
FN_0(kSupportScriptWiring, TYPE_bool, SupportScriptWiring);
FN_0(kGetUseScriptWiring, TYPE_bool, GetUseScriptWiring);
VFN_1(kSetUseScriptWiring, SetUseScriptWiring, TYPE_bool);
END_FUNCTION_MAP
/** @defgroup IPFAction IPFAction.h
* @{
*/
/*! \fn virtual bool Init(IObject* pCont, Object* pSystem, INode* node, Tab<Object*>& actions, Tab<INode*>& actionNodes) = 0;
* \brief Returns true if the operation has been proceeded successfully. The method is called when the ActionList
is established the first time, when there is a first particle that enters the ActionList and there is a need to proceed particles.
/param pCont: particle container with particle data
/param pSystem: the particle system that generates the particle stream;
the same operator may get calls from different particle systems; if the
result varies according to the particle system that generates
particles, then this parameter is useful.
/param pNode: INode of the particle system that generates the particles.
/param actions: Tab<Object*> of Actions in the current ActionList.
The stack will be used to proceed particles.
The stack is mutable: an Action may change the stack (to remove
or add some Actions) to fine-tune the order of execution or
add some extra actions. The next parameter should sync with
the mutation.
/param actionNodes: Tab<INode*> of action nodes.
*/
virtual bool Init(IObject* pCont, Object* pSystem, INode* node, Tab<Object*>& actions, Tab<INode*>& actionNodes) = 0;
/*! \fn virtual bool Release(IObject* pCont) = 0;
* \brief See Init().
*/
virtual bool Release(IObject* pCont) = 0;
/*! \fn virtual const ParticleChannelMask& ChannelsUsed(const Interval& time) const = 0;
* \brief See Init().
*/
virtual const ParticleChannelMask& ChannelsUsed(const Interval& time) const = 0;
/*! \fn PFExport void ChannelsUsed(const Interval& time, FPValue* channels) const;
* \brief "Function publishing" alternative for ChannelsUsed method. Reserved for future use.
*/
PFExport void ChannelsUsed(const Interval& time, FPValue* channels) const;
/*! \fn virtual const Interval ActivityInterval() const = 0;
* \brief Casting the FPValue->ptr parameter to Tab<Interface_ID>* as in PFExport void ChannelsUsed(...);
an Action may have a time interval when the Action is active. Outside this interval
the Action does nothing, therefore there is no need to proceed particles outside
the activity interval.
*/
virtual const Interval ActivityInterval() const = 0;
/*! \fn virtual bool IsFertile() const { return false; }
* \brief Birth Action is a special type of actions since it can create particles from scratch.
All other type of actions proceed existing particles. Only Action that can create
absolutely new particles (if number of particles in the container is zero) should
override this method returning true.
*/
virtual bool IsFertile() const { return false; }
/*! \fn virtual bool IsNonExecutable() const { return false; }
* \brief There is a special case of non-executable actions. They are present in the action
schematics but don't affect the particle behavior. Example: Comments operator
*/
virtual bool IsNonExecutable() const { return false; }
/*! \fn virtual bool Has3dIcon() const { return false; }
* \brief An action may have 3d icon representation in viewport.
The 3d icon can be used as a reference for some of the action parameters.
*/
virtual bool Has3dIcon() const { return false; }
/*! \fn virtual int IsColorCoordinated() const { return -1; }
* \brief If an operator/test has a 3D icon the icon can be automatically color matched
to the color of the display operator in the same event. For the automatic
color match the operator/test should return 1 in this method.
If returns 0 then the action gets the default color for operator/test.
If returns -1 then the action doesn't need any color coordination from Particle Flow.
*/
virtual int IsColorCoordinated() const { return -1; }
/*! \fn virtual bool SupportRand() const = 0;
* \brief An Action may carry some chaos/unpredictibility in its processing. This
method supports chaos randomness.
*/
virtual bool SupportRand() const = 0;
/*! \fn virtual int GetRand() = 0;
* \brief For chaos/unpredictibility action, gets rand value.
*/
virtual int GetRand() = 0;
/*! \fn virtual void SetRand(int seed) = 0;
* \brief For chaos/unpredictibility action, sets rand value.
*/
virtual void SetRand(int seed) = 0;
/*! \fn PFExport int NewRand();
* \brief For chaos/unpredictibility action, sets and returns new rand value.
*/
PFExport int NewRand();
/*! \fn PFExport static int NewRand(IParamBlock2* pblock, int randomSeedParamID);
* \brief Alternative for PFExport int NewRand(); but not in FnPub interface
*/
PFExport static int NewRand(IParamBlock2* pblock, int randomSeedParamID);
/*! \fn virtual bool IsMaterialHolder() const { return false; }
* \brief If the Action may potentically change particle material, then return true
*/
virtual bool IsMaterialHolder() const { return false; }
/*! \fn virtual Mtl* GetMaterial() { return NULL; }
* \brief Returns a material for particles
*/
virtual Mtl* GetMaterial() { return NULL; }
/*! \fn virtual bool SetMaterial(Mtl* mtl) { return false; }
* \brief Return true if material was set successfully
*/
virtual bool SetMaterial(Mtl* mtl) { return false; }
/*! \fn virtual bool SupportScriptWiring() const { return false; }
* \brief An Action may have parameters controlled by script channels.
How the script wiring is set up is controlled by a separate rollup
with script-wiring pblock. The rollup is visible if "Use Script Wiring"
option in the right-click menu is set to ON. The option is visible
only for actions that support script wiring.
*/
virtual bool SupportScriptWiring() const { return false; }
/*! \fn virtual bool GetUseScriptWiring() const { return false; }
* \brief Supports script wiring. See SupportScriptWiring().
*/
virtual bool GetUseScriptWiring() const { return false; }
/*! \fn virtual void SetUseScriptWiring(bool useScriptWiring) { ; }
* \brief Supports script wiring. See SupportScriptWiring().
*/
virtual void SetUseScriptWiring(bool useScriptWiring) { ; }
/*! \fn virtual bool IsEmitterTMDependent() const { return false; }
* \brief An Action may or may not be dependent on the particle system emitter.
When the emitter is invalidated, a particle group has to decide if it needs
to invalidate itself. To make the decision, the group checks all the actions
if any of them are dependent on the emitter change. There are two categories of
dependency: the transformation matrix of the emitter (TM), and object parameters
of the emitter (props). This method checks the TM category.
*/
virtual bool IsEmitterTMDependent() const { return false; }
/*! \fn virtual bool IsEmitterPropDependent() const { return false; }
* \brief Checks the props category for dependency. See IsEmitterTMDependent().
*/
virtual bool IsEmitterPropDependent() const { return false; }
/*! \fn virtual IObject* GetCurrentState(IObject* pContainer) { return NULL; }
* \brief Returns action state (see IPFActionState.h for details).
You have to delete the IObject by DeleteIObject method
when the state is no longer needed.
*/
virtual IObject* GetCurrentState(IObject* pContainer) { return NULL; }
/*! \fn virtual void SetCurrentState(IObject* actionState, IObject* pContainer) { ; }
* \brief Sets the state of the action to the given state
*/
virtual void SetCurrentState(IObject* actionState, IObject* pContainer) { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTION_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTION_INTERFACE); }
};
// Codes for ClassDesc::Execute(...) method
// The Execute method is used to extract action description from the ClassDesc
enum { kPF_GetActionDescription = 781,
// defines an action name to be shown in the action depot area in PView
// if the method is not supported then the class name of the action is used
kPF_GetActionName,
// defines if the action is shown in ParticleView Action Depot window
// if the execute is not implemented then it is assumed that the action is
// public
kPF_PViewPublic,
// defines a category for the action to be placed in the Action Depot
// the call is reserved for future use. If the execute is not implemented
// then the category is assigned according to the action type (operator or test)
kPF_PViewCategory,
// defines if the action is "fertile". It means it is able to generate particles
// from nothing. If the execute is not implemented then it is assumed
// that the action is not "fertile".
kPF_IsFertile,
// defines if the action is "non-executable". Non-executable action doesn't
// affect particle behavior. The action is present in the action schematics
// but its presence doesn't change how the particles are shown or rendered.
// If the execute is not implemented then it is assumed that the action is
// executable.
kPF_IsNonExecutable,
// returns bitmap with icon for the depot window of ParticleView
// if the execute is not implemented then a default icon is used
kPF_PViewDepotIcon
};
/*! \fn inline IPFAction* PFActionInterface(Object* obj)
* \brief
*/
inline IPFAction* PFActionInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFActionInterface(obj));
};
/*! \fn inline IPFAction* PFActionInterface(INode* node)
* \brief
*/
inline IPFAction* PFActionInterface(INode* node) {
return ((node == NULL) ? NULL : PFActionInterface(node->GetObjectRef()));
};
/*! \fn PFExport int IsPFActionActive(INode* actionNode);
* \brief An action may be turned ON, OFF, True and False in Particle View.
An operator has two states: ON (1) and OFF (0).
A test has three states: ON (1), False (0) and True (-1).
The method returns the state of the action.
*/
PFExport int IsPFActionActive(INode* actionNode);
#endif // _IPFACTION_H_
/*@}*/

View File

@ -0,0 +1,257 @@
/*! \file IPFActionList.h
\brief Interface for PF ActionList
An ActionList is a list of actions combined together
to control properties of group of particles
PF System also implements this interface to keep
track of all global Actions for the particle system.
Part of public SDK
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-15-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONLIST_H_
#define _IPFACTIONLIST_H_
#include "Max.h"
#include "PFExport.h"
#include "IPFAction.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFACTIONLIST_INTERFACE Interface_ID(0x74f93d04, 0x1eb34500)
#define GetPFActionListInterface(obj) ((IPFActionList*)((GetPFObject(obj))->GetInterface(PFACTIONLIST_INTERFACE)))
class IPFActionList : public FPMixinInterface
{
public:
// function IDs
enum { kGetNumActions, kGetAction, kAppendAction,
kInsertAction, kRemoveAction, kHasAction,
kIsAction, kIsOperator, kIsTest,
kIsActivated, kActivate, kIsActionActive,
kActivateAction, kGetPViewLocation, kSetPViewLocation,
kGetPViewZOrder, kSetPViewZOrder, kGetListWidth,
kSetListWidth, kGetPViewRightBoundary,
kIsCollapsed, kCollapse, kExpand,
kHasUpStream, kGetSelected, kSetSelected,
kAcceptFertile
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0( kGetNumActions, TYPE_INT, NumActions );
FN_1( kGetAction, TYPE_INODE, GetAction, TYPE_INDEX);
FN_1( kAppendAction, TYPE_bool, AppendAction, TYPE_INODE);
FN_2( kInsertAction, TYPE_bool, InsertAction, TYPE_INODE, TYPE_INDEX);
FN_1( kRemoveAction, TYPE_bool, RemoveAction, TYPE_INDEX);
FN_2( kHasAction, TYPE_bool, HasAction, TYPE_INODE, TYPE_INDEX_BR);
FN_1( kIsAction, TYPE_bool, IsAction, TYPE_INODE);
FN_1( kIsOperator, TYPE_bool, IsOperator, TYPE_INODE);
FN_1( kIsTest, TYPE_bool, IsTest, TYPE_INODE);
FN_0( kIsActivated, TYPE_bool, IsActivated );
VFN_1( kActivate, Activate, TYPE_bool);
FN_1( kIsActionActive, TYPE_INT, IsActionActive, TYPE_INDEX);
VFN_2( kActivateAction, ActivateAction, TYPE_INDEX, TYPE_INT);
VFN_2( kGetPViewLocation, GetPViewLocation, TYPE_INT_BR, TYPE_INT_BR);
VFN_2( kSetPViewLocation, SetPViewLocation, TYPE_INT, TYPE_INT);
FN_0( kGetPViewZOrder, TYPE_INT, GetPViewZOrder );
VFN_1( kSetPViewZOrder, SetPViewZOrder, TYPE_INT);
FN_0( kGetListWidth, TYPE_INT, GetListWidth );
VFN_1( kSetListWidth, SetListWidth, TYPE_INT);
FN_0( kGetPViewRightBoundary, TYPE_INT, GetPViewRightBoundary );
FN_0( kIsCollapsed, TYPE_bool, IsCollapsed );
VFN_0( kCollapse, Collapse );
VFN_0( kExpand, Expand );
FN_0( kHasUpStream, TYPE_bool, HasUpStream );
FN_0( kGetSelected, TYPE_INT, GetSelected );
VFN_1( kSetSelected, SetSelected, TYPE_INT);
FN_0( kAcceptFertile, TYPE_bool, AcceptFertile );
END_FUNCTION_MAP
/** @defgroup IPFActionList IPFActionList.h
* @{
*/
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLIST_INTERFACE); }
* \brief Must implement GetDescByID method
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLIST_INTERFACE); }
//End of Function Publishing system code
//***********************************
/*! \fn virtual int NumActions() const = 0;
* \brief
*/
virtual int NumActions() const = 0;
/*! \fn virtual INode* GetAction(int index) const = 0;
* \brief
*/
virtual INode* GetAction(int index) const = 0;
/*! \fn virtual bool AppendAction(INode* action) = 0;
* \brief
*/
virtual bool AppendAction(INode* action) = 0;
/*! \fn virtual bool InsertAction(INode* action, int indexAt) = 0;
* \brief
*/
virtual bool InsertAction(INode* action, int indexAt) = 0;
/*! \fn virtual bool RemoveAction(int index) = 0;
* \brief
*/
virtual bool RemoveAction(int index) = 0;
/*! \fn virtual bool HasAction(INode* action, int& index) const = 0;
* \brief
*/
virtual bool HasAction(INode* action, int& index) const = 0;
/*! \fn PFExport static bool IsAction(INode* action);
* \brief
*/
PFExport static bool IsAction(INode* action);
/*! \fn PFExport static bool IsOperator(INode* action);
* \brief
*/
PFExport static bool IsOperator(INode* action);
/*! \fn PFExport static bool IsTest(INode* action);
* \brief
*/
PFExport static bool IsTest(INode* action);
/*! \fn virtual bool IsActivated() const = 0;
* \brief
*/
virtual bool IsActivated() const = 0;
/*! \fn virtual void Activate(bool active) = 0;
* \brief Activate/deactivate all the actions in the list
*/
virtual void Activate(bool active) = 0;
/*! \fn virtual int IsActionActive(int index) const = 0;
* \brief Activate/deactivate all the actions in the list. 1: active; 0: non-active for operators and "always false" for tests;
-1: "always true" for tests
*/
virtual int IsActionActive(int index) const = 0;
/*! \fn virtual void ActivateAction(int index, int active=1) = 0;
* \brief Activate/deactivate all the actions in the list
*/
virtual void ActivateAction(int index, int active=1) = 0;
// default spacing and location on Particle View
enum { kListWidth=180 }; // default actionList width
/*! \fn virtual void GetPViewLocation(int& x, int& y) = 0;
* \brief
*/
virtual void GetPViewLocation(int& x, int& y) = 0;
/*! \fn virtual void SetPViewLocation(int x, int y) { ; }
* \brief
*/
virtual void SetPViewLocation(int x, int y) { ; }
/*! \fn virtual int GetPViewZOrder() { return 0; }
* \brief
*/
virtual int GetPViewZOrder() { return 0; }
/*! \fn virtual void SetPViewZOrder(int z) { ; }
* \brief
*/
virtual void SetPViewZOrder(int z) { ; }
/*! \fn virtual int GetListWidth() { return kListWidth; }
* \brief
*/
virtual int GetListWidth() { return kListWidth; }
/*! \fn virtual void SetListWidth(int w) { ; }
* \brief
*/
virtual void SetListWidth(int w) { ; }
/*! \fn PFExport int GetPViewRightBoundary();
* \brief Returns x-coord of the right side of the action list
*/
PFExport int GetPViewRightBoundary();
/*! \fn virtual bool IsCollapsed() { return false; }
* \brief Action list may be shown in a "collapsed" state in ParticleView
*/
virtual bool IsCollapsed() { return false; }
/*! \fn virtual void Collapse() { ; }
* \brief Action list may be shown in a "collapsed" state in ParticleView
*/
virtual void Collapse() { ; }
/*! \fn virtual void Expand() { ; }
* \brief Action list may be shown in a "collapsed" state in ParticleView
*/
virtual void Expand() { ; }
/*! \fn virtual bool HasUpStream() { return false; }
* \brief Indicates if there are PFSystems or ActionLists that direct particle flow
in this action list. If returns false then the action list won't produce particles.
*/
virtual bool HasUpStream() { return false; }
/*! \fn virtual int GetSelected() const { return 0; }
* \brief ActionList has its own methods for selecting. Selected ActionList has a white boundary
in the ParticleView. If the corresponding particle system has Event-Based Selection ON,
the the corresponding particles are shown as selected.
*/
virtual int GetSelected() const { return 0; }
/*! \fn virtual void SetSelected(int onOff) { ; }
* \brief See virtual int GetSelected().
*/
virtual void SetSelected(int onOff) { ; }
/*! \fn virtual bool AcceptFertile() { return false; }
* \brief ActionList has some restrictions on whether it is able to add a "fertile" action.
ActionList may have only single "fertile" action in the list of actions.
Also, ActionList may have a "fertile" action only if no test uses this
actionList as a next event.
*/
virtual bool AcceptFertile() { return false; }
/*! \fn virtual void UpdateMaterial() { ; }
* \brief The method is used to initiate material update in the associated particle group.
*/
virtual void UpdateMaterial() { ; }
};
/*! \fn PFExport IPFActionList* GetParentPFActionList(INode* actionNode);
* \brief Returns interface of the parent actionList of the given action
*/
PFExport IPFActionList* GetParentPFActionList(INode* actionNode);
inline IPFActionList* PFActionListInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFActionListInterface(obj));
};
inline IPFActionList* PFActionListInterface(INode* node) {
return ((node == NULL) ? NULL : PFActionListInterface(node->GetObjectRef()));
};
#endif // _IPFACTIONLIST_H_

View File

@ -0,0 +1,119 @@
/*! \file IPFActionListPool.h
\brief The interface and a method are used to access a list
of all ActionList objects in the current scene.
It is possible to register notification with the object
thus getting notification each time when the set of
all ActionLists is changing (create, clone, delete).
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 08-20-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONLISTPOOL_H_
#define _IPFACTIONLISTPOOL_H_
#include "Max.h"
#include "notify.h"
#include "PFExport.h"
// interface ID
#define PFACTIONLISTPOOL_INTERFACE Interface_ID(0x74f93d09, 0x1eb34500)
#define GetPFActionListPoolInterface(obj) ((IPFActionListPool*)obj->GetInterface(PFACTIONLISTPOOL_INTERFACE))
class IPFActionListPool : public FPMixinInterface
{
public:
// function IDs
enum { kNumActionLists,
kGetActionList,
kHasActionList,
kHasActionListByHandle,
kRegisterNotification,
kUnRegisterNotification
};
BEGIN_FUNCTION_MAP
FN_0(kNumActionLists, TYPE_INT, NumActionLists );
FN_1(kGetActionList, TYPE_INODE, GetActionList, TYPE_INDEX );
FN_1(kHasActionList, TYPE_bool, HasActionList, TYPE_INODE );
FN_1(kHasActionListByHandle, TYPE_bool, HasActionListByHandle, TYPE_INT );
END_FUNCTION_MAP
/** @defgroup IPFActionListPool IPFActionListPool.h
* @{
*/
/*! \fn virtual int NumActionLists() = 0;
* \brief Returns number of ActionLists in the current scene
*/
virtual int NumActionLists() = 0;
/*! \fn virtual INode* GetActionList(int i) = 0;
* \brief Returns i-th action lists in the scene
\param i: action list index
*/
virtual INode* GetActionList(int i) = 0;
/*! \fn virtual bool HasActionList(INode* node) = 0;
* \brief Checks if the given aciton list node is present in the scene
\param node: action list node
*/
virtual bool HasActionList(INode* node) = 0;
/*! \fn virtual bool HasActionListByHandle(int handle) = 0;
* \brief check if the scene has an action list with the given node handle
*/
virtual bool HasActionListByHandle(int handle) = 0;
/*! \fn virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Register notification with the action list pool.
The given function is called each time the set of all action lists is changing
Returns nonzero if the event was registered; otherwise zero.
\param proc: The callback function called when the event occurs.
\param param: A pointer to a parameter which will be passed to the callback function.
*/
virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Unregister notification with the action list pool.
This function is called to break the connection between the event and the callback.
After this function executes the callback is no longer invoked when the event occurs.
Returns nonzero if the event was unregistered; otherwise zero.
\param proc: The callback function called when the event occurs.
\param param: A pointer to a parameter which will be passed to the callback function.
*/
virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLISTPOOL_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLISTPOOL_INTERFACE); }
/*! \fn friend PFExport IPFActionListPool* GetPFActionListPool();
* \brief Friend function declarations
*/
friend PFExport IPFActionListPool* GetPFActionListPool();
protected:
PFExport IPFActionListPool();
static IPFActionListPool* m_pool; // the one and only PFActionList Pool in the scene
};
/*! \fn PFExport IPFActionListPool* GetPFActionListPool();
* \brief Gets PFActionListPool from the scene
*/
PFExport IPFActionListPool* GetPFActionListPool();
/*@}*/
#endif // _IPFACTIONLISTPOOL_H_

View File

@ -0,0 +1,105 @@
/*! \file IPFActionListSet.h
\brief Interface for PF ActionList Set
It's a set of ActionLists. PF System implements the
interface to keep track of all initial ActionLists.
Part of public SDK
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-09-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONLISTSET_H_
#define _IPFACTIONLISTSET_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFACTIONLISTSET_INTERFACE Interface_ID(0x7216b6f, 0x634253c5)
#define GetPFActionListSetInterface(obj) ((IPFActionListSet*)((GetPFObject(obj))->GetInterface(PFACTIONLISTSET_INTERFACE)))
class IPFActionListSet : public FPMixinInterface
{
public:
// function IDs
enum { kGetNumActionLists, kGetActionList, kAppendActionList,
kInsertActionList, kRemoveActionList, kHasActionList,
kIsActionList
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0( kGetNumActionLists, TYPE_INT, NumActionLists );
FN_1( kGetActionList, TYPE_INODE, GetActionList, TYPE_INDEX);
FN_1( kAppendActionList, TYPE_bool, AppendActionList, TYPE_INODE);
FN_2( kInsertActionList, TYPE_bool, InsertActionList, TYPE_INODE, TYPE_INDEX);
FN_1( kRemoveActionList, TYPE_bool, RemoveActionList, TYPE_INDEX);
FN_2( kHasActionList, TYPE_bool, HasActionList, TYPE_INODE, TYPE_INDEX_BR);
FN_1( kIsActionList, TYPE_bool, IsActionList, TYPE_INODE);
END_FUNCTION_MAP
// must implement GetDescByID method !
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONLISTSET_INTERFACE); }
//End of Function Publishing system code
//***********************************
/** @defgroup IPFActionListSet IPFActionListSet.h
* @{
*/
/*! \fn virtual int NumActionLists() const = 0;
* \brief
*/
virtual int NumActionLists() const = 0;
/*! \fn virtual INode* GetActionList(int index) const = 0;
* \brief
*/
virtual INode* GetActionList(int index) const = 0;
/*! \fn virtual bool AppendActionList(INode* alist) = 0;
* \brief
*/
virtual bool AppendActionList(INode* alist) = 0;
/*! \fn virtual bool InsertActionList(INode* alist, int indexAt) = 0;
* \brief
*/
virtual bool InsertActionList(INode* alist, int indexAt) = 0;
/*! \fn virtual bool RemoveActionList(int index) = 0;
* \brief
*/
virtual bool RemoveActionList(int index) = 0;
/*! \fn virtual bool HasActionList(INode* alist, int& index) const = 0;
* \brief
*/
virtual bool HasActionList(INode* alist, int& index) const = 0;
/*! \fn PFExport static bool IsActionList(INode* alist);
* \brief
*/
PFExport static bool IsActionList(INode* alist);
};
inline IPFActionListSet* PFActionListSetInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFActionListSetInterface(obj));
};
inline IPFActionListSet* PFActionListSetInterface(INode* node) {
return ((node == NULL) ? NULL : PFActionListSetInterface(node->GetObjectRef()));
};
#endif // _IPFACTIONLISTSET_H_

View File

@ -0,0 +1,95 @@
/*! \file IPFActionState.h
\brief Action-generic interface IPFActionState for action state.
An action may have history-dependent parameters that need
to be restored if the state of the whole particle system
needs to be saved/restored. For example, random generator
that is used by an action, is a history-dependent item.
An action may have several action states at the same time,
each of them reflecting a state for a specific particle
container.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-25-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFACTIONSTATE_H_
#define _IPFACTIONSTATE_H_
#include "Max.h"
// interface ID
#define PFACTIONSTATE_INTERFACE Interface_ID(0x23a31c4e, 0x6a2b2c68)
#define GetPFActionStateInterface(obj) (IPFActionState*)(obj->GetInterface(PFACTIONSTATE_INTERFACE))
class IPFActionState : public FPMixinInterface
{
public:
// chunk IDs for saving and loading
// developer: you may have your own chunk IDs
// they are factored here for convenience
enum { kChunkActionHandle = 4100,
kChunkRandGen = 4200,
kChunkRandGen2 = 4210,
kChunkRandGen3 = 4220,
kChunkRandGen4 = 4230,
kChunkRandGen5 = 4240,
kChunkData = 4300,
kChunkData2 = 4310,
kChunkData3 = 4320,
kChunkData4 = 4330,
kChunkData5 = 4340,
};
public:
/** @defgroup IPFActionState IPFActionState.h
* @{
*/
/*! \fn virtual Class_ID GetClassID() = 0;
* \brief The method returns the unique ID for the action state class.
The ID is used for constructing the action state when loading since
the action state class is not inherited from class Animatable.
*/
virtual Class_ID GetClassID() = 0;
/*! \fn virtual ULONG GetActionHandle() const = 0;
* \brief Returns node handle of the action with the action state
*/
virtual ULONG GetActionHandle() const = 0;
/*! \fn virtual void SetActionHandle(ULONG actionHandle) = 0;
* \brief Defines node handle of the action with the action state
*/
virtual void SetActionHandle(ULONG actionHandle) = 0;
/*! \fn virtual IOResult Save(ISave* isave) const = 0;
* \brief Saving content of the action state to file
*/
virtual IOResult Save(ISave* isave) const = 0;
/*! \fn virtual IOResult Load(ILoad* iload) = 0;
* \brief Loading content of the action state from file
*/
virtual IOResult Load(ILoad* iload) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONSTATE_INTERFACE);
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFACTIONSTATE_INTERFACE);
/*@}*/
}
};
#endif // _IPFACTIONSTATE_H_

View File

@ -0,0 +1,130 @@
/*! \file IPFArrow.h
\brief Interface for PF Arrow
Directs particles from Test to the next ActionList
Part of public SDK
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-15-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFARROW_H_
#define _IPFARROW_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFARROW_INTERFACE Interface_ID(0x74f93d05, 0x1eb34500)
#define GetPFArrowInterface(obj) ((IPFArrow*)(GetPFObject(obj))->GetInterface(PFARROW_INTERFACE))
class IPFArrow : public FPMixinInterface
{
public:
// function IDs
enum { kSetTest,
kSetActionList,
kGetTest,
kGetActionList,
kActivate,
kDeactivate,
kIsActive
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kSetTest, TYPE_bool, SetTest, TYPE_INODE);
FN_1(kSetActionList, TYPE_bool, SetActionList, TYPE_INODE);
FN_0(kGetTest, TYPE_INODE, GetTest);
FN_0(kGetActionList, TYPE_INODE, GetActionList);
FN_0(kActivate, TYPE_bool, Activate);
FN_0(kDeactivate, TYPE_bool, Deactivate);
FN_0(kIsActive, TYPE_bool, IsActive);
END_FUNCTION_MAP
/** @defgroup IPFArrow IPFArrow.h
* @{
*/
/*! \fn virtual bool SetTest(INode* test) = 0;
* \brief Set test the particles are coming from.
Returns true if has been set successfully
The INode can be rejected if it is not a real test (doesn't have IPFTest interface).
*/
virtual bool SetTest(INode* test) = 0;
/*! \fn virtual bool SetActionList(INode* actionList) = 0;
* \brief Set actionList for particles to come to.
Returns true if has been set successfully.
The INode can be rejected if it is not a real actionList (doesn't have IPFActionList interface).
*/
virtual bool SetActionList(INode* actionList) = 0;
/*! \fn virtual INode* GetTest() const = 0;
* \brief
*/
virtual INode* GetTest() const = 0;
/*! \fn virtual INode* GetActionList() const = 0;
* \brief
*/
virtual INode* GetActionList() const = 0;
/*! \fn virtual bool Activate() = 0;
* \brief
*/
virtual bool Activate() = 0;
/*! \fn virtual bool Deactivate() = 0;
* \brief
*/
virtual bool Deactivate() = 0;
/*! \fn virtual bool IsActive() const = 0;
* \brief
*/
virtual bool IsActive() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFARROW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFARROW_INTERFACE); }
/*! \fn PFExport void updateNextActionListValueInTestFrom(INode* nextAL, INode* testFrom);
* \brief For internal use
*/
PFExport void updateNextActionListValueInTestFrom(INode* nextAL, INode* testFrom);
/*! \fn PFExport void updateArrowValueInTestFrom(Object* arrow, INode* testFrom);
* \brief For internal use
*/
PFExport void updateArrowValueInTestFrom(Object* arrow, INode* testFrom);
/*! \fn PFExport void updateLinkActiveValueInTestFrom(bool active, INode* testFrom);
* \brief For internal use
*/
PFExport void updateLinkActiveValueInTestFrom(bool active, INode* testFrom);
};
inline IPFArrow* PFArrowInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFArrowInterface(obj));
};
inline IPFArrow* PFArrowInterface(INode* node) {
return ((node == NULL) ? NULL : PFArrowInterface(node->GetObjectRef()));
};
/*@}*/
#endif // _IPFARROW_H_

View File

@ -0,0 +1,161 @@
/*! \file IPFIntegrator.h
\brief Interface for time-integrating PF Operator
PF has a default implementation of such interface
The interface is used to "advance" particles in time
according to some rules. The default implementation
uses classical mechanics physics rules for a body
Position and speed is calculated according to
the current speed and acceleration. That applies to
linear and angular movements.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFINTEGRATOR_H_
#define _IPFINTEGRATOR_H_
#include "Max.h"
#include "PFExport.h"
#include "PreciseTimeValue.h"
// interface ID
#define PFINTEGRATOR_INTERFACE Interface_ID(0x74f93d03, 0x1eb34500)
#define GetPFIntegratorInterface(obj) ((IPFIntegrator*)obj->GetInterface(PFINTEGRATOR_INTERFACE))
// function IDs
enum { kPFIntegrator_proceedSync,
kPFIntegrator_proceedASync
};
class IPFIntegrator : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
FN_5(kPFIntegrator_proceedSync, TYPE_bool, ProceedSync, TYPE_IOBJECT, TYPE_TIMEVALUE, TYPE_FLOAT, TYPE_bool, TYPE_BITARRAY);
FN_5(kPFIntegrator_proceedASync, TYPE_bool, ProceedASync, TYPE_IOBJECT, TYPE_TIMEVALUE_TAB, TYPE_FLOAT_TAB, TYPE_bool, TYPE_BITARRAY);
END_FUNCTION_MAP
public:
/** @defgroup IPFIntegrator IPFIntegrator.h
* @{
*/
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue time, int index) = 0;
* \brief Returns true if the operation has been proceeded successfully
Proceed a single particle with the given index to the given time.
If pCont is NULL then the method works with previously given container.
It will expedite the call since the method won't acquire particle channels
from the container but uses the previously acquired channels.
When working with individual particles from the same container, the good
practice is to make the call for the first particle with the container specified,
and then for all other particles with the container set to NULL.
\param pCont: particleContainer
\param time: the time for particles to come to; each particle may have its
own current valid time; the parameter sets the time for all particles to synchronize to
\param times: time value for a particle to come to; particles may have different time values to come to
\param selected: bitArray to define which particles to proceed
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue time, int index) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue time) = 0;
* \brief Proceed all particles in the container to the given time
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue time) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times) = 0;
* \brief Proceed all particles in the container to the given times (maybe different for each particle)
*/
virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue time, BitArray& selected) = 0;
* \brief Proceed selected particles only to the given time
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue time, BitArray& selected) = 0;
/*! \fn virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times, BitArray& selected) = 0;
* \brief Proceed selected particles only to the given times (maybe different for each particle)
*/
virtual bool Proceed(IObject* pCont, Tab<PreciseTimeValue>& times, BitArray& selected) = 0;
/*! \fn PFExport bool ProceedSync(IObject* pCont, TimeValue timeTick, float timeFraction,
bool isSelected, BitArray* selected);
* \brief "function-publishing" hook-up for the methods above
\param pCont: particleContainer
\param timeTick, timeFraction, timeTicks, timeFractions:
time for particles to come to. All particles may have the same time value to
come to, in that case the method with timeTick and timeFraction have to
used. Sum of timeTick and timeFraction define the exact time
value (without TimeValue granularity). If particles have different time values
to come to than use the second method with Tabs of timeTicks and timeFractions
\param isSelected, selected: if only part of particles need to be time-advanced then
isSelected is true, and "selected" BitArray have to be defined
*/
PFExport bool ProceedSync(IObject* pCont, TimeValue timeTick, float timeFraction,
bool isSelected, BitArray* selected);
/*! \fn PFExport bool ProceedASync(IObject* pCont, Tab<TimeValue> *timeTicks, Tab<float> *timeFractions,
bool isSelected, BitArray* selected);
* \brief "function-publishing" hook-up for the methods above
\param pCont: particleContainer
\param timeTick, timeFraction, timeTicks, timeFractions:
time for particles to come to. All particles may have the same time value to
come to, in that case the method with timeTick and timeFraction have to
used. Sum of timeTick and timeFraction define the exact time
value (without TimeValue granularity). If particles have different time values
to come to than use the second method with Tabs of timeTicks and timeFractions
\param isSelected, selected: if only part of particles need to be time-advanced then
isSelected is true, and "selected" BitArray have to be defined
*/
PFExport bool ProceedASync(IObject* pCont, Tab<TimeValue> *timeTicks, Tab<float> *timeFractions,
bool isSelected, BitArray* selected);
/*! \fn virtual IPFIntegrator* GetEncapsulatedIntegrator() { return NULL; }
* \brief An integrator may rely on another integrator to calculation some particle proceedings.
For example, a Collision test has IPFIntegrator interface to proceed particles according
to collision approximations. At the same time a Collision test doesn't proceed angular
velocity of a particle. For that the test relies on encapsulated standard integrator.
*/
virtual IPFIntegrator* GetEncapsulatedIntegrator() { return NULL; }
/*! \fn PFExport bool HasEncapsulatedIntegrator(IPFIntegrator* integrator);
* \brief Check if the current integrator has the given integrator encapsulated inside
the encapsulated integrator can be more than one level down
*/
PFExport bool HasEncapsulatedIntegrator(IPFIntegrator* integrator);
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFINTEGRATOR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFINTEGRATOR_INTERFACE); }
/*! \fn friend PFExport IPFIntegrator* GetPFIntegrator();
* \brief Friend function declarations
*/
friend PFExport IPFIntegrator* GetPFIntegrator();
/*! \fn friend PFExport void ReleasePFIntegrator(IPFIntegrator*);
* \brief Friend function declarations
*/
friend PFExport void ReleasePFIntegrator(IPFIntegrator*);
protected:
static Tab<IObject*> m_objs;
};
// this method gets a system PF Integrator interface
PFExport IPFIntegrator* GetPFIntegrator();
// when the developer is done with the PFIntegrator interface acquired via GetPFIntegrator()
// they should call this method to release it.
PFExport void ReleasePFIntegrator(IPFIntegrator* integrator);
#endif // _IPFINTEGRATOR_H_

View File

@ -0,0 +1,158 @@
/*! \file IPFOperator.h
\brief Operator-generic interface IPFOperator
This is a part of every PF Operator
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFOPERATOR_H_
#define _IPFOPERATOR_H_
#include "Max.h"
#include "PFExport.h"
#include "IPFIntegrator.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFOPERATOR_INTERFACE Interface_ID(0x74f93d01, 0x1eb34500)
#define GetPFOperatorInterface(obj) ((IPFOperator*)((GetPFObject(obj))->GetInterface(PFOPERATOR_INTERFACE)))
class IPFOperator : public FPMixinInterface
{
public:
// function IDs
enum { kProceed
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_7(kProceed, TYPE_bool, Proceed, TYPE_IOBJECT, TYPE_TIMEVALUE, TYPE_TIMEVALUE_BR, TYPE_OBJECT, TYPE_INODE, TYPE_INODE, TYPE_INTERFACE);
END_FUNCTION_MAP
/** @defgroup IPFOperator IPFOperator.h
* @{
*/
/*! \fn Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actioNode, IPFIntegrator* integrator) = 0;
* \brief Returns true if the operation has been proceeded successfully.
methods' signatures are presented in two forms: one is compact, and the other one
is for function-publishing where PreciseTimeValue is presented as a pair (int,float).
\param pCont: particleContainer timeStart: the time for particle to start from the simulation. Each particle
may have its own current valid time greater than timeStart. In this
case the operator should consider the current particle time and
timeEnd parameter. Some operators (like Birth) may not consider
current particle time since it works with timeStart and timeEnd
parameters only.
\param timeEnd: the time for particles to come to; each particle may have its
own current valid time; the parameter sets the time for all
particles to synchronize to.
If current particle time is greater than timeEnd it means that the
particle doesn't require processing at all; the particle has been already
updated beyond the interval ]timeStart, timeEnd] of the current operator.
Sometimes the operator may not be able to proceed all the
particles to the given timeEnd. In this case the operator proceeds
the particles as far as possible and set the parameter to the
time achieved. All the following operators will be given the new
timeEnd value as a time value for particles to come to,
and the particle system will run another round of operator stack
modification in the attempt to proceed all the particles to the
initially set time.
\param pSystem: the particle system that generates the particle stream;
the same operator may get calls from different particle systems; if the
result varies according to the particle system that generates
particles, then this parameter is useful.
\param pNode:INode of the particle system that generates the particles.
\param actionNode: INode of the operator (if any; can be NULL)
\param integrator: an operator to proceed particles according to "inertia" rules.
The operator updates time, speed, position, spin, orientation channels
on the basis of time, acceleration, speed, angular acceleration and
spin channels. Each particle system has a default inertia operator.
When an operator want to update current time for particles, it
uses the "inertia" operator. An Action in the ActionList stack my "switch"
the suggested "inertia" operator by its own if the Action support
the "inertial" operator interface. The particle system recognizes
such an Action as a holder of "inertia" interface, and use it
for "inertia" purposes later on.
If the parameter is NULL then the particle system doesn't allow
the operator to advance particles in the time channel.
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actioNode, IPFIntegrator* integrator) = 0;
/*! \fn PFExport bool Proceed(IObject* pCont, TimeValue timeStart, TimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator);
* \brief "function publishing" alternative for the method above
*/
PFExport bool Proceed(IObject* pCont, TimeValue timeStart, TimeValue& timeEnd, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator);
/*! \fn virtual bool HasPreProceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { return false; }
* \brief Three methods apply the Proceed method as a pre-procedure before the
regular proceed for all operators starts. It is not recommended to modify particle container.
The call is mostly used to give an operator opportunity to snapshot the state of particle container
before any operator modifies it.
The Proceed method is called in between PretProceedBegin and PreProceedEnd methods if
HasPreProceed method returns "true".
Those methods are not supported in MaxScript intentionally.
*/
virtual bool HasPreProceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { return false; }
/*! \fn virtual void PreProceedBegin(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
* \brief See virtual bool HasPreProceed(}
*/
virtual void PreProceedBegin(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
/*! \fn virtual void PreProceedEnd(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
* \brief See virtual bool HasPreProceed(}
*/
virtual void PreProceedEnd(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd) { ; }
/*! \fn virtual bool HasPostProceed(IObject* pCont, PreciseTimeValue time) { return false; }
* \brief Three methods apply the Proceed method as a post procedure when the
amount of particles in all particle groups has been established and there won't be any
particle transfers from one particle group to another.
The Proceed method is called again in between PostProceedBegin and PostProceedEnd methods if
HasPostProceed method returns "true".
Since the post proceed methods are applied after everything has established, it is applied to a "time" moment, not
[timeStart, timeEnt] interval. The Proceed method is called with the same value for timeStart and timeEnd.
Those methods are not supported in MaxScript intentionally.
*/
virtual bool HasPostProceed(IObject* pCont, PreciseTimeValue time) { return false; }
/*! \fn virtual void PostProceedBegin(IObject* pCont, PreciseTimeValue time) { ; }
* \brief See virtual bool HasPostProceed(}
*/
virtual void PostProceedBegin(IObject* pCont, PreciseTimeValue time) { ; }
/*! \fn virtual void PostProceedEnd(IObject* pCont, PreciseTimeValue time) { ; }
* \brief See virtual bool HasPostProceed(}
*/
virtual void PostProceedEnd(IObject* pCont, PreciseTimeValue time) { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFOPERATOR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFOPERATOR_INTERFACE); }
/*@}*/
};
inline IPFOperator* PFOperatorInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFOperatorInterface(obj));
};
inline IPFOperator* PFOperatorInterface(INode* node) {
return ((node == NULL) ? NULL : PFOperatorInterface(node->GetObjectRef()));
};
#endif // _IPFOPERATOR_H_

View File

@ -0,0 +1,115 @@
/*! \file IPFRender.h
\brief Render related interface for an Operator.
If an Operator has a Render interface
then the Operator is called to supply geometry for render
in the current ActionList.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-29-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFRENDER_H_
#define _IPFRENDER_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFRENDER_INTERFACE Interface_ID(0x75aa7a7f, 0x19c66a0a)
#define GetPFRenderInterface(obj) ((IPFRender*)((GetPFObject(obj))->GetInterface(PFRENDER_INTERFACE)))
class IPFRender : public FPMixinInterface
{
public:
/** @defgroup IPFRender IPFRender.h
* @{
*/
/*! \fn virtual int HasRenderableGeometry() { return(1); }
* \brief The following methods are redirected from the particle object level to
a particular ActionList. The first parameter is a particle container of the ActionList.
Returns 0 if the action doesn't render in all frames for any reason, for example a non-animated parameter prevents render.
\param pCont: particle container to render particles from
\param time: current frame to render particles at. It's supposed that the container has been already updated to satisfy this moment
\param pSystem: master particle system shell
\param inode: INode of the particle group
\param view: View as of the GeomObject::GetRenderMesh(...) method
\param needDelete: boolean as of the GeomObject::GetRenderMesh(...) method
*/
virtual int HasRenderableGeometry() { return(1); }
/*! \fn virtual int IsInstanceDependent(IObject* pCont, Object* pSystem) { return 0; }
* \brief If an object creates different meshes depending on the particular instance (view-dependent) it should return 1.
*/
virtual int IsInstanceDependent(IObject* pCont, Object* pSystem) { return 0; }
/*! \fn virtual Mesh* GetRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) = 0;
* \brief GetRenderMesh should be implemented by all renderable GeomObjects.
Set needDelete to TRUE if the render should delete the mesh, FALSE otherwise.
Primitives that already have a mesh cached can just return a pointer to it (and set needDelete = FALSE).
*/
virtual Mesh* GetRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) = 0;
/*! \fn virtual int NumberOfRenderMeshes(IObject* pCont, TimeValue t, Object* pSystem) { return 0; } // 0 indicates multiple meshes not supported.
* \brief Objects may now supply multiple render meshes. If this function
returns a positive number, then GetMultipleRenderMesh and GetMultipleRenderMeshTM will be
called for each mesh, instead of calling GetRenderMesh.
*/
virtual int NumberOfRenderMeshes(IObject* pCont, TimeValue t, Object* pSystem) { return 0; } // 0 indicates multiple meshes not supported.
/*! \fn virtual Mesh* GetMultipleRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete, int meshNumber) { return NULL; }
* \brief For multiple render meshes, this method must be implemented.
Set needDelete to TRUE if the render should delete the mesh, FALSE otherwise.
meshNumber specifies which of the multiplie meshes is being asked for.
*/
virtual Mesh* GetMultipleRenderMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete, int meshNumber) { return NULL; }
/*! \fn virtual void GetMultipleRenderMeshTM(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, int meshNumber,
Matrix3& meshTM, Interval& meshTMValid) { return; }
* \brief For multiple render meshes, this method must be implemented.
meshTM should be returned with the transform defining the offset of the particular mesh in object space.
meshTMValid should contain the validity interval of meshTM
*/
virtual void GetMultipleRenderMeshTM(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, int meshNumber,
Matrix3& meshTM, Interval& meshTMValid) { return; }
/*! \fn virtual PatchMesh* GetRenderPatchMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) { return NULL; }
* \brief If this returns NULL, then GetRenderMesh will be called
*/
virtual PatchMesh* GetRenderPatchMesh(IObject* pCont, TimeValue t, Object* pSystem, INode *inode, View& view, BOOL& needDelete) { return NULL; }
/*! \fn virtual Class_ID PreferredCollapseType(IObject* pCont, Object* pSystem) { return triObjectClassID; }
* \brief
*/
virtual Class_ID PreferredCollapseType(IObject* pCont, Object* pSystem) { return triObjectClassID; }
/*! \fn virtual BOOL CanDoDisplacementMapping(IObject* pCont, Object* pSystem) { return 0; }
* \brief
*/
virtual BOOL CanDoDisplacementMapping(IObject* pCont, Object* pSystem) { return 0; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFRENDER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFRENDER_INTERFACE); }
};
inline IPFRender* PFRenderInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFRenderInterface(obj));
};
inline IPFRender* PFRenderInterface(INode* node) {
return ((node == NULL) ? NULL : PFRenderInterface(node->GetObjectRef()));
};
#endif // _IPFRENDER_H_

View File

@ -0,0 +1,235 @@
/*! \file IPFSystem.h
\brief Interface for Event-Driven Particle System. PF System has a system-specific parameters like a
maximum number of particles in the system, integration
step size etc. Operators and Tests may request values
of those parameters through the interface.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-22-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFSYSTEM_H_
#define _IPFSYSTEM_H_
#include "Max.h"
#include "PFExport.h"
#include "IPViewManager.h"
// interface ID
#define PFSYSTEM_INTERFACE Interface_ID(0x74f93d00, 0x1eb34700)
#define GetPFSystemInterface(obj) ((IPFSystem*)((GetPFObject(obj))->GetInterface(PFSYSTEM_INTERFACE)))
class IPFSystem : public FPMixinInterface
{
public:
// function IDs
enum { kGetMultiplier,
kGetBornAllowance,
kHasEmitter,
kGetEmitterType,
kGetEmitterDimensions,
kGetEmitterGeometry,
kIsEmitterGeometryAnimated,
kSetRenderState,
kIsRenderState,
kGetIntegrationStep,
kGetUpdateType,
kNumParticlesSelected,
kGetSelectedParticleID,
kIsParticleSelected,
kNumActionListsSelected,
kGetSelectedActionList,
kIsActionListSelected,
kIsRunningScript,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetMultiplier, TYPE_FLOAT, GetMultiplier, TYPE_TIMEVALUE );
FN_0(kGetBornAllowance, TYPE_INT, GetBornAllowance );
FN_0(kHasEmitter, TYPE_bool, HasEmitter);
FN_1(kGetEmitterType, TYPE_INT, GetEmitterType, TYPE_TIMEVALUE );
VFN_2(kGetEmitterDimensions, GetEmitterDimensions, TYPE_TIMEVALUE, TYPE_FLOAT_TAB_BR );
FN_1(kGetEmitterGeometry, TYPE_MESH, GetEmitterGeometry, TYPE_TIMEVALUE);
FN_0(kIsEmitterGeometryAnimated, TYPE_bool, IsEmitterGeometryAnimated);
VFN_1(kSetRenderState, SetRenderState, TYPE_bool);
FN_0(kIsRenderState, TYPE_bool, IsRenderState);
FN_0(kGetIntegrationStep, TYPE_TIMEVALUE, GetIntegrationStep);
FN_0(kGetUpdateType, TYPE_INT, GetUpdateType);
FN_0(kNumParticlesSelected, TYPE_INT, NumParticlesSelected);
FN_1(kGetSelectedParticleID, TYPE_INDEX, GetSelectedParticleID, TYPE_INDEX);
FN_1(kIsParticleSelected, TYPE_bool, IsParticleSelected, TYPE_INDEX);
FN_0(kNumActionListsSelected, TYPE_INT, NumActionListsSelected);
FN_1(kGetSelectedActionList, TYPE_INODE, GetSelectedActionList, TYPE_INDEX);
FN_1(kIsActionListSelected, TYPE_bool, IsActionListSelected, TYPE_INODE);
FN_0(kIsRunningScript, TYPE_bool, IsRunningScript);
END_FUNCTION_MAP
/** @defgroup IPFSystem IPFSystem.h
* @{
*/
/*! \fn virtual float GetMultiplier(TimeValue time) = 0;
* \brief Returns multiplier coefficient to generate particles. Value 1.0f means that
an operator produces particles at 100% rate. Value 0.5f means that an operator
produces only half of particles that it supposed to be generating, i.e. if
a Birth operator is set to produce 1000 particles total, then under multiplier = 0.5f
the operator produces only 500 particles.
*/
virtual float GetMultiplier(TimeValue time) = 0;
/*! \fn virtual int GetBornAllowance() = 0;
* \brief Returns number of particles allowed to be generated at current time. Particle system has
an upper limit of a total number of particles in the system. At each moment of time
particle system is able to calculate the current number of particle in the system and
how many particles are allowed to be generated to not exceed the limit threshold. Birth and
Spawn Operators use this method to find out how many particles they are allowed to generate.
*/
virtual int GetBornAllowance() = 0;
/*! \fn virtual bool HasEmitter() { return false; }
* \brief PF System has an icon that can be used as an emitter for particles. For Operators to use
the icon as an emitter the following five methods should be supported. If PF System doesn't
support emitter icon then it returns "false" in the first method. The default implementation
of the following five methods is if PF System doesn't support icon emission.
*/
virtual bool HasEmitter() { return false; }
// emitter types
enum { kEmitterType_none = -1,
kEmitterType_rectangle = 0,
kEmitterType_circle,
kEmitterType_box,
kEmitterType_sphere,
kEmitterType_mesh
};
/*! \fn virtual int GetEmitterType(TimeValue time) { return kEmitterType_none; }
* \brief
*/
virtual int GetEmitterType(TimeValue time) { return kEmitterType_none; }
/*! \fn virtual void GetEmitterDimensions(TimeValue time, Tab<float>& dimensions) { }
* \brief Returns spacial dimensions of the emitter icon. It may have less or more than three
as emitter type requires. For example, sphere emitter type has only one dimension.
*/
virtual void GetEmitterDimensions(TimeValue time, Tab<float>& dimensions) { }
/*! \fn virtual Mesh* GetEmitterGeometry(TimeValue time) { return NULL; }
* \brief Returns emitter geometry in form of mesh.
*/
virtual Mesh* GetEmitterGeometry(TimeValue time) { return NULL; }
/*! \fn virtual bool IsEmitterGeometryAnimated() { return false; }
* \brief If the emitter mesh is geometry-animated, return "true" in the following method.
*/
virtual bool IsEmitterGeometryAnimated() { return false; }
/*! \fn virtual void SetRenderState(bool renderState=true) = 0;
* \brief PF System has two states: render and viewport. At any given moment PF System
is exclusively in one state or the other. PF System may have different parameters
during render and viewport (i.e. Multiplier value, or emitter geometry etc.)
therefore it's important to know what state the PF System is in. It's also
possible to alterate the state of PF System. PF System alterates its state
automatically when the rendering starts and when the rendering ends.
*/
virtual void SetRenderState(bool renderState=true) = 0;
/*! \fn virtual bool IsRenderState() const = 0;
* \brief Works with SetRenderState.
*/
virtual bool IsRenderState() const = 0;
/*! \fn virtual TimeValue GetIntegrationStep() const = 0;
* \brief PF System has an integration step parameter that defines granularity in proceeding
particles in time. An PF System may have different integration steps for viewports
and for render.
*/
virtual TimeValue GetIntegrationStep() const = 0;
/*! \fn virtual int GetUpdateType() const { return GetPFUpdateType(); } // uses global UpdateType method from IPViewManager
* \brief PF system has different modes for update.
Forward mode: particles aren't updated right away. At playback time the particle history is
not recalculated. Only new events that will happen with the particles have new settings
Complete mode: the whole particle animation is recalculated.
*/
enum { kPFUpdateType_complete, kPFUpdateType_forward };
virtual int GetUpdateType() const { return GetPFUpdateType(); } // uses global UpdateType method from IPViewManager
/*! \fn virtual int NumParticlesSelected() const { return 0; }
* \brief PF system may select sub-components. There are two types of sub-components: particles and
action lists. Returns amount of selected particles.
*/
virtual int NumParticlesSelected() const { return 0; }
/*! \fn virtual int GetSelectedParticleID(int i) const { return 0; }
* \brief Returns born ID of the i-th selected particle
*/
virtual int GetSelectedParticleID(int i) const { return 0; }
/*! \fn virtual bool IsParticleSelected(int id) const { return false; }
* \brief Verifies if a particle with the given born ID is selected or not
*/
virtual bool IsParticleSelected(int id) const { return false; }
/*! \fn virtual int NumActionListsSelected() const { return 0; }
* \brief Returns amount of selected action lists
*/
virtual int NumActionListsSelected() const { return 0; }
/*! \fn virtual INode* GetSelectedActionList(int i) const { return NULL; }
* \brief Returns node of the i-th selected action list
*/
virtual INode* GetSelectedActionList(int i) const { return NULL; }
/*! \fn virtual bool IsActionListSelected(INode* inode) const { return false; }
* \brief Verifies if an action list is selected or not
*/
virtual bool IsActionListSelected(INode* inode) const { return false; }
/*! \fn virtual bool IsRunningScript() const { return false; }
* \brief Returns true if the particle system is in the process of runnint Every Step or Final Step scripts
*/
virtual bool IsRunningScript() const { return false; }
/*! \fn virtual bool IsCopyClone() const { return true; }
* \brief For internal use.
*/
virtual bool IsCopyClone() const { return true; }
/*! \fn virtual void ResetCopyClone() { ; }
* \brief Works with IsCopyClone.
*/
virtual void ResetCopyClone() { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEM_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEM_INTERFACE); }
/*@}*/
};
inline IPFSystem* PFSystemInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFSystemInterface(obj));
};
inline IPFSystem* PFSystemInterface(INode* node) {
return ((node == NULL) ? NULL : PFSystemInterface(node->GetObjectRef()));
};
#endif // _IPFSYSTEM_H_

View File

@ -0,0 +1,117 @@
/*! \file IPFSystemPool.h
\brief The interface and a method are used to access a list
of all PF particle systems in the current scene.
It is possible to register notification with the object
thus getting notification each time when the set of
all PF particle systems is changing (create, clone, delete).
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 08-20-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFSYSTEMPOOL_H_
#define _IPFSYSTEMPOOL_H_
#include "Max.h"
#include "notify.h"
#include "PFExport.h"
// interface ID
#define PFSYSTEMPOOL_INTERFACE Interface_ID(0x74f93d0a, 0x1eb34500)
#define GetPFSystemPoolInterface(obj) ((IPFSystemPool*)obj->GetInterface(PFSYSTEMPOOL_INTERFACE))
class IPFSystemPool : public FPMixinInterface
{
public:
// function IDs
enum { kNumPFSystems,
kGetPFSystem,
kHasPFSystem,
kHasPFSystemByHandle,
kRegisterNotification,
kUnRegisterNotification
};
BEGIN_FUNCTION_MAP
FN_0(kNumPFSystems, TYPE_INT, NumPFSystems );
FN_1(kGetPFSystem, TYPE_INODE, GetPFSystem, TYPE_INDEX );
FN_1(kHasPFSystem, TYPE_bool, HasPFSystem, TYPE_INODE );
FN_1(kHasPFSystemByHandle, TYPE_bool, HasPFSystemByHandle, TYPE_INT );
END_FUNCTION_MAP
/** @defgroup IPFSystemPool IPFSystemPool.h
* @{
*/
/*! \fn virtual int NumPFSystems() = 0;
* \brief returns number of PFSystems in the current scene
*/
virtual int NumPFSystems() = 0;
/*! \fn virtual INode* GetPFSystem(int i) = 0;
* \brief Returns i-th PFSystem in the scene
* \param i: PFSystem index
*/
virtual INode* GetPFSystem(int i) = 0;
/*! \fn virtual bool HasPFSystem(INode* node) = 0;
* \brief Checks if the given PFSystem node is present in the scene
* \param node: PFSystem node
*/
virtual bool HasPFSystem(INode* node) = 0;
/*! \fn virtual bool HasPFSystemByHandle(int handle) = 0;
* \brief Check if the scene has a PFSystem with the given node handle
*/
virtual bool HasPFSystemByHandle(int handle) = 0;
/*! \fn virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Register notification with the PFSystem pool.
The given function is called each time the set of all PFSystems is changing.
Returns nonzero if the event was registered; otherwise zero.
* \param proc: The callback function called when the event occurs.
*/
virtual int RegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
* \brief Unregister notification with the PFSystem pool.
This function is called to break the connection between the event and the callback.
After this function executes the callback is no longer invoked when the event occurs.
Returns nonzero if the event was unregistered; otherwise zero.
* \param proc: The callback function called when the event occurs.
*/
virtual int UnRegisterNotification(NOTIFYPROC proc, void *param) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEMPOOL_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFSYSTEMPOOL_INTERFACE); }
/*! \fn friend PFExport IPFSystemPool* GetPFSystemPool();
* \brief Friend function declarations
*/
friend PFExport IPFSystemPool* GetPFSystemPool();
protected:
PFExport IPFSystemPool();
static IPFSystemPool* m_pool; // the one and only PFSystem Pool in the scene
};
/*! \fn PFExport IPFSystemPool* GetPFSystemPool();
* \brief Gets PFSystemPool from the scene
*/
PFExport IPFSystemPool* GetPFSystemPool();
/*@}*/
#endif // _IPFSYSTEMPOOL_H_

View File

@ -0,0 +1,190 @@
/*! \file IPFTest.h
\brief Test-generic interface IPFTest. This is a part of every PF Test.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-12-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFTEST_H_
#define _IPFTEST_H_
#include "Max.h"
#include "IPFIntegrator.h"
#include "IPFArrow.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFTEST_INTERFACE Interface_ID(0x74f93d02, 0x1eb34500)
#define GetPFTestInterface(obj) ((IPFTest*)((GetPFObject(obj))->GetInterface(PFTEST_INTERFACE)))
class IPFTest : public FPMixinInterface
{
public:
// function IDs
enum { kProceedStep1,
kProceedStep2,
kGetNextActionList,
kSetNextActionList,
kSetLinkActive,
kClearNextActionList
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_5(kProceedStep1, ProceedStep1, TYPE_IOBJECT, TYPE_OBJECT, TYPE_INODE, TYPE_INODE, TYPE_INTERFACE);
FN_6(kProceedStep2, TYPE_bool, ProceedStep2, TYPE_TIMEVALUE, TYPE_FLOAT, TYPE_TIMEVALUE_BR, TYPE_FLOAT_BR, TYPE_BITARRAY_BR, TYPE_FLOAT_TAB_BR);
FN_2(kGetNextActionList, TYPE_INODE, GetNextActionList, TYPE_INODE, TYPE_bool_BP );
FN_2(kSetNextActionList, TYPE_bool, SetNextActionListMXS, TYPE_INODE, TYPE_INODE);
FN_2(kSetLinkActive, TYPE_bool, SetLinkActive, TYPE_bool, TYPE_INODE);
FN_1(kClearNextActionList, TYPE_bool, ClearNextActionList, TYPE_INODE);
END_FUNCTION_MAP
/** @defgroup IPFTest IPFTest.h
* @{
*/
/*! \fn PFExport IPFTest();
* \brief
*/
PFExport IPFTest();
/*! \fn virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd,
Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator,
BitArray& testResult, Tab<float>& testTime) = 0;
* \brief Returns true if the test has been proceeded successfully. Verifies the test condition and may change particle channels;
particle (that satisfy the condition) may be advanced to the time of the condition
satisfaction according to the inertia operator "integrator". If ptr to the integrator
is set to NULL then particles are not advanced in time.
\param timeStart: the time for a particle to start the simulation. Each particle
may have its own current valid time greater than timeStart. In this
case the test should consider the current particle time and
timeEnd parameter.
\param timeEnd: the time for particles to come to; each particle may have its
own current valid time; the parameter sets the time for all
particles to synchronize to.
Sometimes the test may not be able to proceed all the
particles to the given timeEnd. In this case the operator proceeds
the particles as far as possible and set the parameter to the
time achieved. All the following actions will be given the new
timeEnd value as a time value for particles to come to,
and the particle system will run another round of action stack
modification in the attempt to proceed all the particles to the
initially set time.
\param pSystem: the particle system that generates the particle stream;
the same operator may get calls from different particle systems; if the
result varies according to the particle system that generates
particles, then this parameter is useful
\param pNode: INode of the particle system that generates the particles.
\param actionNode: INode of the test
\param integrator: an operator to proceed particles according to "inertia" rules.
The operator updates time, speed, position, spin, orientation channels
on the basis of time, acceleration, speed, angular acceleration and
spin channels. Each particle system has a default inertia operator.
When an action want to update current time for particles, it
uses the "inertia" operator. An Action in the ActionList stack my "switch"
the suggested "inertia" operator by its own if the Action support
the "inertial" operator interface. The particle system recognizes
such an Action as a holder of "inertia" interface, and use it
for "inertia" purposes later on.
If the parameter is NULL then the particle system doesn't allow
the test to advance particles in the time channel
\param testResult: a bit array to indicate which particles satisfy the test condition
\param testTime: for particles that satisfy the condition, the list of time moments when
a particle satisfies the condifion. The tab has the same number of entry as
particles in the container. Only for particles that satisfy the condition
the entry is set.
*/
virtual bool Proceed(IObject* pCont, PreciseTimeValue timeStart, PreciseTimeValue& timeEnd,
Object* pSystem, INode* pNode, INode* actionNode, IPFIntegrator* integrator,
BitArray& testResult, Tab<float>& testTime) = 0;
/*! \fn virtual void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator) = 0;
* \brief FnPub alternative to virtual bool Proceed() above. FnPub doesn't allow having more than 7 parameters; therefore the method consists of two parts. The methods
should be called successively: Step1 and then Step2.
*/
virtual void ProceedStep1(IObject* pCont, Object* pSystem, INode* pNode, INode* actionNode, FPInterface* integrator) = 0;
/*! \fn virtual bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction,
TimeValue& timeEndTick, float& timeEndFraction,
BitArray& testResult, Tab<float>& testTime) = 0;
* \brief FnPub alternative to virtual bool Proceed() above. FnPub doesn't allow having more than 7 parameters; therefore the method consists of two parts. The methods
should be called successively: Step1 and then Step2.
*/
virtual bool ProceedStep2(TimeValue timeStartTick, float timeStartFraction,
TimeValue& timeEndTick, float& timeEndFraction,
BitArray& testResult, Tab<float>& testTime) = 0;
/*! \fn PFExport INode* GetNextActionList(INode* test, bool* linkActive=NULL);
* \brief Gets INode of the next ActionList. If particle satisfies the test then it is directed
to this ActionList. Since a test may have several INode instances with different next events,
it is necessary to define the INode the method returns activity status of the link to the next ActionList.
*/
PFExport INode* GetNextActionList(INode* test, bool* linkActive=NULL);
/*! \fn PFExport bool SetNextActionList(INode* nextAL, INode* test);
* \brief Modifies the next ActionList for the test. Returns true if the next actionList has been set successfully.
The nextAL node can be rejected if it is not real actionList.
*/
PFExport bool SetNextActionList(INode* nextAL, INode* test);
/*! \fn PFExport bool SetNextActionListMXS(INode* nextAL, INode* test);
* \brief FnPub alternative for the method above; used by maxscript to set the next action list
*/
PFExport bool SetNextActionListMXS(INode* nextAL, INode* test);
/*! \fn PFExport bool SetLinkActive(bool active, INode* test);
* \brief Modifies activity status for the link to the next ActionList. Returns true if the modification has been done successfully
*/
PFExport bool SetLinkActive(bool active, INode* test);
/*! \fn PFExport bool ClearNextActionList(INode* test);
* \brief Deletes the wire going to the nextActionList for the test. Returns true if the wire was deleted successfully.
The test node can be rejected if it is not a real test action.
*/
PFExport bool ClearNextActionList(INode* test);
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFTEST_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFTEST_INTERFACE); }
/*! \fn inline void updateNextActionListValue(INode* nextAL) { m_nextActionList = nextAL; }
* \brief for internal use only
*/
inline void updateNextActionListValue(INode* nextAL) { m_nextActionList = nextAL; }
/*! \fn inline void updateArrowValue(Object* arrow) { m_arrow = arrow; }
* \brief for internal use only
*/
inline void updateArrowValue(Object* arrow) { m_arrow = arrow; }
/*! \fn inline void updateLinkActiveValue(bool linkActive) { m_linkActive = linkActive; }
* \brief for internal use only
*/
inline void updateLinkActiveValue(bool linkActive) { m_linkActive = linkActive; }
protected:
INode* m_nextActionList; // an actionList node for the next event.
Object* m_arrow; // an arrow object that controls the gate to the next ActionList
bool m_linkActive; // status of the link to the next ActionList
};
inline IPFTest* PFTestInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFTestInterface(obj));
};
inline IPFTest* PFTestInterface(INode* node) {
return ((node == NULL) ? NULL : PFTestInterface(node->GetObjectRef()));
};
#endif // _IPFTEST_H_

View File

@ -0,0 +1,92 @@
/*! \file IPFViewport.h
\brief Viewport related interface for an Operator
If an Operator has a Viewport interface
then the Operator is called to draw particles
in the current ActionList
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-07-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPFVIEWPORT_H_
#define _IPFVIEWPORT_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PFVIEWPORT_INTERFACE Interface_ID(0x1a340cb9, 0x26d12e01)
#define GetPFViewportInterface(obj) ((IPFViewport*)((GetPFObject(obj))->GetInterface(PFVIEWPORT_INTERFACE)))
class IPFViewport : public FPMixinInterface
{
public:
/** @defgroup IPFViewport IPFViewport.h
* @{
*/
/*! \fn virtual int Display(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, ViewExp *vpt, int flags) = 0;
* \brief The following methods are redirected from the particle object level to
a particular ActionList. The first parameter is a particle container of the ActionList.
\param pCont: particle container to draw particles from
\param time: current frame to draw particles at. It's supposed that the container has been already updated to satisfy this moment
\param pSystem: particle system that makes the call
\param psNode: INode of the particle system.
\param pgNode: INode of particle group. Particle system may have several particle groups according to number of ActionLists
\param vpt: viewport as of the BaseObject::Display(...) method
\param flags: flags as of the BaseObject::Display(...) method
*/
virtual int Display(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, ViewExp *vpt, int flags) = 0;
/*! \fn virtual int HitTest(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) = 0;
* \brief See virtual int Display()
*/
virtual int HitTest(IObject* pCont, TimeValue time, Object* pSystem, INode* psNode, INode* pgNode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt) = 0;
/*! \fn virtual void GetWorldBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
* \brief See virtual int Display()
*/
virtual void GetWorldBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
/*! \fn virtual void GetLocalBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
* \brief See virtual int Display()
*/
virtual void GetLocalBoundBox(IObject* pCont, TimeValue time, Object* pSystem, INode* pgNode, ViewExp* vp, Box3& box ) = 0;
/*! \fn virtual DWORD GetWireColor() const = 0;
* \brief See virtual int Display()
*/
virtual DWORD GetWireColor() const = 0;
/*! \fn virtual void SetWireColor(DWORD color) = 0;
* \brief See virtual int Display()
*/
virtual void SetWireColor(DWORD color) = 0;
/*! \fn virtual void MaybeEnlargeViewportRect(IObject* pCont, TimeValue time, GraphicsWindow *gw, Rect &rect) { ; }
* \brief See virtual int Display()
*/
virtual void MaybeEnlargeViewportRect(IObject* pCont, TimeValue time, GraphicsWindow *gw, Rect &rect) { ; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PFVIEWPORT_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PFVIEWPORT_INTERFACE); }
};
inline IPFViewport* PFViewportInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPFViewportInterface(obj));
};
inline IPFViewport* PFViewportInterface(INode* node) {
return ((node == NULL) ? NULL : PFViewportInterface(node->GetObjectRef()));
};
#endif // _IPFVIEWPORT_H_

View File

@ -0,0 +1,201 @@
/*! \file IPViewItem.h
\brief Interface for PViewItem. An Action should implement
the interface to be modifiable in Particle View.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 02-21-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPVIEWITEM_H_
#define _IPVIEWITEM_H_
#include "Max.h"
#include "PFExport.h"
PFExport Object* GetPFObject(Object* obj);
// interface ID
#define PVIEWITEM_INTERFACE Interface_ID(0x74f93d08, 0x1eb34500)
#define GetPViewItemInterface(obj) ((IPViewItem*)((GetPFObject(obj))->GetInterface(PVIEWITEM_INTERFACE)))
// operator/test icon size in particle view
enum { kActionImageWidth=22, kActionImageHeight=22 }; // in pixels
class IPViewItem : public FPMixinInterface
{
public:
// function IDs
enum { kNumPViewParamBlocks,
kGetPViewParamBlock,
kHasComments,
kGetComments,
kSetComments,
kGetWireExtension,
kSetWireExtension
};
BEGIN_FUNCTION_MAP
FN_0(kNumPViewParamBlocks, TYPE_INT, NumPViewParamBlocks );
FN_1(kGetPViewParamBlock, TYPE_REFTARG, GetPViewParamBlock, TYPE_INDEX );
FN_1(kHasComments, TYPE_bool, HasComments, TYPE_INODE );
FN_1(kGetComments, TYPE_STRING, GetComments, TYPE_INODE );
VFN_2(kSetComments, SetComments, TYPE_INODE, TYPE_STRING );
FN_2(kGetWireExtension, TYPE_INT, GetWireExtension, TYPE_INODE, TYPE_INT );
VFN_3(kSetWireExtension, SetWireExtension, TYPE_INODE, TYPE_INT, TYPE_INT );
END_FUNCTION_MAP
/** @defgroup IPViewItem IPViewItem.h
* @{
*/
// constructor: inherited as a base class constructor
IPViewItem() { m_numInstances = 1; }
/*! \fn virtual int NumPViewParamBlocks() const = 0;
* \brief
*/
virtual int NumPViewParamBlocks() const = 0;
/*! \fn virtual IParamBlock2* GetPViewParamBlock(int i) const = 0;
* \brief
*/
virtual IParamBlock2* GetPViewParamBlock(int i) const = 0;
/*! \fn PFExport int NumPViewParamMaps() const;
* \brief
*/
PFExport int NumPViewParamMaps() const;
/*! \fn PFExport IParamMap2* GetPViewParamMap(int i) const;
* \brief
*/
PFExport IParamMap2* GetPViewParamMap(int i) const;
/*! \fn PFExport void AddPViewParamMap(IParamMap2* map);
* \brief
*/
PFExport void AddPViewParamMap(IParamMap2* map);
/*! \fn PFExport void RemovePViewParamMap(IParamMap2* map);
* \brief
*/
PFExport void RemovePViewParamMap(IParamMap2* map);
/*! \fn bool HasCustomPViewIcons() { return false; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView.
*/
virtual bool HasCustomPViewIcons() { return false; }
/*! \fn HBITMAP GetActivePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For operator/test when in active state.
*/
virtual HBITMAP GetActivePViewIcon() { return NULL; }
/*! \fn HBITMAP GetInactivePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For operator when in disabled state.
*/
virtual HBITMAP GetInactivePViewIcon() { return NULL; }
/*! \fn HBITMAP GetTruePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For test when in "always true" state.
*/
virtual HBITMAP GetTruePViewIcon() { return NULL; }
/*! \fn HBITMAP GetFalsePViewIcon() { return NULL; }
* \brief Implement if you want your operator/test to be shown with a custom icon in ParticleView. For test when in "always false" state.
*/
virtual HBITMAP GetFalsePViewIcon() { return NULL; }
/*! \fn PFExport int GetNumInstances() const;
* \brief Used to track instanced actions. An action may have several instances, which PView shows in italic font.
*/
PFExport int GetNumInstances() const;
/*! \fn PFExport void SetNumInstances(int num);
* \brief Used to track instanced actions. An action may have several instances, which PView shows in italic font.
*/
PFExport void SetNumInstances(int num);
/*! \fn PFExport void IncNumInstances();
* \brief Used to track instanced actions. An action may have several instances, which PView shows in italic font.
*/
PFExport void IncNumInstances();
/*! \fn PFExport bool HasComments(INode* itemNode) const;
* \brief A PView item can have comments.
Comments are also shown and edited via right-click above the PView item.
*/
PFExport bool HasComments(INode* itemNode) const;
/*! \fn PFExport TSTR GetComments(INode* itemNode) const;
* \brief See HasComments().
*/
PFExport TSTR GetComments(INode* itemNode) const;
/*! \fn PFExport void SetComments(INode* itemNode, TSTR comments);
* \brief See HasComments().
*/
PFExport void SetComments(INode* itemNode, TSTR comments);
/*! \fn PFExport void EditComments(INode* itemNode, HWND parentWnd, long x, long y);
* \brief See HasComments().
*/
PFExport void EditComments(INode* itemNode, HWND parentWnd, long x, long y);
/*! \fn PFExport LRESULT CALLBACK commentsProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
* \brief For internal use
*/
PFExport LRESULT CALLBACK commentsProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
/*! \fn virtual bool HasDynamicName(TSTR& nameSuffix) { return false; }
* \brief For dynamic names support; if the action has a dynamic name then it supplies the name suffix
*/
virtual bool HasDynamicName(TSTR& nameSuffix) { return false; }
/*! \fn PFExport static int GetWireExtension(INode* node, int& wireHeight);
* \brief To read/modify the length/height of the wire nub extended from an emitter, or an action list, or a test.
You must supply the node of the item. This method returns wire length.
*/
PFExport static int GetWireExtension(INode* node, int& wireHeight);
/*! \fn PFExport static void SetWireExtension(INode* node, int wireLen, int wireHight);
* \brief Sets wire length. See GetWireExtension().
*/
PFExport static void SetWireExtension(INode* node, int wireLen, int wireHight);
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEM_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEM_INTERFACE); }
/*@}*/
private:
void add(INode* itemNode, HWND hWnd);
INode* node(HWND hWnd);
HWND hWnd(INode* itemNode);
void erase(HWND hWnd);
protected:
Tab<IParamMap2*> m_paramMaps;
int m_numInstances;
Tab<INode*> m_nodes;
Tab<HWND> m_hWnds;
};
inline IPViewItem* PViewItemInterface(Object* obj) {
return ((obj == NULL) ? NULL : GetPViewItemInterface(obj));
};
inline IPViewItem* PViewItemInterface(INode* node) {
return ((node == NULL) ? NULL : PViewItemInterface(node->GetObjectRef()));
};
#endif // _IPVIEWITEM_H_

View File

@ -0,0 +1,48 @@
/*! \file IPViewItemCreator.h
\brief Interface for PViewItemCreator. A ClassDesc2 should implement
the interface to be able to create PViewItems in the Pview.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-11-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPVIEWITEMCREATOR_H_
#define _IPVIEWITEMCREATOR_H_
#include "Max.h"
// interface ID
#define PVIEWITEMCREATOR_INTERFACE Interface_ID(0x74f93d0b, 0x1eb34500)
#define GetPViewItemCreatorInterface(obj) (IPViewItemCreator*)(obj->GetInterface(PVIEWITEMCREATOR_INTERFACE))
class IPViewItemCreator : public FPMixinInterface
{
public:
/** @defgroup IPViewItemCreator IPViewItemCreator.h
* @{
*/
/*! \fn virtual bool CreateItem(int pviewX, int pviewY, Tab<INode*> *anchorNodes, Tab<INode*> *showNodes) { return false; }
* \brief A PView item may have its own creation routine.
If so, then the item is given an opportunity to create itself when the item is created in Pview.
sourceNodes is a list of anchor nodes for PViews, showNodes is a list of all
additional nodes that are added to PView to show.
*/
virtual bool CreateItem(int pviewX, int pviewY, Tab<INode*> *anchorNodes, Tab<INode*> *showNodes) { return false; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEMCREATOR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWITEMCREATOR_INTERFACE); }
};
/*@}*/
#endif // _IPVIEWITEMCREATOR_H_

View File

@ -0,0 +1,499 @@
/*! \file IPViewManager.h
\brief Interface for ParticleView manager and an access method
to get the PViewManager from the scene.
There is a single PViewManager in the scene that
gives us access to all Particle Views
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-11-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPVIEWMANAGER_H_
#define _IPVIEWMANAGER_H_
#include "Max.h"
#include "PFExport.h"
#include "iparamb2.h"
// interface ID
#define PVIEWMANAGER_INTERFACE Interface_ID(0x74f93d07, 0x1eb34500)
#define GetPViewManagerInterface(obj) ((IPViewManager*)obj->GetInterface(PVIEWMANAGER_INTERFACE))
class IPViewManager : public FPMixinInterface
{
public:
// function IDs
enum { kOpenParticleView,
kUpdateParticleViews,
kPreUpdateParticleViews,
kPostUpdateParticleViews,
kUpdateOnHold,
kNumActionClasses,
kActionClass,
kActionName,
kNumPViewItemClasses,
kPViewItemClass,
kPViewItemName,
kParticleViewOpenCloseToggle,
kParticleFlowActivationToggle
};
BEGIN_FUNCTION_MAP
FN_1(kOpenParticleView, TYPE_bool, OpenParticleView, TYPE_OBJECT);
FN_1(kUpdateParticleViews, TYPE_bool, UpdateParticleViews, TYPE_bool);
FN_1(kPreUpdateParticleViews, TYPE_bool, PreUpdateParticleViews, TYPE_bool);
FN_1(kPostUpdateParticleViews, TYPE_bool, PostUpdateParticleViews, TYPE_bool);
FN_0(kUpdateOnHold, TYPE_bool, UpdateOnHold);
FN_0(kNumActionClasses, TYPE_INT, NumActionClasses );
FN_1(kActionClass, TYPE_CLASS, ActionClass, TYPE_INT);
FN_1(kActionName, TYPE_STRING, ActionName, TYPE_INT);
FN_0(kNumPViewItemClasses, TYPE_INT, NumPViewItemClasses );
FN_1(kPViewItemClass, TYPE_CLASS, PViewItemClass, TYPE_INT);
FN_1(kPViewItemName, TYPE_STRING, PViewItemName, TYPE_INT);
FN_0(kParticleViewOpenCloseToggle, TYPE_bool, ParticleViewOpenCloseToggle);
FN_1(kParticleFlowActivationToggle, TYPE_bool, ParticleFlowActivationToggle, TYPE_bool);
END_FUNCTION_MAP
/** @defgroup IPViewManager IPViewManager.h
* @{
*/
/*! \fn virtual bool OpenParticleView(Object* engine) = 0;
* \brief Opens ParticleView for a given PFEngine.
If there are several ParticleViews with the given PFEngine,
a dialog pops up to make a choice.
\param engine: PFEngine to open particle view for
*/
virtual bool OpenParticleView(Object* engine) = 0;
/*! \fn virtual bool UpdateParticleViews(bool additionsOnly=false) = 0;
* \brief If nothing was delete from PView then additionsOnly is set to true
*/
virtual bool UpdateParticleViews(bool additionsOnly=false) = 0;
/*! \fn virtual bool PreUpdateParticleViews(bool additionsOnly=false) = 0;
* \brief If procedures between Pre.. and Post.. involve additions of new items only then
set "additionsOnly" to "true". The rollup panel won't be updated.
*/
virtual bool PreUpdateParticleViews(bool additionsOnly=false) = 0;
/*! \fn virtual bool PostUpdateParticleViews(bool additionsOnly=false) = 0;
* \brief If procedures between Pre.. and Post.. involve additions of new items only then
set "additionsOnly" to "true". The rollup panel won't be updated.
*/
virtual bool PostUpdateParticleViews(bool additionsOnly=false) = 0;
/*! \fn virtual bool CancelUpdateParticleViews() = 0;
* \brief Not supported for maxscript
*/
virtual bool CancelUpdateParticleViews() = 0;
/*! \fn virtual bool UpdateOnHold() = 0;
* \brief Return true when in between PreUpdate and PostUpdate
*/
virtual bool UpdateOnHold() = 0;
/*! \fn virtual void UpdateParticleAmountShown() { ; }
* \brief Updates particle amount shown in PViews
*/
virtual void UpdateParticleAmountShown() { ; }
/*! \fn virtual void ActionProceedBegin(INode* actionNode) { ; }
* \brief Shows that an action starts the proceed
*/
virtual void ActionProceedBegin(INode* actionNode) { ; }
/*! \fn virtual void ActionProceedEnd(INode* actionNode) { ; }
* \brief Shows that an action ends the proceed
*/
virtual void ActionProceedEnd(INode* actionNode) { ; }
/*! \fn virtual bool IsParticleViewInForeground() { return false; }
* \brief Check if any ParticleView is a foreground window
*/
virtual bool IsParticleViewInForeground() { return false; }
/*! \fn PFExport static int NumActionClasses();
* \brief Public classes only.
*/
PFExport static int NumActionClasses(); // public classes only
/*! \fn PFExport static ClassDesc* ActionClass(int index);
* \brief
*/
PFExport static ClassDesc* ActionClass(int index);
/*! \fn PFExport static TCHAR* ActionName(int index);
* \brief
*/
PFExport static TCHAR* ActionName(int index);
/*! \fn PFExport static int NumPViewItemClasses();
* \brief Public classes only.
*/
PFExport static int NumPViewItemClasses();
/*! \fn PFExport static ClassDesc* PViewItemClass(int index);
* \brief
*/
PFExport static ClassDesc* PViewItemClass(int index);
/*! \fn PFExport static TCHAR* PViewItemName(int index);
* \brief
*/
PFExport static TCHAR* PViewItemName(int index);
/*! \fn virtual bool ParticleViewOpenCloseToggle() = 0;
* \brief Used for CUI shortcuts.
*/
virtual bool ParticleViewOpenCloseToggle() = 0;
/*! \fn virtual bool ParticleFlowActivationToggle(bool selectedOnly=false) = 0;
* \brief Used for CUI shortcuts.
*/
virtual bool ParticleFlowActivationToggle(bool selectedOnly=false) = 0;
/*! \fn virtual int GetVacantSpace() = 0;
* \brief Returns X coordinate of half-plane of space free from any PF item.
The method is usually used to calculate (x,y) location of newly created PF systems.
*/
virtual int GetVacantSpace() = 0;
/*! \fn virtual void KeepMaterial(Mtl* mtl) = 0;
* \brief The method is used to prevent automatic removal of non-used materials from the scene.
The method is used by Shape Instance operator. The operator creates combined materials on-the-fly
to be assigned to particles. When the reference object for the operator is changed, the material
is changed. The old material could be deleted because it doesn't have any more references in the
scene. This may create a problem for undo/redo operations. To prevent that this method creates
a reference dependency between PViewManager and the Material. Since PViewManager is not
saved with the scene, the materials won't be saved either.
*/
virtual void KeepMaterial(Mtl* mtl) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWMANAGER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PVIEWMANAGER_INTERFACE); }
/*! \fn friend PFExport IPViewManager* GetPViewManager();
friend PFExport void ReleasePViewManager();
* \brief Friend function declarations
*/
friend PFExport IPViewManager* GetPViewManager();
friend PFExport void ReleasePViewManager();
/*@}*/
protected:
PFExport IPViewManager();
PFExport virtual ~IPViewManager();
virtual void releaseManager() = 0;
static IPViewManager* m_manager; // the one and only PViewManager in the scene
static Tab<ClassEntry*> m_actionClasses;
static Tab<ClassEntry*> m_pViewItemClasses;
};
/** @defgroup IPViewManager IPViewManager.h
* @{
*/
/*! \fn PFExport IPViewManager* GetPViewManager();
* \brief Gets PViewManager from the scene
*/
PFExport IPViewManager* GetPViewManager();
/*! \fn PFExport INode *CreatePFNode( Object *obj);
* \brief Creates an INode used by ParticleFlow objects (actions, engines etc.)
The ParticleFlow INode has some properties that are different from a regular INode.
*/
PFExport INode *CreatePFNode( Object *obj);
/*! \fn PFExport void DeletePFNode(INode* node);
* \brief Deletes a PF-type INode. The ParticleFlow INode has some properties that are
different from a regular INode. Also, deleting a node by the methods cleans up
the scene from associated elements, for example deleting a PF emitter also
removes all global actions and exclusive actionLists downstream.
There won't be any harm done if a regular INode is deleted by the method.
The plug-in is able to classify the given node to choose the appropriate way of action.
*/
PFExport void DeletePFNode(INode* node);
/*! \fn PFExport bool AppendPFAction(INode* actionList, INode* action);
* \brief There is a special relationship between an action list and an action.
The following four methods ensure the consistency in this relationship.
Since PF particle system has a list of global action, the system can also
be considered as an action list.
*/
PFExport bool AppendPFAction(INode* actionList, INode* action);
/*! \fn PFExport bool InsertPFAction(INode* actionList, INode* action, int indexAt);
* \brief Ensures consistency in relationship between action list and action. See AppendPFAction();
*/
PFExport bool InsertPFAction(INode* actionList, INode* action, int indexAt);
/*! \fn PFExport bool RemovePFAction(INode* actionList, int index);
* \brief Ensures consistency in relationship between action list and action. See AppendPFAction();
*/
PFExport bool RemovePFAction(INode* actionList, int index);
/*! \fn PFExport bool RemovePFAction(INode* actionList, INode* action);
* \brief Ensures consistency in relationship between action list and action. See AppendPFAction();
*/
PFExport bool RemovePFAction(INode* actionList, INode* action);
/*! \fn PFExport int GetPViewVacantSpace(INode* excludeNode=NULL);
* \brief Returns X coordinate of half-plane of space free from any PF item.
The method is usually used to calculate (x,y) location of newly created PF systems.
If given node is not NULL, then the node is excluded from consideration while looking
for free PView space.
*/
PFExport int GetPViewVacantSpace(INode* excludeNode=NULL);
/*! \fn PFExport int GetPViewMaximumZOrderIndex(INode* excludeNode=NULL);
* \brief All items in PView are shown according to their Z order index.
Returns the highest Z order index amongst all particle systems and action lists.
*/
PFExport int GetPViewMaximumZOrderIndex(INode* excludeNode=NULL);
/*! \fn PFExport bool CompactPViewZOrder();
* \brief The Z order sequence may have some "holes". The method makes the sequence to
be more compact by eliminating these "holes".
Returns true if there were "holes"; and false if it is already compact.
*/
PFExport bool CompactPViewZOrder();
/*! \fn PFExport void RegisterParticleFlowNotification();
* \brief ParticleFlow has to track creation of new PF items.
For ParticleFlow Shell: the system creates a default configuration and sets PView location.
For ActionList: the system sets PView location.
For Action: the system creates an ActionList that includes the Action, and sets PView location.
To avoid this extra effort from the system side, use Suspend/Resume methods.
*/
PFExport void RegisterParticleFlowNotification();
/*! \fn PFExport void SuspendParticleFlowNotification();
* \brief Avoids extra effort for tracking. See RegisterParticleFlowNotification();
*/
PFExport void SuspendParticleFlowNotification();
/*! \fn PFExport void ResumeParticleFlowNotification();
* \brief Avoids extra effort for tracking. See RegisterParticleFlowNotification();
*/
PFExport void ResumeParticleFlowNotification();
/*! \fn PFExport bool IsParticleFlowNotificationSuspended();
* \brief Avoids extra effort for tracking. See RegisterParticleFlowNotification();
*/
PFExport bool IsParticleFlowNotificationSuspended();
/*! \fn PFExport void ReleasePViewManager();
* \brief The method is used to release PViewManager when a scene is closed.
For internal use only.
*/
PFExport void ReleasePViewManager();
/*! \fn PFExport int GetPFInt(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
* \brief GetPFInt, GetPFFloat and GetPFTimeValue reinforce value boundaries set for parameter values.
Can be used instead of pblock()->GetInt and pblock()->GetFloat to be
sure that the result values are stay inside the parameter boundaries no matter what.
*/
PFExport int GetPFInt(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
/*! \fn PFExport float GetPFFloat(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
* \brief See GetPFInt();
*/
PFExport float GetPFFloat(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
/*! \fn PFExport TimeValue GetPFTimeValue(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
* \brief See GetPFInt();
*/
PFExport TimeValue GetPFTimeValue(IParamBlock2* pblock, ParamID id, TimeValue t=0, int tabIndex=0);
/*! \fn PFExport bool ValidateParticleFlows();
* \brief For internal use. The method is used to make all ParticleFlow elements valid.
The method traverses the scene to collect all ParticleFlow elements
then it removes the invalid ones and fixes elements that are fixable.
Returns true is the scene was valid, and false if the scene was invalid.
*/
PFExport bool ValidateParticleFlows();
enum { kPFDefaultDisplay_global, kPFDefaultDisplay_local };
/*! \fn PFExport int GetPFDefaultDisplay();
* \brief
*/
PFExport int GetPFDefaultDisplay();
/*! \fn PFExport void SetPFDefaultDisplay(int type);
* \brief
*/
PFExport void SetPFDefaultDisplay(int type);
/*! \fn PFExport void InitPFDefaultDisplay(int type);
* \brief
*/
PFExport void InitPFDefaultDisplay(int type);
enum { kPFActionOrder_globalsFirst, kPFActionOrder_localsFirst };
/*! \fn PFExport int GetPFActionOrder();
* \brief
*/
PFExport int GetPFActionOrder();
/*! \fn PFExport void SetPFActionOrder(int order);
* \brief
*/
PFExport void SetPFActionOrder(int order);
/*! \fn PFExport void InitPFActionOrder(int order);
* \brief
*/
PFExport void InitPFActionOrder(int order);
// PF particle system has different modes for update.
// Forward mode: particles aren't updated right away. At playback time the particle history is
// not recalculated. Only new events that will happen with the particles have new settings
// Complete mode: the whole particle animation is recalculated.
enum { kPFUpdateType_complete, kPFUpdateType_forward };
/*! \fn PFExport int GetPFUpdateType();
* \brief
*/
PFExport int GetPFUpdateType();
/*! \fn PFExport void SetPFUpdateType(int type);
* \brief
*/
PFExport void SetPFUpdateType(int type);
/*! \fn PFExport void InitPFUpdateType(int type);
* \brief
*/
PFExport void InitPFUpdateType(int type);
// names of actions in PView may have a dynamic suffix to reflect the most important settings of the action
enum { kPFDynamicNames_no, kPFDynamicNames_yes };
/*! \fn PFExport int GetPFDynamicNames();
* \brief Names of actions in PView may have a dynamic suffix to reflect the most important settings of the action.
*/
PFExport int GetPFDynamicNames();
/*! \fn PFExport void SetPFDynamicNames(int type);
* \brief Names of actions in PView may have a dynamic suffix to reflect the most important settings of the action.
*/
PFExport void SetPFDynamicNames(int type);
/*! \fn PFExport void InitPFDynamicNames(int type);
* \brief Names of actions in PView may have a dynamic suffix to reflect the most important settings of the action.
*/
PFExport void InitPFDynamicNames(int type);
/*! \fn PFExport void DisableParticleInvalidation();
* \brief Particle system and operators/tests may have reference object (i.e. define an emitting area).
An operator may require TM of a reference object at different moments. If the reference object
has a complex controller, the action of requesting the state of the reference object, if the time
is different from the current time, may inflict REFMSG_CHANGE message thus provoking invalidation
of the whole particle system. To prevent that, at the moment of acquiring the reference object TMs,
the operator should disable particle invalidation, and then enable the invalidation when it is done
with the reference object.
*/
PFExport void DisableParticleInvalidation();
/*! \fn PFExport void EnableParticleInvalidation();
* \brief See DisableParticleInvalidation();
*/
PFExport void EnableParticleInvalidation();
/*! \fn PFExport bool IsAbleInvalidateParticles();
* \brief See DisableParticleInvalidation();
*/
PFExport bool IsAbleInvalidateParticles();
/*! \fn PFExport void SetIgnoreEmitterTMChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void SetIgnoreEmitterTMChange();
/*! \fn PFExport void ClearIgnoreEmitterTMChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void ClearIgnoreEmitterTMChange();
/*! \fn PFExport bool IsIgnoringEmitterTMChange();
* \brief See DisableParticleInvalidation();
*/
PFExport bool IsIgnoringEmitterTMChange();
/*! \fn PFExport void SetIgnoreEmitterPropChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void SetIgnoreEmitterPropChange();
/*! \fn PFExport void ClearIgnoreEmitterPropChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void ClearIgnoreEmitterPropChange();
/*! \fn PFExport bool IsIgnoringEmitterPropChange();
* \brief For more selective tuning in notification change
*/
PFExport bool IsIgnoringEmitterPropChange();
/*! \fn PFExport void SetIgnoreRefNodeChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void SetIgnoreRefNodeChange();
/*! \fn PFExport void ClearIgnoreRefNodeChange();
* \brief See DisableParticleInvalidation();
*/
PFExport void ClearIgnoreRefNodeChange();
/*! \fn PFExport bool IsIgnoringRefNodeChange();
* \brief See DisableParticleInvalidation();
*/
PFExport bool IsIgnoringRefNodeChange();
/*! \fn PFExport void SetPFProceedStatus();
* \brief When a particle system is in the process of calculation/evaluation, it is not advisable to invalidate
particle containers. This method sets the proceed status.
*/
PFExport void SetPFProceedStatus();
/*! \fn PFExport void ClearPFProceedStatus();
* \brief When a particle system is in the process of calculation/evaluation, it is not advisable to invalidate
particle containers. This method clears the proceed status.
*/
PFExport void ClearPFProceedStatus();
/*! \fn PFExport bool IsPFProceeding();
* \brief When a particle system is in the process of calculation/evaluation, it is not advisable to invalidate
particle containers. This method checks if PF is proceeding.
*/
PFExport bool IsPFProceeding();
/*! \fn PFExport Object* GetPFObject(Object* obj);
* \brief ParticleFlow relays on presence of specific interfaces in PF objects. Sometimes the objects are
hidden behind layers of XRef objects and WSM modifiers. To reach the real PF object underneath,
use this method.
*/
PFExport Object* GetPFObject(Object* obj);
// constants for particle view spacement and location
enum { kPViewActionListHorSpace=20 };
/*@}*/
#endif // _IPFINTEGRATOR_H_

View File

@ -0,0 +1,266 @@
/*! \file IParticleChannel.h
\brief Channel-generic interfaces IParticleChannel
This is a part of every particle channel.
Helps to determine read/write category of the given
particle interface and to manage memory deallocation
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-09-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNEL_H_
#define _IPARTICLECHANNEL_H_
#include "Max.h"
#include "PFExport.h"
// interface ID
#define PARTICLECHANNEL_INTERFACE Interface_ID(0x74f93b00, 0x1eb34400)
#define GetParticleChannelInterface(obj) ((IParticleChannel*)obj->GetInterface(PARTICLECHANNEL_INTERFACE))
class IParticleChannel : public FPMixinInterface
{
public:
// function IDs
enum { kClone,
kIsSimilarChannel,
kIsTransferable,
kSetTransferable,
kIsPrivateChannel,
kGetPrivateOwner,
kSetPrivateOwner,
kGetCreatorAction,
kSetCreatorAction,
kGetReadID_PartA,
kGetReadID_PartB,
kGetWriteID_PartA,
kGetWriteID_PartB,
kSetReadID,
kSetWriteID
};
// chunk IDs for saving and loading
// developer: you may have your own chunk IDs
// they are factored here for convenience
enum { kChunkCount = 1000,
kChunkData = 1010,
kChunkGlobalCount = 1020,
kChunkSharedCount = 1021,
kChunkGlobalValue = 1030,
kChunkSharedValue = 1031,
kChunkReadID = 1040,
kChunkWriteID = 1050,
kChunkTransferable = 1055,
kChunkPrivate = 1056,
kChunkActionHandle = 1057,
kChunkValue1 = 1061,
kChunkValue2 = 1062,
kChunkValue3 = 1063,
kChunkValue4 = 1064,
kChunkValue5 = 1065,
kChunkValue6 = 1066,
kChunkValue7 = 1067
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0(kClone, TYPE_IOBJECT, Clone);
FN_1(kIsSimilarChannel, TYPE_bool, IsSimilarChannel, TYPE_IOBJECT);
FN_0(kIsTransferable, TYPE_bool, IsTransferable);
VFN_1(kSetTransferable, SetTransferable, TYPE_bool);
FN_0(kIsPrivateChannel, TYPE_bool, IsPrivateChannel);
FN_0(kGetPrivateOwner, TYPE_OBJECT, GetPrivateOwner);
VFN_1(kSetPrivateOwner, SetPrivateOwner, TYPE_OBJECT);
FN_0(kGetCreatorAction, TYPE_INODE, GetCreatorAction);
VFN_1(kSetCreatorAction, SetCreatorAction, TYPE_INODE);
FN_0(kGetReadID_PartA, TYPE_DWORD, GetReadID_PartA);
FN_0(kGetReadID_PartB, TYPE_DWORD, GetReadID_PartB);
FN_0(kGetWriteID_PartA, TYPE_DWORD, GetWriteID_PartA);
FN_0(kGetWriteID_PartB, TYPE_DWORD, GetWriteID_PartB);
VFN_2(kSetReadID, SetReadID, TYPE_DWORD, TYPE_DWORD);
VFN_2(kSetWriteID, SetWriteID, TYPE_DWORD, TYPE_DWORD);
END_FUNCTION_MAP
/** @defgroup IParticleChannel IParticleChannel.h
* @{
*/
/*! \fn PFExport IParticleChannel();
* \brief
*/
PFExport IParticleChannel();
/*! \fn PFExport IParticleChannel(const Interface_ID& readID, const Interface_ID&
* \brief
*/
PFExport IParticleChannel(const Interface_ID& readID, const Interface_ID& writeID);
/*! \fn virtual Class_ID GetClassID() const = 0;
* \brief Returns the unique ID for the channel class. The ID is used for constructing the channel when loading since the channel class is not inherited from class Animatable.
*/
virtual Class_ID GetClassID() const = 0;
/*! \fn virtual IObject* Clone() const = 0;
* \brief cloning; make a copy of the channel
*/
virtual IObject* Clone() const = 0;
/*! \fn virtual IOResult Save(ISave* isave) const = 0;
* \brief saving content of the channel to file
*/
virtual IOResult Save(ISave* isave) const = 0;
/*! \fn virtual IOResult Load(ILoad* iload) = 0;
* \brief loading content of the channel from file
*/
virtual IOResult Load(ILoad* iload) = 0;
/*! \fn PFExport bool IsSimilarChannel(IObject* channel) const;
* \brief checks if the given IObject is a similar particle channel
*/
PFExport bool IsSimilarChannel(IObject* channel) const;
/*! \fn PFExport bool IsTransferable() const;
* \brief Get "transferable" status. If particle channel is transferable then it is transferred from one event to another; the data in the channel are glued to particles if particle channel is not transferable then while particles moves to another event, the particle channel is not
*/
PFExport bool IsTransferable() const;
/*! \fn PFExport void SetTransferable(bool status);
* \brief Set "transferable" status.
*/
PFExport void SetTransferable(bool status);
/*! \fn PFExport bool IsPrivateChannel() const;
* \brief A channel can be declared "private" by an action.
when a channel is declared as a "private" a reference on a "private owner" is given
then only the "private owner" action will be given access to this channel.
the technique allows creating several channels with the same data-type (for example,
position) in the container by different "private owner" actions
Because of access to particle container, onle an action that created the channel
can declare itself as a private owner.
*/
PFExport bool IsPrivateChannel() const;
/*! \fn PFExport Object* GetPrivateOwner() const;
* \brief returns a "private owner" action of the channel
*/
PFExport Object* GetPrivateOwner() const;
/*! \fn PFExport void SetPrivateOwner(Object* action);
* \brief sets a "private owner" action of the channel
*/
PFExport void SetPrivateOwner(Object* action);
/*! \fn PFExport INode* GetCreatorAction() const;
* \brief channel data can be viewed by different actions. however an action that created the channel is responsible for data initialization. therefore the action has to keep track
how (by what action) the channel was created
*/
PFExport INode* GetCreatorAction() const;
/*! \fn PFExport void SetCreatorAction(INode* actionNode);
* \brief channel data can be viewed by different actions. however an action that created the channel is responsible for data initialization. therefore the action has to keep track
how (by what action) the channel was created
*/
PFExport void SetCreatorAction(INode* actionNode);
/*! \fn PFExport DWORD GetReadID_PartA() const;
* \brief Set/get a concrete channel ID for a generic data particle channel. Access read-interface ID of the wrapping channel.
*/
PFExport DWORD GetReadID_PartA() const;
/*! \fn PFExport DWORD GetReadID_PartB() const;
* \brief Set/get a concrete channel ID for a generic data particle channel. Access read-interface ID of the wrapping channel.
*/
PFExport DWORD GetReadID_PartB() const;
/*! \fn PFExport DWORD GetWriteID_PartA() const;
* \brief access write-interface ID of the wrapping channel
*/
PFExport DWORD GetWriteID_PartA() const;
/*! \fn PFExport DWORD GetWriteID_PartB() const;
* \brief access write-interface ID of the wrapping channel
*/
PFExport DWORD GetWriteID_PartB() const;
/*! \fn PFExport void SetReadID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
* \brief set up read-interface ID of the wrapping channel
*/
PFExport void SetReadID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
/*! \fn PFExport void SetWriteID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
* \brief set up write-interface ID of the wrapping channel
*/
PFExport void SetWriteID(DWORD interfaceID_PartA, DWORD interfaceID_PartB);
/*! \fn PFExport const Interface_ID& GetReadID() const;
* \brief methods that are not in FnPub interface. Access read-interface ID of the wrapping channel.
*/
PFExport const Interface_ID& GetReadID() const;
/*! \fn PFExport const Interface_ID& GetWriteID() const;
* \brief access write-interface ID of the wrapping channel
*/
PFExport const Interface_ID& GetWriteID() const;
/*! \fn PFExport void SetReadID(const Interface_ID& id);
* \brief set up read-interface ID of the wrapping channel
*/
PFExport void SetReadID(const Interface_ID& id);
/*! \fn PFExport void SetWriteID(const Interface_ID& id);
* \brief set up write-interface ID of the wrapping channel
*/
PFExport void SetWriteID(const Interface_ID& id);
/*! \fn PFExport void CloneChannelCore(IParticleChannel* getFrom);
* \brief when cloning a channel, data about transferable, privateOwner, creatorAction, readID & write ID should be cloned. the following method does that: it clones the core data from the given channel
*/
PFExport void CloneChannelCore(IParticleChannel* getFrom);
/*! \fn PFExport void UpdateCreatorHandle(IMergeManager* pMM);
* \brief when cached channel data are merged the stored action creator handle could be invalid.
the method lets the channel to update the action handle to the proper one
*/
PFExport void UpdateCreatorHandle(IMergeManager* pMM);
/*! \fn virtual int MemoryUsed() const = 0;
* \brief returns amount of memory used (in bytes) by the channel to store the information
*/
virtual int MemoryUsed() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNEL_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNEL_INTERFACE); }
protected:
bool m_isTransferable;
bool m_isPrivate;
mutable Object* m_privateOwner; // could be derived from creatorAction
mutable INode* m_creatorAction; // could be derived from creatorHandle
ULONG m_creatorHandle;
// wrapper ids
Interface_ID m_readID, m_writeID;
int numRefs() const { return m_numRefs; }
int& _numRefs() { return m_numRefs; }
private:
int m_numRefs;
};
#endif // _IPARTICLECHANNEL_H_

View File

@ -0,0 +1,35 @@
/*! \file IParticleChannelAcceleration.h
\brief Channel-specific interface for ParticleChannelAcceleration
Acceleration is stored in absolute world coordianates
The acceleration is in units per tick<63>
The channel is a wrap around ParticleChannelPoint3
The acceleration values are set to zero (Point3::Origin)
after each integration step. Therefore an operator that
modifies the channel has to repeat the modification on
every 'Proceed' call even if the value to be set is the
same.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-19-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELACCELERATION_H_
#define _IPARTICLECHANNELACCELERATION_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "Acceleration"
// interface ID
#define PARTICLECHANNELACCELERATIONR_INTERFACE Interface_ID(0x74f93b08, 0x1eb34500)
#define PARTICLECHANNELACCELERATIONW_INTERFACE Interface_ID(0x74f93b08, 0x1eb34501)
#define GetParticleChannelAccelerationRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELACCELERATIONR_INTERFACE))
#define GetParticleChannelAccelerationWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELACCELERATIONW_INTERFACE))
#endif // _IPARTICLECHANNELACCELERATION_H_

View File

@ -0,0 +1,156 @@
/*! \file IParticleChannelAmount.h
\brief Channel-generic interfaces ParticleChannelAmount
This is a part of every particle channel and
particle container
ParticleChannelAmount is a two-part interface:
for read (R) and write (W)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-05-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELAMOUNT_H_
#define _IPARTICLECHANNELAMOUNT_H_
#include "Max.h"
// interface ID
#define PARTICLECHANNELAMOUNTR_INTERFACE Interface_ID(0x74f93b00, 0x1eb34500)
#define PARTICLECHANNELAMOUNTW_INTERFACE Interface_ID(0x74f93b00, 0x1eb34501)
#define GetParticleChannelAmountRInterface(obj) ((IParticleChannelAmountR*)obj->GetInterface(PARTICLECHANNELAMOUNTR_INTERFACE))
#define GetParticleChannelAmountWInterface(obj) ((IParticleChannelAmountW*)obj->GetInterface(PARTICLECHANNELAMOUNTW_INTERFACE))
class IParticleChannelAmountR : public FPMixinInterface
{
public:
// function IDs Read
enum { kCount
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_0(kCount, TYPE_INT, Count);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAmount IParticleChannelAmount.h
* @{
*/
/*! \fn virtual int Count() const = 0;
* \brief Particle count management; number of particles in the channel
*/
virtual int Count() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTR_INTERFACE); }
};
class IParticleChannelAmountW : public FPMixinInterface
{
public:
// function IDs Write
enum { kZeroCount,
kSetCount,
kDeleteByIndex,
kDeleteByArray,
kSplit,
kSpawn,
kAppendNum,
kAppend
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_0(kZeroCount, ZeroCount);
FN_1(kSetCount, TYPE_bool, SetCount, TYPE_INT);
FN_2(kDeleteByIndex, TYPE_INT, Delete, TYPE_INT, TYPE_INT);
FN_1(kDeleteByArray, TYPE_INT, Delete, TYPE_BITARRAY_BR);
FN_1(kSplit, TYPE_IOBJECT, Split, TYPE_BITARRAY_BR);
FN_1(kSpawn, TYPE_bool, Spawn, TYPE_INT_TAB_BR);
FN_1(kAppendNum, TYPE_bool, AppendNum, TYPE_INT);
FN_1(kAppend, TYPE_bool, Append, TYPE_IOBJECT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAmount IParticleChannelAmount.h
* @{
*/
/*! \fn virtual void ZeroCount() = 0;
* \brief set number of particles in the channel to zero
*/
virtual void ZeroCount() = 0;
/*! \fn virtual bool SetCount(int n) = 0;
* \brief set number of particles in the channel to n
*/
virtual bool SetCount(int n) = 0;
/*! \fn virtual int Delete(int start,int num) = 0;
* \brief Delete num particles from start index. Returns number of particles left in the channel.
*/
virtual int Delete(int start,int num) = 0;
/*! \fn virtual int Delete(BitArray& toRemove) = 0;
* \brief Delete particles according to the BitArray (bit set == remove). Returns number of particles left in the channel
*/
virtual int Delete(BitArray& toRemove) = 0;
/*! \fn virtual IObject* Split(BitArray& toSplit) = 0;
* \brief To new "split" particle channel. Returns new particle channel; IObject type is chosen to be
compatible with the available return types. All "bit-set" particles are moved.
*/
virtual IObject* Split(BitArray& toSplit) = 0;
/*! \fn virtual bool Spawn( Tab<int>& spawnTable ) = 0;
* \brief Spawn particles according to the spawnTable. Returns true if the operation is successful.
Size of the table equals to number of particles in the channel. Table value is how many particles are cloned from the index particle.
*/
virtual bool Spawn( Tab<int>& spawnTable ) = 0;
/*! \fn virtual bool AppendNum(int num) = 0;
* \brief Append num particles to the channel(s). Returns true if the operation is successful.
*/
virtual bool AppendNum(int num) = 0;
/*! \fn virtual bool Append(IObject* obj) = 0;
* \brief Append all particles of another channel/container, then the input channel/container is deleted.
Returns true if the operation is successful.
*/
virtual bool Append(IObject* obj) = 0;
/*! \fn virtual void ResetAddedAmount() { ; }
* \brief For internal use; no need to implement
*/
virtual void ResetAddedAmount() { ; }
/*! \fn virtual int GetAddedAmount() { return 0; }
* \brief For internal use; no need to implement
*/
virtual int GetAddedAmount() { return 0; }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELAMOUNTW_INTERFACE); }
};
#endif // _IPARTICLECHANNELAMOUNT_H_

View File

@ -0,0 +1,115 @@
/*! \file IParticleChannelAngAxis.h
\brief Channel-generic interfaces for particle channels that
store angle/axis data.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-09-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELANGAXIS_H_
#define _IPARTICLECHANNELANGAXIS_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "AngAxis"
// interface ID
#define PARTICLECHANNELANGAXISR_INTERFACE Interface_ID(0x74f93c0d, 0x1eb34500)
#define PARTICLECHANNELANGAXISW_INTERFACE Interface_ID(0x74f93c0d, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelAngAxisRInterface(obj) ((IParticleChannelAngAxisR*)obj->GetInterface(PARTICLECHANNELANGAXISR_INTERFACE))
//#define GetParticleChannelAngAxisWInterface(obj) ((IParticleChannelAngAxisW*)obj->GetInterface(PARTICLECHANNELANGAXISW_INTERFACE))
class IParticleChannelAngAxisR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_ANGAXIS_BR, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_ANGAXIS_BR, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAngAxis IParticleChannelAngAxis.h
* @{
*/
/*! \fn virtual const AngAxis& GetValue(int index) const = 0;
* \brief Get property for particle with index
*/
virtual const AngAxis& GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief Verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual const AngAxis& GetValue() const = 0;
* \brief If channel is global returns the global value. If channel is not global returns value of the first particle.
Returns bounding box for all particles.
*/
virtual const AngAxis& GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISR_INTERFACE); }
};
class IParticleChannelAngAxisW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_ANGAXIS_BR);
VFN_1(kSetValueGlobal, SetValue, TYPE_ANGAXIS_BR);
END_FUNCTION_MAP
/** @defgroup IParticleChannelAngAxis IParticleChannelAngAxis.h
* @{
*/
/*! \fn virtual void SetValue(int index, const AngAxis& v) = 0;
* \brief Set property for particle with index
*/
virtual void SetValue(int index, const AngAxis& v) = 0;
/*! \fn virtual void SetValue(const AngAxis& v) = 0;
* \brief Set property for all particles at once thus making the channel global
*/
virtual void SetValue(const AngAxis& v) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELANGAXISW_INTERFACE); }
};
#endif // _IPARTICLECHANNELANGAXIS_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelBirthTime.h
\brief Channel-specific interfaces for ParticleChannelBirthTime
The channel is used to store time of birth for a particle
The channel is a wrap around ParticleChannelPTV
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-29-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELBIRTHTIME_H_
#define _IPARTICLECHANNELBIRTHTIME_H_
#include "IParticleChannelPTV.h"
// standard particle channel "BirthTime"
// interface ID
#define PARTICLECHANNELBIRTHTIMER_INTERFACE Interface_ID(0x74f93b04, 0x1eb34500)
#define PARTICLECHANNELBIRTHTIMEW_INTERFACE Interface_ID(0x74f93b04, 0x1eb34501)
#define GetParticleChannelBirthTimeRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELBIRTHTIMER_INTERFACE))
#define GetParticleChannelBirthTimeWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELBIRTHTIMEW_INTERFACE))
#endif // _IPARTICLECHANNELBIRTHSTART_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelBool.h
\brief Channel-generic interfaces for particle channels that store bool data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 02-20-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELBOOL_H_
#define _IPARTICLECHANNELBOOL_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "bool"
// interface ID
#define PARTICLECHANNELBOOLR_INTERFACE Interface_ID(0x74f93c04, 0x1eb34500)
#define PARTICLECHANNELBOOLW_INTERFACE Interface_ID(0x74f93c04, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelBoolRInterface(obj) ((IParticleChannelBoolR*)obj->GetInterface(PARTICLECHANNELBOOLR_INTERFACE))
//#define GetParticleChannelBoolWInterface(obj) ((IParticleChannelBoolW*)obj->GetInterface(PARTICLECHANNELBOOLW_INTERFACE))
class IParticleChannelBoolR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_bool, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_bool, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelBool IParticleChannelBool.h
* @{
*/
/*! \fn virtual bool GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual bool GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual bool GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle
*/
virtual bool GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLR_INTERFACE); }
};
class IParticleChannelBoolW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_bool);
VFN_1(kSetValueGlobal, SetValue, TYPE_bool);
END_FUNCTION_MAP
/** @defgroup IParticleChannelBool IParticleChannelBool.h
* @{
*/
/*! \fn virtual void SetValue(int index, bool value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, bool value) = 0;
/*! \fn virtual void SetValue(bool value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(bool value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELBOOLW_INTERFACE); }
};
#endif // _IPARTICLECHANNELBOOL_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelDeathTime.h
\brief Channel-specific interfaces for ParticleChannelDeathTime
The channel is used to store time of death for a particle
The channel is a wrap around ParticleChannelPTV
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 09-27-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELDEATHTIME_H_
#define _IPARTICLECHANNELDEATHTIME_H_
#include "IParticleChannelPTV.h"
// standard particle channel "DeathTime"
// interface ID
#define PARTICLECHANNELDEATHTIMER_INTERFACE Interface_ID(0x74f93b18, 0x1eb34500)
#define PARTICLECHANNELDEATHTIMEW_INTERFACE Interface_ID(0x74f93b18, 0x1eb34501)
#define GetParticleChannelDeathTimeRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELDEATHTIMER_INTERFACE))
#define GetParticleChannelDeathTimeWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELDEATHTIMEW_INTERFACE))
#endif // _IPARTICLECHANNELDEATHSTART_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelEventStart.h
\brief Channel-specific interfaces for ParticleChannelEventStart
The channel is used to store a moment of entering current Event
The channel is a wrap around ParticleChannelPTV
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-30-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELEVENTSTART_H_
#define _IPARTICLECHANNELEVENTSTART_H_
#include "IParticleChannelPTV.h"
// standard particle channel "EventStart"
// interface ID
#define PARTICLECHANNELEVENTSTARTR_INTERFACE Interface_ID(0x74f93b05, 0x1eb34500)
#define PARTICLECHANNELEVENTSTARTW_INTERFACE Interface_ID(0x74f93b05, 0x1eb34501)
#define GetParticleChannelEventStartRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELEVENTSTARTR_INTERFACE))
#define GetParticleChannelEventStartWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELEVENTSTARTW_INTERFACE))
#endif // _IPARTICLECHANNELEVENTSTART_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelFloat.h
\brief Channel-generic interfaces for particle channels that store float data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 01-24-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELFLOAT_H_
#define _IPARTICLECHANNELFLOAT_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Float"
// interface ID
#define PARTICLECHANNELFLOATR_INTERFACE Interface_ID(0x74f93c00, 0x1eb34500)
#define PARTICLECHANNELFLOATW_INTERFACE Interface_ID(0x74f93c00, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelFloatRInterface(obj) ((IParticleChannelFloatR*)obj->GetInterface(PARTICLECHANNELFLOATR_INTERFACE))
//#define GetParticleChannelFloatWInterface(obj) ((IParticleChannelFloatW*)obj->GetInterface(PARTICLECHANNELFLOATW_INTERFACE))
class IParticleChannelFloatR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_FLOAT, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_FLOAT, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelFloat IParticleChannelFloat.h
* @{
*/
/*! \fn virtual float GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual float GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual float GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle.
*/
virtual float GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATR_INTERFACE); }
};
class IParticleChannelFloatW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_FLOAT);
VFN_1(kSetValueGlobal, SetValue, TYPE_FLOAT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelFloat IParticleChannelFloat.h
* @{
*/
/*! \fn virtual void SetValue(int index, float value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, float value) = 0;
/*! \fn virtual void SetValue(float value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(float value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELFLOATW_INTERFACE); }
};
#endif // _IPARTICLECHANNELFLOAT_H_

View File

@ -0,0 +1,132 @@
/*! \file IParticleChannelID.h
\brief Channel-specific interfaces for ParticleChannelID. The channel is used to identify particles.
Particle ID consists of two integers: particleIndex and
particleBorn. ParticleIndex gives relative correspondense
to the whole amount of particles. If PF ParticleAmountMultiplier
is set to 100% then the given particleIndex are successive
ordinal numbers. If it's set to 50% then the given particle indeces
are 0, 2, 4, 6 etc. If it is a Birth by Total Number then the
last particle born has an index of the total number whatever
multiplier is. ParticleBorn number always are successive
ordinal numbers when particles were born: 0, 1, 2, 3 etc.
If ParticleAmountMultiplier equals 100% then for a
particular particle particleIndex and particleBorn are the
same number. If ParticleAmountMultiplier is greater then
100% then you may have several particles with the same
particleIndex. It is recommended to link non-random properties to
particleIndex and random properties to particleBorn.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-04-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELID_H_
#define _IPARTICLECHANNELID_H_
// standard particle channel "particleID"
// interface ID
#define PARTICLECHANNELIDR_INTERFACE Interface_ID(0x74f93b02, 0x1eb34500)
#define PARTICLECHANNELIDW_INTERFACE Interface_ID(0x74f93b02, 0x1eb34501)
#define GetParticleChannelIDRInterface(obj) ((IParticleChannelIDR*)obj->GetInterface(PARTICLECHANNELIDR_INTERFACE))
#define GetParticleChannelIDWInterface(obj) ((IParticleChannelIDW*)obj->GetInterface(PARTICLECHANNELIDW_INTERFACE))
// function IDs Read
enum { particleChannelID_getID,
particleChannelID_getParticleIndex,
particleChannelID_getParticleBorn
};
// function IDs Write
enum { particleChannelID_setID
};
struct ParticleID {
int index;
int born;
};
class IParticleChannelIDR : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_3(particleChannelID_getID, GetID, TYPE_INT, TYPE_INT_BR, TYPE_INT_BR);
FN_1(particleChannelID_getParticleIndex, TYPE_INT, GetParticleIndex, TYPE_INT);
FN_1(particleChannelID_getParticleBorn, TYPE_INT, GetParticleBorn, TYPE_INT);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelID IParticleChannelID.h
* @{
*/
/*! \fn virtual void GetID(int index, int& particleIndex, int& particleBorn) const = 0;
* \brief
*/
virtual void GetID(int index, int& particleIndex, int& particleBorn) const = 0;
/*! \fn virtual int GetParticleIndex(int index) const = 0;
* \brief Returns particleIndex
*/
virtual int GetParticleIndex(int index) const = 0; // returns particleIndex
/*! \fn virtual int GetParticleBorn(int index) const = 0;
* \brief Returns particleBorn
*/
virtual int GetParticleBorn(int index) const = 0; // returns particleBorn
/*! \fn virtual const ParticleID& GetID(int index) const = 0;
* \brief Methods not in the mapped interface
*/
virtual const ParticleID& GetID(int index) const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDR_INTERFACE); }
};
class IParticleChannelIDW : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_3(particleChannelID_setID, SetID, TYPE_INT, TYPE_INT, TYPE_INT);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelID IParticleChannelID.h
* @{
*/
/*! \fn virtual void SetID(int index, int particleIndex, int particleBorn) = 0;
* \brief Set particle property
*/
virtual void SetID(int index, int particleIndex, int particleBorn) = 0;
/*! \fn virtual void SetID(int index, const ParticleID& id) = 0;
* \brief Methods not in the mapped interface
*/
virtual void SetID(int index, const ParticleID& id) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELIDW_INTERFACE); }
};
/*@}*/
#endif // _IPARTICLECHANNELID_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelINode.h
\brief Channel-generic interfaces for particle channels that store pointers on INode objects.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-08-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELINODE_H_
#define _IPARTICLECHANNELINODE_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "INodePtr"
// interface ID
#define PARTICLECHANNELINODER_INTERFACE Interface_ID(0x74f93c09, 0x1eb34500)
#define PARTICLECHANNELINODEW_INTERFACE Interface_ID(0x74f93c09, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelINodeRInterface(obj) ((IParticleChannelINodeR*)obj->GetInterface(PARTICLECHANNELINODER_INTERFACE))
//#define GetParticleChannelINodeWInterface(obj) ((IParticleChannelINodeW*)obj->GetInterface(PARTICLECHANNELINODEW_INTERFACE))
class IParticleChannelINodeR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_INODE, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_INODE, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelINode IParticleChannelINode.h
* @{
*/
/*! \fn virtual INode* GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual INode* GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual INode* GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle.
*/
virtual INode* GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODER_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODER_INTERFACE); }
};
class IParticleChannelINodeW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_INODE);
VFN_1(kSetValueGlobal, SetValue, TYPE_INODE);
END_FUNCTION_MAP
/** @defgroup IParticleChannelINode IParticleChannelINode.h
* @{
*/
/*! \fn virtual void SetValue(int index, INode* value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, INode* value) = 0;
/*! \fn virtual void SetValue(INode* value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(INode* value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODEW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINODEW_INTERFACE); }
};
#endif // _IPARTICLECHANNELINODE_H_

View File

@ -0,0 +1,113 @@
/*! \file IParticleChannelInt.h
\brief Channel-generic interfaces for particle channels that store int data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 01-16-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELINT_H_
#define _IPARTICLECHANNELINT_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Int"
// interface ID
#define PARTICLECHANNELINTR_INTERFACE Interface_ID(0x74f93c01, 0x1eb34500)
#define PARTICLECHANNELINTW_INTERFACE Interface_ID(0x74f93c01, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelIntRInterface(obj) ((IParticleChannelIntR*)obj->GetInterface(PARTICLECHANNELINTR_INTERFACE))
//#define GetParticleChannelIntWInterface(obj) ((IParticleChannelIntW*)obj->GetInterface(PARTICLECHANNELINTW_INTERFACE))
class IParticleChannelIntR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_INT, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_INT, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelInt IParticleChannelInt.h
* @{
*/
/*! \fn virtual int GetValue(int index) const = 0;
* \brief get property for particle with index
*/
virtual int GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual int GetValue() const = 0;
* \brief if channel is global returns the global value. if channel is not global returns value of the first particle
*/
virtual int GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTR_INTERFACE); }
};
class IParticleChannelIntW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_INT);
VFN_1(kSetValueGlobal, SetValue, TYPE_INT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelInt IParticleChannelInt.h
* @{
*/
/*! \fn virtual void SetValue(int index, int value) = 0;
* \brief set property for particle with index
*/
virtual void SetValue(int index, int value) = 0;
/*! \fn virtual void SetValue(int value) = 0;
* \brief set property for all particles at once thus making the channel global
*/
virtual void SetValue(int value) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELINTW_INTERFACE); }
};
#endif // _IPARTICLECHANNELINT_H_

View File

@ -0,0 +1,30 @@
/*! \file IParticleChannelLifespan.h
\brief Channel-specific interfaces for ParticleChannelLifespan.
The channel is used to store maximal age a particle can live up to.
The channel is a wrap around ParticleChannelPTV.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-24-03
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELLIFESPAN_H_
#define _IPARTICLECHANNELLIFESPAN_H_
#include "IParticleChannelPTV.h"
// standard particle channel "Lifespan"
// interface ID
#define PARTICLECHANNELLIFESPANR_INTERFACE Interface_ID(0x74f93b19, 0x1eb34500)
#define PARTICLECHANNELLIFESPANW_INTERFACE Interface_ID(0x74f93b19, 0x1eb34501)
#define GetParticleChannelLifespanRInterface(obj) ((IParticleChannelPTVR*)obj->GetInterface(PARTICLECHANNELLIFESPANR_INTERFACE))
#define GetParticleChannelLifespanWInterface(obj) ((IParticleChannelPTVW*)obj->GetInterface(PARTICLECHANNELLIFESPANW_INTERFACE))
#endif // _IPARTICLECHANNELLIFESPANT_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSFloat.h
\brief Channel-specific interface for ParticleChannelMXSFloat
The channel stores float value for script operators/tests
The channel is a wrap around ParticleChannelFloat
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSFLOAT_H_
#define _IPARTICLECHANNELMXSFLOAT_H_
#include "IParticleChannelFloat.h"
// standard particle channel "MXSFloat"
// interface ID
#define PARTICLECHANNELMXSFLOATR_INTERFACE Interface_ID(0x74f93b15, 0x1eb34500)
#define PARTICLECHANNELMXSFLOATW_INTERFACE Interface_ID(0x74f93b15, 0x1eb34501)
#define GetParticleChannelMXSFloatRInterface(obj) ((IParticleChannelFloatR*)obj->GetInterface(PARTICLECHANNELMXSFLOATR_INTERFACE))
#define GetParticleChannelMXSFloatWInterface(obj) ((IParticleChannelFloatW*)obj->GetInterface(PARTICLECHANNELMXSFLOATW_INTERFACE))
#endif // _IPARTICLECHANNELMXSFLOAT_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSInteger.h
\brief Channel-specific interface for ParticleChannelMXSInteger
The channel stores integer value for script operators/tests
The channel is a wrap around ParticleChannelInt
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSINTEGER_H_
#define _IPARTICLECHANNELMXSINTEGER_H_
#include "IParticleChannelInt.h"
// standard particle channel "MXSInteger"
// interface ID
#define PARTICLECHANNELMXSINTEGERR_INTERFACE Interface_ID(0x74f93b14, 0x1eb34500)
#define PARTICLECHANNELMXSINTEGERW_INTERFACE Interface_ID(0x74f93b14, 0x1eb34501)
#define GetParticleChannelMXSIntegerRInterface(obj) ((IParticleChannelIntR*)obj->GetInterface(PARTICLECHANNELMXSINTEGERR_INTERFACE))
#define GetParticleChannelMXSIntegerWInterface(obj) ((IParticleChannelIntW*)obj->GetInterface(PARTICLECHANNELMXSINTEGERW_INTERFACE))
#endif // _IPARTICLECHANNELMXSINTEGER_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSMatrix.h
\brief Channel-specific interface for ParticleChannelMXSMatrix
The channel stores Matrix3 value for script operators/tests
The channel is a wrap around ParticleChannelMatrix3
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSMATRIX_H_
#define _IPARTICLECHANNELMXSMATRIX_H_
#include "IParticleChannelMatrix3.h"
// standard particle channel "MXSMatrix"
// interface ID
#define PARTICLECHANNELMXSMATRIXR_INTERFACE Interface_ID(0x74f93b17, 0x1eb34500)
#define PARTICLECHANNELMXSMATRIXW_INTERFACE Interface_ID(0x74f93b17, 0x1eb34501)
#define GetParticleChannelMXSMatrixRInterface(obj) ((IParticleChannelMatrix3R*)obj->GetInterface(PARTICLECHANNELMXSMATRIXR_INTERFACE))
#define GetParticleChannelMXSMatrixWInterface(obj) ((IParticleChannelMatrix3W*)obj->GetInterface(PARTICLECHANNELMXSMATRIXW_INTERFACE))
#endif // _IPARTICLECHANNELMXSMATRIX_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelMXSVector.h
\brief Channel-specific interface for ParticleChannelMXSVector
The channel stores Point3 value for script operators/tests
The channel is a wrap around ParticleChannelPoint3
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 07-27-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMXSVECTOR_H_
#define _IPARTICLECHANNELMXSVECTOR_H_
#include "IParticleChannelPoint3.h"
// standard particle channel "MXSVector"
// interface ID
#define PARTICLECHANNELMXSVECTORR_INTERFACE Interface_ID(0x74f93b16, 0x1eb34500)
#define PARTICLECHANNELMXSVECTORW_INTERFACE Interface_ID(0x74f93b16, 0x1eb34501)
#define GetParticleChannelMXSVectorRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELMXSVECTORR_INTERFACE))
#define GetParticleChannelMXSVectorWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELMXSVECTORW_INTERFACE))
#endif // _IPARTICLECHANNELMXSVECTOR_H_

View File

@ -0,0 +1,273 @@
/*! \file IParticleChannelMap.h
\brief Channel-generic interface for particle channels
that store data in "map" form
A map consists of Tab<UVVert> and Tab<TVFace> information
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-17-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMAP_H_
#define _IPARTICLECHANNELMAP_H_
#include "max.h"
#include "PFExport.h"
// interface for map channel; Mesh Map object may contain several map channels
// interface ID
#define PARTICLECHANNELMAPR_INTERFACE Interface_ID(0x74f93c16, 0x1eb34500)
#define PARTICLECHANNELMAPW_INTERFACE Interface_ID(0x74f93c16, 0x1eb34501)
#define GetParticleChannelMapRInterface(obj) ((IParticleChannelMapR*)obj->GetInterface(PARTICLECHANNELMAPR_INTERFACE))
#define GetParticleChannelMapWInterface(obj) ((IParticleChannelMapW*)obj->GetInterface(PARTICLECHANNELMAPW_INTERFACE))
#include "IParticleChannelTabUVVert.h"
#include "IParticleChannelTabTVFace.h"
class IParticleChannelMapR : public FPMixinInterface
{
public:
/** @defgroup IParticleChannelMap IParticleChannelMap.h
* @{
*/
/*! \fn bool IsShared() const { return (IsUVVertShared() || IsTVFaceShared()); }
* \brief check out if some particles have shared mapping data. if it's true then there is no need to get a mapping for each particle
*/
bool IsShared() const { return (IsUVVertShared() || IsTVFaceShared()); }
/*! \fn virtual bool IsUVVertShared() const = 0;
* \brief check out if some particles have shared UVVert data. if it's true then there is no need to get a UVVert data for each particle
*/
virtual bool IsUVVertShared() const = 0;
/*! \fn virtual bool IsTVFaceShared() const = 0;
* \brief check out if some particles have shared TVFace data. if it's true then there is no need to get a TVFace data for each particle
*/
virtual bool IsTVFaceShared() const = 0;
/*! \fn virtual int GetUVVertCount() const = 0;
* \brief get total number of actual TabUVVert values in the channel
*/
virtual int GetUVVertCount() const = 0;
/*! \fn virtual int GetUVVertIndex(int particleIndex) const = 0;
* \brief get the TabUVVert value index of a particle
*/
virtual int GetUVVertIndex(int particleIndex) const = 0;
/*! \fn virtual const TabUVVert* GetUVVertByIndex(int valueIndex) const = 0;
* \brief get TabUVVert of the valueIndex-th value
*/
virtual const TabUVVert* GetUVVertByIndex(int valueIndex) const = 0;
/*! \fn virtual const TabUVVert* GetUVVert(int particleIndex) const = 0;
* \brief get TabUVVert of a particle with the specified index
*/
virtual const TabUVVert* GetUVVert(int particleIndex) const = 0;
/*! \fn virtual const TabUVVert* GetUVVert() const = 0;
* \brief get global TabUVVert value for all particles. the method returns the TabUVVert value of the first particle if it is local or shared
*/
virtual const TabUVVert* GetUVVert() const = 0;
/*! \fn virtual int GetTVFaceCount() const = 0;
* \brief get total number of actual TabTVFace values in the channel
*/
virtual int GetTVFaceCount() const = 0;
/*! \fn virtual int GetTVFaceIndex(int particleIndex) const = 0;
* \brief may return NULL. for different TabUVVert values it has different meanings.
if TabUVVert has a single UVVert value then the particle has a planar TVFace data and all vertices of the particles
have the same UVVert value. if TabUVVert has the same number of UVVert values as the particle mesh vertices number
then the particle has a planar TVFace data and there is one-to-one correspondence between UVVerts and vertices of the particle.
get the TabTVFace value index of a particle.
*/
virtual int GetTVFaceIndex(int particleIndex) const = 0;
/*! \fn virtual const TabTVFace* GetTVFaceByIndex(int valueIndex) const = 0;
* \brief get TabTVFace of the valueIndex-th value. See GetTVFaceIndex(int particleIndex).
*/
virtual const TabTVFace* GetTVFaceByIndex(int valueIndex) const = 0;
/*! \fn virtual const TabTVFace* GetTVFace(int particleIndex) const = 0;
* \brief get TabTVFace of a particle with the specified index. See GetTVFaceIndex(int particleIndex).
*/
virtual const TabTVFace* GetTVFace(int particleIndex) const = 0;
/*! \fn virtual const TabTVFace* GetTVFace() const = 0;
* \brief get global TabTVFace value for all particles. the method returns the TabTVFace value of the first particle if it is local or shared. See GetTVFaceIndex(int particleIndex).
*/
virtual const TabTVFace* GetTVFace() const = 0;
/*! \fn virtual void Apply(Mesh* mesh, int particleIndex, int mp) const = 0;
* \brief apply content of the channel to the mesh [mesh] at mapping channel [mp]
*/
virtual void Apply(Mesh* mesh, int particleIndex, int mp) const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPR_INTERFACE); }
};
class IParticleChannelMapW : public FPMixinInterface
{
public:
/** @defgroup IChannelContainer IChannelContainer.h
* @{
*/
/*! \fn virtual bool SetUVVert(int particleIndex, const UVVert& value) = 0;
* \brief sets all vertices of the particle have the same UVVert value. returns true if successful.
*/
virtual bool SetUVVert(int particleIndex, const UVVert& value) = 0;
/*! \fn virtual bool SetUVVert(int particleIndex, const TabUVVert* tab) = 0;
* \brief copies UVVert data to be texture mapping for the particle. returns true if successful.
*/
virtual bool SetUVVert(int particleIndex, const TabUVVert* tab) = 0;
/*! \fn virtual bool SetUVVert(Tab<int>& particleIndices, const UVVert& value) = 0;
* \brief copies UVVert data to be a shared value with indices in "particleIndeces"
*/
virtual bool SetUVVert(Tab<int>& particleIndices, const UVVert& value) = 0;
/*! \fn virtual bool SetUVVert(Tab<int>& particleIndices, const TabUVVert* tab) = 0;
* \brief copies UVVert data to be a shared value with indices in "particleIndeces"
*/
virtual bool SetUVVert(Tab<int>& particleIndices, const TabUVVert* tab) = 0;
/*! \fn virtual bool SetUVVert(const UVVert& value) = 0;
* \brief copies UVVert data to a global value for all particles
*/
virtual bool SetUVVert(const UVVert& value) = 0;
/*! \fn virtual bool SetUVVert(const TabUVVert* tab) = 0;
* \brief copies UVVert data to a global value for all particles
*/
virtual bool SetUVVert(const TabUVVert* tab) = 0;
/*! \fn virtual bool CopyUVVert(int fromParticle, int toParticle) = 0;
* \brief copy UVVert data from fromParticle to toParticle
*/
virtual bool CopyUVVert(int fromParticle, int toParticle) = 0;
/*! \fn virtual bool CopyUVVert(int fromParticle, Tab<int>& toParticles) = 0;
* \brief copy UVVert data from fromParticle to toParticles
*/
virtual bool CopyUVVert(int fromParticle, Tab<int>& toParticles) = 0;
/*! \fn virtual bool CopyUVVert(int fromParticle) = 0;
* \brief copy UVVert data from fromParticle to all particles
*/
virtual bool CopyUVVert(int fromParticle) = 0;
/*! \fn virtual bool SetTVFace(int particleIndex, const TabTVFace* tab) = 0;
* \brief copies TVFace data to be texture facing for the particle. returns true if successful.
*/
virtual bool SetTVFace(int particleIndex, const TabTVFace* tab) = 0;
/*! \fn virtual bool SetTVFace(Tab<int>& particleIndices, const TabTVFace* tab) = 0;
* \brief copies TVFace data to be a shared value with indices in "particleIndeces"
*/
virtual bool SetTVFace(Tab<int>& particleIndices, const TabTVFace* tab) = 0;
/*! \fn virtual bool SetTVFace(const TabTVFace* tab) = 0;
* \brief copies TVFace data to a global value for all particles
*/
virtual bool SetTVFace(const TabTVFace* tab) = 0;
/*! \fn virtual bool CopyTVFace(int fromParticle, int toParticle) = 0;
* \brief copy TVFace data from fromParticle to toParticle
*/
virtual bool CopyTVFace(int fromParticle, int toParticle) = 0;
/*! \fn virtual bool CopyTVFace(int fromParticle, Tab<int>& toParticles) = 0;
* \brief copy TVFace data from fromParticle to toParticles
*/
virtual bool CopyTVFace(int fromParticle, Tab<int>& toParticles) = 0;
/*! \fn virtual bool CopyTVFace(int fromParticle) = 0;
* \brief copy TVFace data from fromParticle to all particles
*/
virtual bool CopyTVFace(int fromParticle) = 0;
/*! \fn virtual IObject* GetUVVertChannel() const = 0;
* \brief returns an object of TabUVVert channel
*/
virtual IObject* GetUVVertChannel() const = 0;
/*! \fn virtual IObject* GetTVFaceChannel() const = 0;
* \brief returns an object of TabTVFace channel
*/
virtual IObject* GetTVFaceChannel() const = 0;
/*! \fn bool SetMap(int particleIndex, const UVVert& value)
* \brief sets all vertices of the particle have the same map value. returns true if successful.
*/
bool SetMap(int particleIndex, const UVVert& value)
{ return (SetUVVert(particleIndex, value) && SetTVFace(NULL)); }
/*! \fn bool SetMap(int particleIndex, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
* \brief copies map data to be texture mapping for the particle. returns true if successful.
*/
bool SetMap(int particleIndex, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
{ return (SetUVVert(particleIndex, tabUVVert) && SetTVFace(particleIndex, tabTVFace)); }
/*! \fn bool SetMap(Tab<int>& particleIndices, const UVVert& value)
* \brief copies map data to be a shared value with indices in "particleIndeces"
*/
bool SetMap(Tab<int>& particleIndices, const UVVert& value)
{ return (SetUVVert(particleIndices, value) && SetTVFace(particleIndices, NULL)); }
/*! \fn bool SetMap(Tab<int>& particleIndices, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
* \brief copies map data to be a shared value with indices in "particleIndeces"
*/
bool SetMap(Tab<int>& particleIndices, const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
{ return (SetUVVert(particleIndices, tabUVVert) && SetTVFace(particleIndices, tabTVFace)); }
/*! \fn bool SetMap(const UVVert& value)
* \brief copies map data to a global value for all particles
*/
bool SetMap(const UVVert& value)
{ return (SetUVVert(value) && SetTVFace(NULL)); }
/*! \fn bool SetMap(const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
* \brief copies map data to a global value for all particles
*/
bool SetMap(const TabUVVert* tabUVVert, const TabTVFace* tabTVFace=NULL)
{ return (SetUVVert(tabUVVert) && SetTVFace(tabTVFace)); }
/*! \fn bool CopyMap(int fromParticle, int toParticle)
* \brief copy map data from fromParticle to toParticle
*/
bool CopyMap(int fromParticle, int toParticle)
{ return (CopyUVVert(fromParticle, toParticle) && CopyTVFace(fromParticle, toParticle)); }
/*! \fn bool CopyMap(int fromParticle, Tab<int>& toParticles)
* \brief copy map data from fromParticle to toParticles
*/
bool CopyMap(int fromParticle, Tab<int>& toParticles)
{ return (CopyUVVert(fromParticle, toParticles) && CopyTVFace(fromParticle, toParticles)); }
/*! \fn bool CopyMap(int fromParticle)
* \brief copy map data from fromParticle to all particles
*/
bool CopyMap(int fromParticle)
{ return (CopyUVVert(fromParticle) && CopyTVFace(fromParticle)); }
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMAPW_INTERFACE); }
};
#endif // _IPARTICLECHANNELMESHMAP_H_

View File

@ -0,0 +1,33 @@
/*! \file IParticleChannelMaterialIndex.h
\brief Channel-specific interfaces for ParticleChannelMaterialIndex
The channel is used to store material index information
The channel is a wrap around ParticleChannelInt
If the channel is present in the particle container
then the index information overrides any material index information
in mesh channel with one exception: if index value is -1 then
the mesh channel information is kept intact.
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-23-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMATERIALINDEX_H_
#define _IPARTICLECHANNELMATERIALINDEX_H_
#include "IParticleChannelInt.h"
// standard particle channel "MaterialIndex"
// interface ID
#define PARTICLECHANNELMTLINDEXR_INTERFACE Interface_ID(0x74f93b12, 0x1eb34500)
#define PARTICLECHANNELMTLINDEXW_INTERFACE Interface_ID(0x74f93b12, 0x1eb34501)
#define GetParticleChannelMtlIndexRInterface(obj) ((IParticleChannelIntR*)obj->GetInterface(PARTICLECHANNELMTLINDEXR_INTERFACE))
#define GetParticleChannelMtlIndexWInterface(obj) ((IParticleChannelIntW*)obj->GetInterface(PARTICLECHANNELMTLINDEXW_INTERFACE))
#endif // _IPARTICLECHANNELMTLINDEX_H_

View File

@ -0,0 +1,115 @@
/*! \file IParticleChannelMatrix3.h
\brief Channel-generic interfaces for particle channels that store matrix data.
*/
/**********************************************************************
*<
CREATED BY: Chung-An Lin
HISTORY: created 02-03-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMATRIX3_H_
#define _IPARTICLECHANNELMATRIX3_H_
#include "max.h"
#include "PFExport.h"
// generic particle channel "Matrix3"
// interface ID
#define PARTICLECHANNELMATRIX3R_INTERFACE Interface_ID(0x74f93c0a, 0x1eb34500)
#define PARTICLECHANNELMATRIX3W_INTERFACE Interface_ID(0x74f93c0a, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelMatrix3RInterface(obj) ((IParticleChannelMatrix3R*)obj->GetInterface(PARTICLECHANNELMATRIX3R_INTERFACE))
//#define GetParticleChannelMatrix3WInterface(obj) ((IParticleChannelMatrix3W*)obj->GetInterface(PARTICLECHANNELMATRIX3W_INTERFACE))
class IParticleChannelMatrix3R : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetValue,
kIsGlobal,
kGetValueGlobal
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
FN_1(kGetValue, TYPE_MATRIX3_BR, GetValue, TYPE_INT);
FN_0(kIsGlobal, TYPE_bool, IsGlobal);
FN_0(kGetValueGlobal, TYPE_MATRIX3_BR, GetValue);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMatrix3 IParticleChannelMatrix3.h
* @{
*/
/*! \fn virtual const Matrix3& GetValue(int index) const = 0;
* \brief Get property for particle with index
*/
virtual const Matrix3& GetValue(int index) const = 0;
/*! \fn virtual bool IsGlobal() const = 0;
* \brief Verify if the channel is global
*/
virtual bool IsGlobal() const = 0;
/*! \fn virtual const Matrix3& GetValue() const = 0;
* \brief If channel is global returns the global value
If channel is not global returns value of the first particle
Returns bounding box for all particles
*/
virtual const Matrix3& GetValue() const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3R_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3R_INTERFACE); }
};
class IParticleChannelMatrix3W : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueGlobal,
};
// Function Map for Function Publish System
//***********************************
BEGIN_FUNCTION_MAP
VFN_2(kSetValue, SetValue, TYPE_INT, TYPE_MATRIX3_BR);
VFN_1(kSetValueGlobal, SetValue, TYPE_MATRIX3_BR);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMatrix3 IParticleChannelMatrix3.h
* @{
*/
/*! \fn virtual void SetValue(int index, const Matrix3& v) = 0;
* \brief Set property for particle with index
*/
virtual void SetValue(int index, const Matrix3& v) = 0;
/*! \fn virtual void SetValue(const Matrix3& v) = 0;
* \brief Set property for all particles at once thus making the channel global
*/
virtual void SetValue(const Matrix3& v) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3W_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMATRIX3W_INTERFACE); }
};
#endif // _IPARTICLECHANNELMATRIX3_H_

View File

@ -0,0 +1,129 @@
/*! \file IParticleChannelMesh.h
\brief Channel-generic interface for particle channels
that store data in "mesh" form
The channel can be local (each particle has its own mesh)
global (all particles have the same mesh) and shared
(particles are sharing a limited set of meshes)
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 11-28-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMESH_H_
#define _IPARTICLECHANNELMESH_H_
#include "max.h"
#include "PFExport.h"
// standard particle channel "Mesh"
// interface ID
#define PARTICLECHANNELMESHR_INTERFACE Interface_ID(0x74f93c11, 0x1eb34500)
#define PARTICLECHANNELMESHW_INTERFACE Interface_ID(0x74f93c11, 0x1eb34501)
// since it's a "type" channel there is no "GetChannel" defines
//#define GetParticleChannelMeshRInterface(obj) ((IParticleChannelMeshR*)obj->GetInterface(PARTICLECHANNELMESHR_INTERFACE))
//#define GetParticleChannelMeshWInterface(obj) ((IParticleChannelMeshW*)obj->GetInterface(PARTICLECHANNELMESHW_INTERFACE))
class IParticleChannelMeshR : public FPMixinInterface
{
public:
// function IDs Read
enum { kIsShared,
kGetValueCount,
kGetValueIndex,
kGetValueByIndex,
kGetValue,
kGetValueFirst,
kGetMaxBoundingBox
};
BEGIN_FUNCTION_MAP
FN_0(kIsShared, TYPE_bool, IsShared);
FN_0(kGetValueCount, TYPE_INT, GetValueCount);
FN_1(kGetValueIndex, TYPE_INT, GetValueIndex, TYPE_INT);
FN_1(kGetValueByIndex, TYPE_MESH, GetValueByIndex, TYPE_INT);
FN_1(kGetValue, TYPE_MESH, GetValue, TYPE_INT);
FN_0(kGetValueFirst, TYPE_MESH, GetValue);
VFN_2(kGetMaxBoundingBox, GetMaxBoundingBox, TYPE_POINT3_BR, TYPE_POINT3_BR);
END_FUNCTION_MAP
// check out if some particles have shared mesh
// if it's true then there is no need to get a shape for each particle
virtual bool IsShared() const = 0;
// get total number of actual meshes (values) in the channel
virtual int GetValueCount() const = 0;
// get the value index of a particle
virtual int GetValueIndex(int particleIndex) const = 0;
// get shape of the valueIndex-th value
virtual const Mesh* GetValueByIndex(int valueIndex) const = 0;
// get shape for particle with index
virtual const Mesh* GetValue(int particleIndex) const = 0;
// get global shape for all particles
// the method returns the mesh of the first particle if it is local or shared
virtual const Mesh* GetValue() const = 0;
// returns maximal bounding box
virtual const Box3& GetMaxBoundingBox() const = 0;
// FnPub alternative for the method above
PFExport void GetMaxBoundingBox(Point3& corner1, Point3& corner2) const;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHR_INTERFACE); }
};
class IParticleChannelMeshW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetValue,
kSetValueMany,
kSetValueAll,
kCopyValue,
kCopyValueMany,
kCopyValueAll,
kBuildMaxBoundingBox
};
BEGIN_FUNCTION_MAP
FN_2(kSetValue, TYPE_bool, SetValue, TYPE_INT, TYPE_MESH);
FN_2(kSetValueMany, TYPE_bool, SetValue, TYPE_INT_TAB_BR, TYPE_MESH);
FN_1(kSetValueAll, TYPE_bool, SetValue, TYPE_MESH);
FN_2(kCopyValue, TYPE_bool, CopyValue, TYPE_INT, TYPE_INT);
FN_2(kCopyValueMany, TYPE_bool, CopyValue, TYPE_INT, TYPE_INT_TAB_BR);
FN_1(kCopyValueAll, TYPE_bool, CopyValue, TYPE_INT);
VFN_0(kBuildMaxBoundingBox, BuildMaxBoundingBox);
END_FUNCTION_MAP
// copies mesh to be a local value for particle with index "particleIndex"
// returns true if successful
virtual bool SetValue(int particleIndex, Mesh* mesh) = 0;
// copies mesh to be a shared value with indices in "particleIndices"
// returns true if successful
virtual bool SetValue(Tab<int>& particleIndices, Mesh* mesh) = 0;
// copies mesh to be a global values for all particles
// returns true if successful
virtual bool SetValue(Mesh* mesh) = 0;
// copy mesh value from fromParticle to toParticle
virtual bool CopyValue(int fromParticle, int toParticle) = 0;
// copy mesh value from fromParticle to toParticles
virtual bool CopyValue(int fromParticle, Tab<int>& toParticles) = 0;
// copy mesh value from fromParticle to all particles
virtual bool CopyValue(int fromParticle) = 0;
// build maximal bounding box for the set of all shapes
virtual void BuildMaxBoundingBox() = 0;
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHW_INTERFACE); }
};
#endif // _IPARTICLECHANNELMESH_H_

View File

@ -0,0 +1,135 @@
/*! \file IParticleChannelMeshMap.h
\brief Channel-generic interface for particle channels
that store data in "mesh map" form
The channel store a set of MeshMapChannels
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 06-17-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELMESHMAP_H_
#define _IPARTICLECHANNELMESHMAP_H_
#include "max.h"
#include "PFExport.h"
#include "IParticleChannelMap.h"
// standard particle channel "Mesh Map"
// interface ID
#define PARTICLECHANNELMESHMAPR_INTERFACE Interface_ID(0x74f93c17, 0x1eb34500)
#define PARTICLECHANNELMESHMAPW_INTERFACE Interface_ID(0x74f93c17, 0x1eb34501)
#define GetParticleChannelMeshMapRInterface(obj) ((IParticleChannelMeshMapR*)obj->GetInterface(PARTICLECHANNELMESHMAPR_INTERFACE))
#define GetParticleChannelMeshMapWInterface(obj) ((IParticleChannelMeshMapW*)obj->GetInterface(PARTICLECHANNELMESHMAPW_INTERFACE))
class IParticleChannelMeshMapR : public FPMixinInterface
{
public:
// function IDs Read
enum { kGetNumMaps,
kMapSupport,
kGetMapReadChannel
};
BEGIN_FUNCTION_MAP
FN_0(kGetNumMaps, TYPE_INT, GetNumMaps);
FN_1(kMapSupport, TYPE_bool, MapSupport, TYPE_INT);
FN_1(kGetMapReadChannel, TYPE_INTERFACE, GetMapReadChannel, TYPE_INT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMeshMap IParticleChannelMeshMap.h
* @{
*/
/*! \fn virtual int GetNumMaps() const = 0;
* \brief returns the number of mapping channels in use.
*/
virtual int GetNumMaps() const = 0;
/*! \fn virtual bool MapSupport(int mp) const = 0;
* \brief returns true if the specified mapping channel is supported; otherwise false
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual bool MapSupport(int mp) const = 0;
/*! \fn virtual IParticleChannelMapR* GetMapReadChannel(int mp) = 0;
* \brief returns an interface if the specified mapping channel is supported; otherwise NULL
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual IParticleChannelMapR* GetMapReadChannel(int mp) = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPR_INTERFACE); }
};
class IParticleChannelMeshMapW : public FPMixinInterface
{
public:
// function IDs Write
enum { kSetNumMaps,
kSetMapSupport,
kGetMapChannel,
kGetMapChannelObject
};
BEGIN_FUNCTION_MAP
VFN_2(kSetNumMaps, SetNumMaps, TYPE_INT, TYPE_bool);
VFN_2(kSetMapSupport, SetMapSupport, TYPE_INT, TYPE_bool);
FN_1(kGetMapChannel, TYPE_INTERFACE, GetMapChannel, TYPE_INT);
FN_1(kGetMapChannelObject, TYPE_IOBJECT, GetMapChannelObject, TYPE_INT);
END_FUNCTION_MAP
/** @defgroup IParticleChannelMeshMap IParticleChannelMeshMap.h
* @{
*/
/*! \fn virtual void SetNumMaps(int ct, bool keep=false) = 0;
* \brief sets the number of texture maps used. Note that this call is made automatically if SetMapSupport() is called.
\param int ct: the number of texture maps to use. This is a value between 0 and MAX_MESHMAPS-1.
\param bool keep: true to keep the old mapping information after the resize; false to discard it.
*/
virtual void SetNumMaps(int ct, bool keep=false) = 0;
/*! \fn virtual void SetMapSupport(int mp, bool support=true) = 0;
* \brief sets whether the specified mapping channels is supported or not.
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
\param bool support: true to indicate the channel is supported; otherwise false.
*/
virtual void SetMapSupport(int mp, bool support=true) = 0;
/*! \fn virtual IParticleChannelMapW* GetMapChannel(int mp) = 0;
* \brief returns an interface if the specified mapping channel is supported; otherwise NULL
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual IParticleChannelMapW* GetMapChannel(int mp) = 0;
/*! \fn virtual IObject* GetMapChannelObject(int mp) const = 0;
* \brief returns an object if the specified mapping channel is supported; otherwise NULL
\param int mp: specifies the channel. See List of Mapping Channel Index Values.
*/
virtual IObject* GetMapChannelObject(int mp) const = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELMESHMAPW_INTERFACE); }
};
#endif // _IPARTICLECHANNELMESHMAP_H_

View File

@ -0,0 +1,130 @@
/*! \file IParticleChannelNew.h
\brief Channel-specific interfaces for ParticleChannelNew.
The channel is used to mark particles that have just
come to the current event (either via birth or a jump from
another event
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 10-03-01
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELNEW_H_
#define _IPARTICLECHANNELNEW_H_
// standard particle channel "New"
// interface ID
#define PARTICLECHANNELNEWR_INTERFACE Interface_ID(0x74f93b01, 0x1eb34500)
#define PARTICLECHANNELNEWW_INTERFACE Interface_ID(0x74f93b01, 0x1eb34501)
#define GetParticleChannelNewRInterface(obj) ((IParticleChannelNewR*)obj->GetInterface(PARTICLECHANNELNEWR_INTERFACE))
#define GetParticleChannelNewWInterface(obj) ((IParticleChannelNewW*)obj->GetInterface(PARTICLECHANNELNEWW_INTERFACE))
// function IDs Read
enum { particleChannelNew_isNew,
particleChannelNew_isAllNew,
particleChannelNew_isAllOld
};
// function IDs Write
enum { particleChannelNew_setNew,
particleChannelNew_setOld,
particleChannelNew_setAllNew,
particleChannelNew_setAllOld
};
class IParticleChannelNewR : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
FN_1(particleChannelNew_isNew, TYPE_bool, IsNew, TYPE_INT);
FN_0(particleChannelNew_isAllNew, TYPE_bool, IsAllNew);
FN_0(particleChannelNew_isAllOld, TYPE_bool, IsAllOld);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelNew IParticleChannelNew.h
* @{
*/
// get particle property
/*! \fn virtual bool IsNew(int index) const = 0;
* \brief Checks if particle with index is new
*/
virtual bool IsNew(int index) const = 0; // is particle with the index is new
/*! \fn virtual bool IsAllNew() const = 0;
* \brief Checks if all particles are new
*/
virtual bool IsAllNew() const = 0; // all particles are new
/*! \fn virtual bool IsAllOld() const = 0;
* \brief Checks if all particles are old
*/
virtual bool IsAllOld() const = 0; // all particles are old
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWR_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWR_INTERFACE); }
};
class IParticleChannelNewW : public FPMixinInterface
{
BEGIN_FUNCTION_MAP
VFN_1(particleChannelNew_setNew, SetNew, TYPE_INT);
VFN_1(particleChannelNew_setOld, SetOld, TYPE_INT);
VFN_0(particleChannelNew_setAllNew, SetAllNew);
VFN_0(particleChannelNew_setAllOld, SetAllOld);
END_FUNCTION_MAP
public:
/** @defgroup IParticleChannelNew IParticleChannelNew.h
* @{
*/
// get/set particle property
/*! \fn virtual void SetNew(int index) = 0;
* \brief Sets particle as new, returns true if success
*/
virtual void SetNew(int index) = 0;
/*! \fn virtual void SetOld(int index) = 0;
* \brief Sets particle as old, returns true if success
*/
virtual void SetOld(int index) = 0;
/*! \fn virtual void SetAllNew() = 0;
* \brief Sets all particles as "new"
*/
virtual void SetAllNew() = 0;
/*! \fn virtual void SetAllOld() = 0;
* \brief Sets all particles as "old"
*/
virtual void SetAllOld() = 0;
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWW_INTERFACE); }
* \brief
*/
/*! \fn FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWW_INTERFACE); }
* \brief
*/
FPInterfaceDesc* GetDesc() { return GetDescByID(PARTICLECHANNELNEWW_INTERFACE); }
};
#endif // _IPARTICLECHANNELNEW_H_

View File

@ -0,0 +1,29 @@
/*! \file IParticleChannelOrientation.h
\brief Channel-specific interface for ParticleChannelOrientation
Particle orientation is stored in quaternion form
The channel is a wrap around ParticleChannelQuat
*/
/**********************************************************************
*<
CREATED BY: Oleg Bayborodin
HISTORY: created 01-09-02
*> Copyright (c) 2001, All Rights Reserved.
**********************************************************************/
#ifndef _IPARTICLECHANNELORIENTATION_H_
#define _IPARTICLECHANNELORIENTATION_H_
#include "IParticleChannelQuat.h"
// standard particle channel "Orientation"
// interface ID
#define PARTICLECHANNELORIENTATIONR_INTERFACE Interface_ID(0x74f93b09, 0x1eb34500)
#define PARTICLECHANNELORIENTATIONW_INTERFACE Interface_ID(0x74f93b09, 0x1eb34501)
#define GetParticleChannelOrientationRInterface(obj) ((IParticleChannelQuatR*)obj->GetInterface(PARTICLECHANNELORIENTATIONR_INTERFACE))
#define GetParticleChannelOrientationWInterface(obj) ((IParticleChannelQuatW*)obj->GetInterface(PARTICLECHANNELORIENTATIONW_INTERFACE))
#endif // _IPARTICLECHANNELORIENTATION_H_

Some files were not shown because too many files have changed in this diff Show More