2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
6 // $Header: r:/t2repos/thief2/src/actreact/contag8r.h,v 1.8 1998/10/21 18:52:21 mahk Exp $
21 ////////////////////////////////////////////////////////////
22 // PHYSICAL CONTACT PROPAGATOR
25 F_DECLARE_INTERFACE(IStimSources
);
26 F_DECLARE_INTERFACE(IStimSensors
);
28 class cContactPropagator
: public cBasePropagator
33 ~cContactPropagator();
35 //------------------------------------------------------------
36 // IPropagator Methods
39 STDMETHOD(InitSource
)(sStimSourceDesc
* desc
);
40 STDMETHOD_(const struct sStructDesc
*,DescribeShapes
)();
41 STDMETHOD_(const struct sStructDesc
*,DescribeLifeCycles
)();
42 STDMETHOD(SourceEvent
)(sStimSourceEvent
* event
);
43 STDMETHOD_(tStimLevel
,GetSourceLevel
)(StimSourceID id
);
44 STDMETHOD(DescribeSource
)(StimSourceID id
, sStimSourceDesc
* desc
);
45 STDMETHOD(SensorEvent
)(sStimSensorEvent
* event
);
46 STDMETHOD(Propagate
)(tStimTimeStamp curtime
, tStimDuration duration
);
51 //------------------------------------------------------------
56 class cSourceList
: public cSimpleListSet
<StimSourceID
>
62 typedef cScalarHashFunctions
<ObjID
> cSourceTableHashFuncs
;
64 // Table of lists of sources
65 class cSourceTable
: public cHashTable
<ObjID
,cSourceList
*,cSourceTableHashFuncs
>
73 //------------------------------------------------------------
74 // API for frob and weapon swing
83 void DoPropagationEvent(ulong eventmask
, ObjID from
, ObjID to
, float magnitude
, const struct sChainedEvent
* cause
= NULL
, ulong propflags
= 0);
85 // the propagator to use
86 static cContactPropagator
* gpGator
;
89 //------------------------------------------------------------
93 eDamageResult
HandleImpact(const struct sDamageMsg
* msg
);
94 static eDamageResult LGAPI
ImpactListener(const struct sDamageMsg
* msg
, tDamageCallbackData data
);
96 eReactionResult
SetImpactResult(sReactionEvent
* event
, const sReactionParam
* param
);
97 static eReactionResult LGAPI
ImpactResultReaction(sReactionEvent
* event
, const sReactionParam
* param
, tReactionFuncData data
);
101 //------------------------------------------------------------
106 IStimSensors
* pSensors
;
107 IStimSources
* pSources
;
110 cSourceTable Sources
; // Sources we handle
113 const sDamageMsg
* pImpactEvent
;
114 eDamageResult ImpactResult
;
119 #endif // __CONTAG8R_H