convert line ends
[canaan.git] / prj / cam / src / motion / motorapi.h
blobbedf9384f2b26142c8c207f25f14bd1acc5915a8
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/motion/motorapi.h,v 1.18 2000/01/31 09:51:01 adurant Exp $
7 #pragma once
9 #ifndef __MMOTRAPI_H
10 #define __MMOTRAPI_H
12 #include <matrixs.h>
13 #include <motrtype.h>
14 #include <multiped.h>
15 #include <wrtype.h>
16 #include <objpos.h> // XXX for inline functions
17 #include <fix.h>
19 struct sMotorState
21 mxs_vector position;
22 mxs_angvec facing;
23 BOOL IsPhysical;
24 ulong contactFlags;
25 mxs_angvec direction;
26 float timeSlop; // how much time was left in last frame when motion ended
27 ObjID focus;
28 int ballisticRefCount;
31 #define kMotStartFlag_ForceBlend 0x1 // blend the motion even if it doesn't by default
32 #define kMotStartFlag_SetStartFrame 0x2 // start frame is given as optional param
34 enum eMotorMotFrameOfReference // These must correspond to MFRT constants in multiped.h
36 kMFRT_RelStart,
37 kMFRT_Arm,
38 kMFRT_Global,
39 kMFRT_Invalid=0xffffffff,
42 class IMotor
44 public:
45 virtual void SetMotorResolver(IMotorResolver *pResolver)=0;
47 virtual int GetActorType()=0;
48 virtual void StartMotion(const int motionNum)=0;
49 virtual void StartMotionWithParam(const int motionNum,mps_motion_param *pParam,ulong flags=0,int startFrame=0)=0;
50 virtual void StopMotion(const int)=0;
51 virtual void PoseAtMotionFrame(int motNum, float frame)=0;
52 // for load/save
53 virtual int SwizzleMotion(int motNum)=0;
54 virtual int GetCurrentMotion()=0;
56 virtual BOOL SetTransform(const mxs_vector *, const mxs_angvec *, BOOL movePhys=TRUE)=0;
57 virtual BOOL SetPosition(const mxs_vector *, BOOL movePhys=TRUE)=0;
58 virtual BOOL SetOrientation(const mxs_angvec *, BOOL movePhys=TRUE)=0;
59 virtual void GetTransform(mxs_vector *, mxs_angvec *)=0;
60 virtual const Location *GetLocation() const =0;
61 virtual mxs_real GetButtZOffset() const =0;
62 virtual mxs_real GetDefaultButtZOffset() const =0;
63 virtual void GetFeetJointIDs(int *numJoints, int **jointIDs) const =0;
64 virtual ObjID GetObjID() const=0;
65 virtual void SetFocus(ObjID obj)=0; // obj_null means no focus
66 virtual void SetFocus(ObjID obj,fix fSpeed)=0; // obj_null means no focus
68 virtual const sMotorState *GetMotorState() const =0;
69 virtual void SetContact(ulong)=0;
70 virtual void SetVelocity(const mxs_angvec *dir, const mxs_real speed)=0;
71 virtual BOOL MakePhysical()=0;
72 virtual void MakeNonPhysical()=0;
73 virtual BOOL IsBallistic()=0;
74 virtual void SetMotFrameOfReference(int type) = 0;
75 virtual int GetMotFrameOfReference() = 0;
77 virtual void Pause()=0;
78 virtual const multiped *GetMultiped() const =0;
79 virtual float GetMotionScale() const=0;
80 virtual int GetRootJointID() const=0;
83 #endif