mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Fix line endings and tabs
This commit is contained in:
@ -1,33 +1,33 @@
|
||||
include_directories("../../CoreLib")
|
||||
include_directories("../../FeatureLib")
|
||||
include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
|
||||
set(plPhysical_SOURCES
|
||||
plCollisionDetector.cpp
|
||||
plPhysicalProxy.cpp
|
||||
plPhysicalSDLModifier.cpp
|
||||
plPhysicalSndGroup.cpp
|
||||
plPhysicsSoundMgr.cpp
|
||||
plPickingDetector.cpp
|
||||
)
|
||||
|
||||
set(plPhysical_HEADERS
|
||||
plCollisionDetector.h
|
||||
plDetectorModifier.h
|
||||
plPhysicalCreatable.h
|
||||
plPhysicalProxy.h
|
||||
plPhysicalSDLModifier.h
|
||||
plPhysicalSndGroup.h
|
||||
plPhysicsSoundMgr.h
|
||||
plPickingDetector.h
|
||||
plSimDefs.h
|
||||
)
|
||||
|
||||
add_library(plPhysical STATIC ${plPhysical_SOURCES} ${plPhysical_HEADERS})
|
||||
|
||||
source_group("Source Files" FILES ${plPhysical_SOURCES})
|
||||
source_group("Header Files" FILES ${plPhysical_HEADERS})
|
||||
include_directories("../../CoreLib")
|
||||
include_directories("../../FeatureLib")
|
||||
include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
|
||||
set(plPhysical_SOURCES
|
||||
plCollisionDetector.cpp
|
||||
plPhysicalProxy.cpp
|
||||
plPhysicalSDLModifier.cpp
|
||||
plPhysicalSndGroup.cpp
|
||||
plPhysicsSoundMgr.cpp
|
||||
plPickingDetector.cpp
|
||||
)
|
||||
|
||||
set(plPhysical_HEADERS
|
||||
plCollisionDetector.h
|
||||
plDetectorModifier.h
|
||||
plPhysicalCreatable.h
|
||||
plPhysicalProxy.h
|
||||
plPhysicalSDLModifier.h
|
||||
plPhysicalSndGroup.h
|
||||
plPhysicsSoundMgr.h
|
||||
plPickingDetector.h
|
||||
plSimDefs.h
|
||||
)
|
||||
|
||||
add_library(plPhysical STATIC ${plPhysical_SOURCES} ${plPhysical_HEADERS})
|
||||
|
||||
source_group("Source Files" FILES ${plPhysical_SOURCES})
|
||||
source_group("Header Files" FILES ${plPhysical_HEADERS})
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,290 +1,290 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plCollisionDetector_inc
|
||||
#define plCollisionDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
#include "hsGeometry3.h"
|
||||
#include <list>
|
||||
#include <set>
|
||||
class plMessage;
|
||||
class plCameraMsg;
|
||||
class plArmatureMod;
|
||||
class plActivatorMsg;
|
||||
class plEvalMsg;
|
||||
|
||||
class plCollisionDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
Int8 fType;
|
||||
hsBool fBumped, fTriggered;
|
||||
|
||||
plArmatureMod* IGetAvatarModifier(plKey key);
|
||||
bool IIsDisabledAvatar(plKey key);
|
||||
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kTypeEnter = 0x01,
|
||||
kTypeExit = 0x02,
|
||||
kTypeAny = 0x04,
|
||||
kTypeUnEnter = 0x08,
|
||||
kTypeUnExit = 0x10,
|
||||
kTypeBump = 0x20,
|
||||
};
|
||||
|
||||
plCollisionDetector() : fType(0), fTriggered(false), fBumped(false){;}
|
||||
virtual ~plCollisionDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plCollisionDetector );
|
||||
GETINTERFACE_ANY( plCollisionDetector, plDetectorModifier );
|
||||
|
||||
virtual void SetType(Int8 i) { fType |= i; }
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
// sub type for object-in-volume detectors
|
||||
class plObjectInVolumeDetector : public plCollisionDetector
|
||||
{
|
||||
public:
|
||||
class plCollisionBookKeepingInfo
|
||||
{
|
||||
friend plObjectInVolumeDetector;
|
||||
public:
|
||||
plCollisionBookKeepingInfo(plKey& hit)
|
||||
{
|
||||
hitter=hit;
|
||||
enters=0;
|
||||
exits=0;
|
||||
}
|
||||
~plCollisionBookKeepingInfo()
|
||||
{
|
||||
hitter=nil;
|
||||
}
|
||||
protected:
|
||||
plKey hitter;
|
||||
int enters,exits;
|
||||
bool fSubStepCurState;
|
||||
};
|
||||
protected:
|
||||
virtual void ITrigger(plKey hitter, bool entering, bool immediate=false);
|
||||
//virtual void ISendSavedTriggerMsgs();
|
||||
virtual void IHandleEval(plEvalMsg* pEval);
|
||||
bool fWaitingForEval;
|
||||
|
||||
plActivatorMsg* fSavedActivatorMsg;
|
||||
|
||||
typedef std::list<plCollisionBookKeepingInfo*> bookKeepingList;
|
||||
bookKeepingList fCollisionList;
|
||||
typedef std::set<plKey> ResidentSet;
|
||||
ResidentSet fCurrentResidents;
|
||||
|
||||
public:
|
||||
|
||||
plObjectInVolumeDetector()
|
||||
{
|
||||
fWaitingForEval=false;fSavedActivatorMsg=nil;
|
||||
|
||||
}
|
||||
plObjectInVolumeDetector(Int8 i){fType = i;fWaitingForEval=false;fSavedActivatorMsg=nil;}
|
||||
virtual ~plObjectInVolumeDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER(plObjectInVolumeDetector);
|
||||
GETINTERFACE_ANY(plObjectInVolumeDetector, plCollisionDetector);
|
||||
|
||||
virtual void SetTarget(plSceneObject* so);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
class plObjectInVolumeAndFacingDetector : public plObjectInVolumeDetector
|
||||
{
|
||||
protected:
|
||||
hsScalar fFacingTolerance;
|
||||
bool fNeedWalkingForward;
|
||||
|
||||
bool fAvatarInVolume;
|
||||
bool fTriggered;
|
||||
|
||||
void ICheckForTrigger();
|
||||
|
||||
public:
|
||||
plObjectInVolumeAndFacingDetector();
|
||||
virtual ~plObjectInVolumeAndFacingDetector();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER(plObjectInVolumeAndFacingDetector);
|
||||
GETINTERFACE_ANY(plObjectInVolumeAndFacingDetector, plObjectInVolumeDetector);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
// Export only
|
||||
void SetFacingTolerance(int degrees);
|
||||
void SetNeedWalkingForward(bool v) { fNeedWalkingForward = v; }
|
||||
};
|
||||
|
||||
// sub-type for camera command regions
|
||||
|
||||
class plCameraRegionDetector : public plObjectInVolumeDetector
|
||||
{
|
||||
protected:
|
||||
hsTArray<plCameraMsg*> fMessages;
|
||||
bool fIsInside;
|
||||
bool fSavingSendMsg;
|
||||
bool fSavedMsgEnterFlag;
|
||||
int fNumEvals;
|
||||
int fLastEnterEval;
|
||||
int fLastExitEval;
|
||||
|
||||
virtual void ITrigger(plKey hitter, bool entering, bool immediate=false);
|
||||
virtual void ISendSavedTriggerMsgs();
|
||||
virtual void IHandleEval(plEvalMsg* pEval);
|
||||
public:
|
||||
plCameraRegionDetector(){ fIsInside = false; fSavingSendMsg = false; }
|
||||
~plCameraRegionDetector();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
void AddMessage(plCameraMsg* pMsg) { fMessages.Append(pMsg); }
|
||||
|
||||
CLASSNAME_REGISTER( plCameraRegionDetector );
|
||||
GETINTERFACE_ANY( plCameraRegionDetector, plCollisionDetector );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
// sub-type for subworld regions
|
||||
|
||||
class plSubworldRegionDetector : public plCollisionDetector
|
||||
{
|
||||
protected:
|
||||
plKey fSub;
|
||||
hsBool fOnExit;
|
||||
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kSubworld = 0,
|
||||
};
|
||||
plSubworldRegionDetector() : fSub(nil), fOnExit(false){;}
|
||||
~plSubworldRegionDetector();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
void SetSubworldKey(plKey pKey) { fSub = pKey; }
|
||||
void SetTriggerOnExit(hsBool b) { fOnExit = b; }
|
||||
|
||||
CLASSNAME_REGISTER( plSubworldRegionDetector );
|
||||
GETINTERFACE_ANY( plSubworldRegionDetector, plCollisionDetector );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
// sub-type for panic link regions
|
||||
|
||||
class plPanicLinkRegion : public plCollisionDetector
|
||||
{
|
||||
public:
|
||||
hsBool fPlayLinkOutAnim;
|
||||
|
||||
plPanicLinkRegion() : fPlayLinkOutAnim(true) {;}
|
||||
~plPanicLinkRegion(){;}
|
||||
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
CLASSNAME_REGISTER( plPanicLinkRegion );
|
||||
GETINTERFACE_ANY( plPanicLinkRegion, plCollisionDetector );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
/** \Class plSimpleRegionSensor
|
||||
A dead-simple interface for a collision region. Holds one message that it
|
||||
sends to anyone who enters, and another message that it sends to anyone
|
||||
who exits.
|
||||
We may want to tie this into the plCollisionDetector so that it could be
|
||||
integrated with responders.
|
||||
*/
|
||||
class plSimpleRegionSensor : public plSingleModifier
|
||||
{
|
||||
public:
|
||||
plSimpleRegionSensor();
|
||||
plSimpleRegionSensor(plMessage *enterMsg, plMessage *exitMsg);
|
||||
virtual ~plSimpleRegionSensor();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage *msg);
|
||||
CLASSNAME_REGISTER( plSimpleRegionSensor );
|
||||
GETINTERFACE_ANY( plSimpleRegionSensor, plSingleModifier);
|
||||
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
protected:
|
||||
plMessage *fEnterMsg;
|
||||
plMessage *fExitMsg;
|
||||
};
|
||||
|
||||
// This class really just exists so that I can hunt for it specifically by index
|
||||
// (and not accidentally get some other SimpleRegionSensor).
|
||||
class plSwimDetector : public plSimpleRegionSensor
|
||||
{
|
||||
public:
|
||||
plSwimDetector() {}
|
||||
plSwimDetector(plMessage *enterMsg, plMessage *exitMsg) : plSimpleRegionSensor(enterMsg, exitMsg) {}
|
||||
virtual ~plSwimDetector() {}
|
||||
|
||||
CLASSNAME_REGISTER( plSwimDetector );
|
||||
GETINTERFACE_ANY( plSwimDetector, plSimpleRegionSensor);
|
||||
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
hsBool MsgReceive(plMessage *msg);
|
||||
};
|
||||
class plRidingAnimatedPhysicalDetector: public plSimpleRegionSensor
|
||||
{
|
||||
public:
|
||||
plRidingAnimatedPhysicalDetector(){}
|
||||
plRidingAnimatedPhysicalDetector(plMessage *enterMsg, plMessage *exitMsg) : plSimpleRegionSensor(enterMsg, exitMsg) {}
|
||||
virtual ~plRidingAnimatedPhysicalDetector(){}
|
||||
virtual hsBool MsgReceive(plMessage *msg);
|
||||
CLASSNAME_REGISTER( plRidingAnimatedPhysicalDetector );
|
||||
GETINTERFACE_ANY( plRidingAnimatedPhysicalDetector, plSimpleRegionSensor);
|
||||
};
|
||||
#endif plCollisionDetector_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plCollisionDetector_inc
|
||||
#define plCollisionDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
#include "hsGeometry3.h"
|
||||
#include <list>
|
||||
#include <set>
|
||||
class plMessage;
|
||||
class plCameraMsg;
|
||||
class plArmatureMod;
|
||||
class plActivatorMsg;
|
||||
class plEvalMsg;
|
||||
|
||||
class plCollisionDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
Int8 fType;
|
||||
hsBool fBumped, fTriggered;
|
||||
|
||||
plArmatureMod* IGetAvatarModifier(plKey key);
|
||||
bool IIsDisabledAvatar(plKey key);
|
||||
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kTypeEnter = 0x01,
|
||||
kTypeExit = 0x02,
|
||||
kTypeAny = 0x04,
|
||||
kTypeUnEnter = 0x08,
|
||||
kTypeUnExit = 0x10,
|
||||
kTypeBump = 0x20,
|
||||
};
|
||||
|
||||
plCollisionDetector() : fType(0), fTriggered(false), fBumped(false){;}
|
||||
virtual ~plCollisionDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plCollisionDetector );
|
||||
GETINTERFACE_ANY( plCollisionDetector, plDetectorModifier );
|
||||
|
||||
virtual void SetType(Int8 i) { fType |= i; }
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
// sub type for object-in-volume detectors
|
||||
class plObjectInVolumeDetector : public plCollisionDetector
|
||||
{
|
||||
public:
|
||||
class plCollisionBookKeepingInfo
|
||||
{
|
||||
friend plObjectInVolumeDetector;
|
||||
public:
|
||||
plCollisionBookKeepingInfo(plKey& hit)
|
||||
{
|
||||
hitter=hit;
|
||||
enters=0;
|
||||
exits=0;
|
||||
}
|
||||
~plCollisionBookKeepingInfo()
|
||||
{
|
||||
hitter=nil;
|
||||
}
|
||||
protected:
|
||||
plKey hitter;
|
||||
int enters,exits;
|
||||
bool fSubStepCurState;
|
||||
};
|
||||
protected:
|
||||
virtual void ITrigger(plKey hitter, bool entering, bool immediate=false);
|
||||
//virtual void ISendSavedTriggerMsgs();
|
||||
virtual void IHandleEval(plEvalMsg* pEval);
|
||||
bool fWaitingForEval;
|
||||
|
||||
plActivatorMsg* fSavedActivatorMsg;
|
||||
|
||||
typedef std::list<plCollisionBookKeepingInfo*> bookKeepingList;
|
||||
bookKeepingList fCollisionList;
|
||||
typedef std::set<plKey> ResidentSet;
|
||||
ResidentSet fCurrentResidents;
|
||||
|
||||
public:
|
||||
|
||||
plObjectInVolumeDetector()
|
||||
{
|
||||
fWaitingForEval=false;fSavedActivatorMsg=nil;
|
||||
|
||||
}
|
||||
plObjectInVolumeDetector(Int8 i){fType = i;fWaitingForEval=false;fSavedActivatorMsg=nil;}
|
||||
virtual ~plObjectInVolumeDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER(plObjectInVolumeDetector);
|
||||
GETINTERFACE_ANY(plObjectInVolumeDetector, plCollisionDetector);
|
||||
|
||||
virtual void SetTarget(plSceneObject* so);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
class plObjectInVolumeAndFacingDetector : public plObjectInVolumeDetector
|
||||
{
|
||||
protected:
|
||||
hsScalar fFacingTolerance;
|
||||
bool fNeedWalkingForward;
|
||||
|
||||
bool fAvatarInVolume;
|
||||
bool fTriggered;
|
||||
|
||||
void ICheckForTrigger();
|
||||
|
||||
public:
|
||||
plObjectInVolumeAndFacingDetector();
|
||||
virtual ~plObjectInVolumeAndFacingDetector();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER(plObjectInVolumeAndFacingDetector);
|
||||
GETINTERFACE_ANY(plObjectInVolumeAndFacingDetector, plObjectInVolumeDetector);
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
// Export only
|
||||
void SetFacingTolerance(int degrees);
|
||||
void SetNeedWalkingForward(bool v) { fNeedWalkingForward = v; }
|
||||
};
|
||||
|
||||
// sub-type for camera command regions
|
||||
|
||||
class plCameraRegionDetector : public plObjectInVolumeDetector
|
||||
{
|
||||
protected:
|
||||
hsTArray<plCameraMsg*> fMessages;
|
||||
bool fIsInside;
|
||||
bool fSavingSendMsg;
|
||||
bool fSavedMsgEnterFlag;
|
||||
int fNumEvals;
|
||||
int fLastEnterEval;
|
||||
int fLastExitEval;
|
||||
|
||||
virtual void ITrigger(plKey hitter, bool entering, bool immediate=false);
|
||||
virtual void ISendSavedTriggerMsgs();
|
||||
virtual void IHandleEval(plEvalMsg* pEval);
|
||||
public:
|
||||
plCameraRegionDetector(){ fIsInside = false; fSavingSendMsg = false; }
|
||||
~plCameraRegionDetector();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
void AddMessage(plCameraMsg* pMsg) { fMessages.Append(pMsg); }
|
||||
|
||||
CLASSNAME_REGISTER( plCameraRegionDetector );
|
||||
GETINTERFACE_ANY( plCameraRegionDetector, plCollisionDetector );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
// sub-type for subworld regions
|
||||
|
||||
class plSubworldRegionDetector : public plCollisionDetector
|
||||
{
|
||||
protected:
|
||||
plKey fSub;
|
||||
hsBool fOnExit;
|
||||
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kSubworld = 0,
|
||||
};
|
||||
plSubworldRegionDetector() : fSub(nil), fOnExit(false){;}
|
||||
~plSubworldRegionDetector();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
void SetSubworldKey(plKey pKey) { fSub = pKey; }
|
||||
void SetTriggerOnExit(hsBool b) { fOnExit = b; }
|
||||
|
||||
CLASSNAME_REGISTER( plSubworldRegionDetector );
|
||||
GETINTERFACE_ANY( plSubworldRegionDetector, plCollisionDetector );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
// sub-type for panic link regions
|
||||
|
||||
class plPanicLinkRegion : public plCollisionDetector
|
||||
{
|
||||
public:
|
||||
hsBool fPlayLinkOutAnim;
|
||||
|
||||
plPanicLinkRegion() : fPlayLinkOutAnim(true) {;}
|
||||
~plPanicLinkRegion(){;}
|
||||
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
CLASSNAME_REGISTER( plPanicLinkRegion );
|
||||
GETINTERFACE_ANY( plPanicLinkRegion, plCollisionDetector );
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
|
||||
/** \Class plSimpleRegionSensor
|
||||
A dead-simple interface for a collision region. Holds one message that it
|
||||
sends to anyone who enters, and another message that it sends to anyone
|
||||
who exits.
|
||||
We may want to tie this into the plCollisionDetector so that it could be
|
||||
integrated with responders.
|
||||
*/
|
||||
class plSimpleRegionSensor : public plSingleModifier
|
||||
{
|
||||
public:
|
||||
plSimpleRegionSensor();
|
||||
plSimpleRegionSensor(plMessage *enterMsg, plMessage *exitMsg);
|
||||
virtual ~plSimpleRegionSensor();
|
||||
|
||||
virtual hsBool MsgReceive(plMessage *msg);
|
||||
CLASSNAME_REGISTER( plSimpleRegionSensor );
|
||||
GETINTERFACE_ANY( plSimpleRegionSensor, plSingleModifier);
|
||||
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
protected:
|
||||
plMessage *fEnterMsg;
|
||||
plMessage *fExitMsg;
|
||||
};
|
||||
|
||||
// This class really just exists so that I can hunt for it specifically by index
|
||||
// (and not accidentally get some other SimpleRegionSensor).
|
||||
class plSwimDetector : public plSimpleRegionSensor
|
||||
{
|
||||
public:
|
||||
plSwimDetector() {}
|
||||
plSwimDetector(plMessage *enterMsg, plMessage *exitMsg) : plSimpleRegionSensor(enterMsg, exitMsg) {}
|
||||
virtual ~plSwimDetector() {}
|
||||
|
||||
CLASSNAME_REGISTER( plSwimDetector );
|
||||
GETINTERFACE_ANY( plSwimDetector, plSimpleRegionSensor);
|
||||
|
||||
virtual void Write(hsStream *stream, hsResMgr *mgr);
|
||||
virtual void Read(hsStream *stream, hsResMgr *mgr);
|
||||
hsBool MsgReceive(plMessage *msg);
|
||||
};
|
||||
class plRidingAnimatedPhysicalDetector: public plSimpleRegionSensor
|
||||
{
|
||||
public:
|
||||
plRidingAnimatedPhysicalDetector(){}
|
||||
plRidingAnimatedPhysicalDetector(plMessage *enterMsg, plMessage *exitMsg) : plSimpleRegionSensor(enterMsg, exitMsg) {}
|
||||
virtual ~plRidingAnimatedPhysicalDetector(){}
|
||||
virtual hsBool MsgReceive(plMessage *msg);
|
||||
CLASSNAME_REGISTER( plRidingAnimatedPhysicalDetector );
|
||||
GETINTERFACE_ANY( plRidingAnimatedPhysicalDetector, plSimpleRegionSensor);
|
||||
};
|
||||
#endif plCollisionDetector_inc
|
||||
|
@ -1,85 +1,85 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plDetectorModifier_inc
|
||||
#define plDetectorModifier_inc
|
||||
|
||||
#include "pnModifier/plSingleModifier.h"
|
||||
#include "pnMessage/plObjRefMsg.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
class plDetectorModifier : public plSingleModifier
|
||||
{
|
||||
protected:
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty){ return true; }
|
||||
|
||||
hsTArray<plKey> fReceivers;
|
||||
plModifier* fRemoteMod;
|
||||
plKey fProxyKey;
|
||||
|
||||
public:
|
||||
plDetectorModifier() : fRemoteMod(nil),fProxyKey(nil){;}
|
||||
virtual ~plDetectorModifier(){;}
|
||||
|
||||
// virtual hsBool MsgReceive(plMessage* msg) = 0;
|
||||
|
||||
CLASSNAME_REGISTER( plDetectorModifier );
|
||||
GETINTERFACE_ANY( plDetectorModifier, plSingleModifier );
|
||||
void AddLogicObj(plKey pKey) { fReceivers.Append(pKey); }
|
||||
void SetRemote(plModifier* p) { fRemoteMod = p; }
|
||||
plModifier* RemoteMod() { return fRemoteMod; }
|
||||
virtual void SetType(Int8 i) {;}
|
||||
int GetNumReceivers() const { return fReceivers.Count(); }
|
||||
plKey GetReceiver(int i) const { return fReceivers[i]; }
|
||||
void SetProxyKey(const plKey &k) { fProxyKey = k; }
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plSingleModifier::Read(stream, mgr);
|
||||
int n = stream->ReadSwap32();
|
||||
fReceivers.Reset();
|
||||
for(int i = 0; i < n; i++ )
|
||||
{
|
||||
fReceivers.Append(mgr->ReadKey(stream));
|
||||
}
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
|
||||
fProxyKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plSingleModifier::Write(stream, mgr);
|
||||
stream->WriteSwap32(fReceivers.GetCount());
|
||||
for( int i = 0; i < fReceivers.GetCount(); i++ )
|
||||
mgr->WriteKey(stream, fReceivers[i]);
|
||||
|
||||
mgr->WriteKey(stream, fRemoteMod);
|
||||
mgr->WriteKey(stream, fProxyKey);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif plDetectorModifier_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plDetectorModifier_inc
|
||||
#define plDetectorModifier_inc
|
||||
|
||||
#include "pnModifier/plSingleModifier.h"
|
||||
#include "pnMessage/plObjRefMsg.h"
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
|
||||
class plDetectorModifier : public plSingleModifier
|
||||
{
|
||||
protected:
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty){ return true; }
|
||||
|
||||
hsTArray<plKey> fReceivers;
|
||||
plModifier* fRemoteMod;
|
||||
plKey fProxyKey;
|
||||
|
||||
public:
|
||||
plDetectorModifier() : fRemoteMod(nil),fProxyKey(nil){;}
|
||||
virtual ~plDetectorModifier(){;}
|
||||
|
||||
// virtual hsBool MsgReceive(plMessage* msg) = 0;
|
||||
|
||||
CLASSNAME_REGISTER( plDetectorModifier );
|
||||
GETINTERFACE_ANY( plDetectorModifier, plSingleModifier );
|
||||
void AddLogicObj(plKey pKey) { fReceivers.Append(pKey); }
|
||||
void SetRemote(plModifier* p) { fRemoteMod = p; }
|
||||
plModifier* RemoteMod() { return fRemoteMod; }
|
||||
virtual void SetType(Int8 i) {;}
|
||||
int GetNumReceivers() const { return fReceivers.Count(); }
|
||||
plKey GetReceiver(int i) const { return fReceivers[i]; }
|
||||
void SetProxyKey(const plKey &k) { fProxyKey = k; }
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plSingleModifier::Read(stream, mgr);
|
||||
int n = stream->ReadSwap32();
|
||||
fReceivers.Reset();
|
||||
for(int i = 0; i < n; i++ )
|
||||
{
|
||||
fReceivers.Append(mgr->ReadKey(stream));
|
||||
}
|
||||
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plObjRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plObjRefMsg::kModifier), plRefFlags::kActiveRef);
|
||||
fProxyKey = mgr->ReadKey(stream);
|
||||
}
|
||||
|
||||
void Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plSingleModifier::Write(stream, mgr);
|
||||
stream->WriteSwap32(fReceivers.GetCount());
|
||||
for( int i = 0; i < fReceivers.GetCount(); i++ )
|
||||
mgr->WriteKey(stream, fReceivers[i]);
|
||||
|
||||
mgr->WriteKey(stream, fRemoteMod);
|
||||
mgr->WriteKey(stream, fProxyKey);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif plDetectorModifier_inc
|
||||
|
@ -1,76 +1,76 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
#include "plEnvEffectDetector.h"
|
||||
#include "../plMessage/plCollideMsg.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "../pnMessage/plEnvEffectMsg.h"
|
||||
|
||||
/*
|
||||
hsBool plEnvEffectDetector::MsgReceive(plMessage* msg)
|
||||
{
|
||||
plCollideMsg* pCollMsg = plCollideMsg::ConvertNoRef(msg);
|
||||
|
||||
if (pCollMsg)
|
||||
{
|
||||
for (int i = 0; i < fEffectMsg.Count(); i++)
|
||||
{
|
||||
fEffectMsg[i]->ClearReceivers();
|
||||
if(pCollMsg->fEntering)
|
||||
{
|
||||
fEffectMsg[i]->Enable( true );
|
||||
} else {
|
||||
fEffectMsg[i]->Enable( false );
|
||||
}
|
||||
fEffectMsg[i]->AddReceiver( pCollMsg->fOtherKey );
|
||||
hsRefCnt_SafeRef(fEffectMsg[i]);
|
||||
plgDispatch::MsgSend( fEffectMsg[i] );
|
||||
}
|
||||
}
|
||||
return plDetectorModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
void plEnvEffectDetector::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plDetectorModifier::Read(stream, mgr);
|
||||
int n = stream->ReadSwap32();
|
||||
fEffectMsg.SetCountAndZero(n);
|
||||
for(int i = 0; i < n; i++ )
|
||||
{
|
||||
plEnvEffectMsg* pMsg = plEnvEffectMsg::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
fEffectMsg[i] = pMsg;
|
||||
}
|
||||
}
|
||||
|
||||
void plEnvEffectDetector::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plDetectorModifier::Write(stream, mgr);
|
||||
stream->WriteSwap32(fEffectMsg.GetCount());
|
||||
for(int i = 0; i < fEffectMsg.GetCount(); i++ )
|
||||
mgr->WriteCreatable( stream, fEffectMsg[i] );
|
||||
|
||||
}
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
#include "plEnvEffectDetector.h"
|
||||
#include "../plMessage/plCollideMsg.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "../pnMessage/plEnvEffectMsg.h"
|
||||
|
||||
/*
|
||||
hsBool plEnvEffectDetector::MsgReceive(plMessage* msg)
|
||||
{
|
||||
plCollideMsg* pCollMsg = plCollideMsg::ConvertNoRef(msg);
|
||||
|
||||
if (pCollMsg)
|
||||
{
|
||||
for (int i = 0; i < fEffectMsg.Count(); i++)
|
||||
{
|
||||
fEffectMsg[i]->ClearReceivers();
|
||||
if(pCollMsg->fEntering)
|
||||
{
|
||||
fEffectMsg[i]->Enable( true );
|
||||
} else {
|
||||
fEffectMsg[i]->Enable( false );
|
||||
}
|
||||
fEffectMsg[i]->AddReceiver( pCollMsg->fOtherKey );
|
||||
hsRefCnt_SafeRef(fEffectMsg[i]);
|
||||
plgDispatch::MsgSend( fEffectMsg[i] );
|
||||
}
|
||||
}
|
||||
return plDetectorModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
void plEnvEffectDetector::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plDetectorModifier::Read(stream, mgr);
|
||||
int n = stream->ReadSwap32();
|
||||
fEffectMsg.SetCountAndZero(n);
|
||||
for(int i = 0; i < n; i++ )
|
||||
{
|
||||
plEnvEffectMsg* pMsg = plEnvEffectMsg::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
fEffectMsg[i] = pMsg;
|
||||
}
|
||||
}
|
||||
|
||||
void plEnvEffectDetector::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plDetectorModifier::Write(stream, mgr);
|
||||
stream->WriteSwap32(fEffectMsg.GetCount());
|
||||
for(int i = 0; i < fEffectMsg.GetCount(); i++ )
|
||||
mgr->WriteCreatable( stream, fEffectMsg[i] );
|
||||
|
||||
}
|
||||
*/
|
@ -1,57 +1,57 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plEnvEffectDetector_inc
|
||||
#define plEnvEffectDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
class plEnvEffectMsg;
|
||||
class plMessage;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plEnvEffectDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plEnvEffectDetector(){;}
|
||||
virtual ~plEnvEffectDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plEnvEffectDetector );
|
||||
GETINTERFACE_ANY( plEnvEffectDetector, plDetectorModifier );
|
||||
|
||||
hsTArray<plEnvEffectMsg*> fEffectMsg;
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
};
|
||||
|
||||
#endif plEnvEffectDetector_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plEnvEffectDetector_inc
|
||||
#define plEnvEffectDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
class plEnvEffectMsg;
|
||||
class plMessage;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plEnvEffectDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plEnvEffectDetector(){;}
|
||||
virtual ~plEnvEffectDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plEnvEffectDetector );
|
||||
GETINTERFACE_ANY( plEnvEffectDetector, plDetectorModifier );
|
||||
|
||||
hsTArray<plEnvEffectMsg*> fEffectMsg;
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
};
|
||||
|
||||
#endif plEnvEffectDetector_inc
|
||||
|
@ -1,58 +1,58 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plPhysicalCreatable_inc
|
||||
#define plPhysicalCreatable_inc
|
||||
|
||||
#include "pnFactory/plCreator.h"
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
REGISTER_NONCREATABLE( plDetectorModifier );
|
||||
|
||||
#include "plPickingDetector.h"
|
||||
|
||||
REGISTER_CREATABLE( plPickingDetector );
|
||||
|
||||
#include "plCollisionDetector.h"
|
||||
|
||||
REGISTER_CREATABLE( plCollisionDetector );
|
||||
REGISTER_CREATABLE( plCameraRegionDetector );
|
||||
REGISTER_CREATABLE( plObjectInVolumeDetector );
|
||||
REGISTER_CREATABLE( plObjectInVolumeAndFacingDetector );
|
||||
REGISTER_CREATABLE( plSubworldRegionDetector );
|
||||
REGISTER_CREATABLE( plPanicLinkRegion );
|
||||
REGISTER_CREATABLE( plSimpleRegionSensor );
|
||||
REGISTER_CREATABLE( plSwimDetector );
|
||||
REGISTER_CREATABLE( plRidingAnimatedPhysicalDetector );
|
||||
|
||||
#include "plPhysicalSDLModifier.h"
|
||||
REGISTER_CREATABLE( plPhysicalSDLModifier );
|
||||
|
||||
#include "plPhysicalSndGroup.h"
|
||||
REGISTER_CREATABLE(plPhysicalSndGroup);
|
||||
|
||||
#endif // plPhysicalCreatable_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plPhysicalCreatable_inc
|
||||
#define plPhysicalCreatable_inc
|
||||
|
||||
#include "pnFactory/plCreator.h"
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
REGISTER_NONCREATABLE( plDetectorModifier );
|
||||
|
||||
#include "plPickingDetector.h"
|
||||
|
||||
REGISTER_CREATABLE( plPickingDetector );
|
||||
|
||||
#include "plCollisionDetector.h"
|
||||
|
||||
REGISTER_CREATABLE( plCollisionDetector );
|
||||
REGISTER_CREATABLE( plCameraRegionDetector );
|
||||
REGISTER_CREATABLE( plObjectInVolumeDetector );
|
||||
REGISTER_CREATABLE( plObjectInVolumeAndFacingDetector );
|
||||
REGISTER_CREATABLE( plSubworldRegionDetector );
|
||||
REGISTER_CREATABLE( plPanicLinkRegion );
|
||||
REGISTER_CREATABLE( plSimpleRegionSensor );
|
||||
REGISTER_CREATABLE( plSwimDetector );
|
||||
REGISTER_CREATABLE( plRidingAnimatedPhysicalDetector );
|
||||
|
||||
#include "plPhysicalSDLModifier.h"
|
||||
REGISTER_CREATABLE( plPhysicalSDLModifier );
|
||||
|
||||
#include "plPhysicalSndGroup.h"
|
||||
REGISTER_CREATABLE(plPhysicalSndGroup);
|
||||
|
||||
#endif // plPhysicalCreatable_inc
|
||||
|
@ -1,95 +1,95 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plPhysicalProxy.h"
|
||||
#include "plPhysical.h"
|
||||
#include "plPhysX/plPXPhysicalControllerCore.h"
|
||||
#include "plDrawable/plDrawableSpans.h"
|
||||
#include "plDrawable/plDrawableGenerator.h"
|
||||
#include "pnMessage/plProxyDrawMsg.h"
|
||||
|
||||
#include "plSurface/hsGMaterial.h"
|
||||
#include "plSurface/plLayer.h"
|
||||
|
||||
plPhysicalProxy::plPhysicalProxy()
|
||||
: plProxyGen(hsColorRGBA().Set(0,0,0,1.f), hsColorRGBA().Set(1.f,0.8f,0.2f,1.f), 0.5f),
|
||||
fOwner(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plPhysicalProxy::plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac)
|
||||
: plProxyGen(amb, dif, opac),
|
||||
fOwner(nil),
|
||||
fController(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plPhysicalProxy::~plPhysicalProxy()
|
||||
{
|
||||
}
|
||||
|
||||
bool plPhysicalProxy::Init(plPhysical* liInfo)
|
||||
{
|
||||
plProxyGen::Init(liInfo);
|
||||
|
||||
fOwner = liInfo;
|
||||
fProxyMsgType = plProxyDrawMsg::kPhysical;
|
||||
|
||||
return fOwner != nil;
|
||||
}
|
||||
|
||||
bool plPhysicalProxy::Init(plPXPhysicalControllerCore* controller)
|
||||
{
|
||||
if (controller)
|
||||
if (controller->GetOwner())
|
||||
plProxyGen::Init(controller->GetOwner()->GetObjectPtr());
|
||||
|
||||
fController = controller;
|
||||
fProxyMsgType = plProxyDrawMsg::kPhysical;
|
||||
|
||||
return fController != nil;
|
||||
}
|
||||
|
||||
plKey plPhysicalProxy::IGetNode() const
|
||||
{
|
||||
if (fOwner)
|
||||
return fOwner->GetSceneNode();
|
||||
if (fController)
|
||||
return fController->GetOwner();
|
||||
return nil;
|
||||
}
|
||||
|
||||
plDrawableSpans* plPhysicalProxy::ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo)
|
||||
{
|
||||
if (fOwner)
|
||||
{
|
||||
return fOwner->CreateProxy(mat, idx, addTo);
|
||||
}
|
||||
if (fController)
|
||||
{
|
||||
return fController->CreateProxy(mat,idx,addTo);
|
||||
}
|
||||
return nil;
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plPhysicalProxy.h"
|
||||
#include "plPhysical.h"
|
||||
#include "plPhysX/plPXPhysicalControllerCore.h"
|
||||
#include "plDrawable/plDrawableSpans.h"
|
||||
#include "plDrawable/plDrawableGenerator.h"
|
||||
#include "pnMessage/plProxyDrawMsg.h"
|
||||
|
||||
#include "plSurface/hsGMaterial.h"
|
||||
#include "plSurface/plLayer.h"
|
||||
|
||||
plPhysicalProxy::plPhysicalProxy()
|
||||
: plProxyGen(hsColorRGBA().Set(0,0,0,1.f), hsColorRGBA().Set(1.f,0.8f,0.2f,1.f), 0.5f),
|
||||
fOwner(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plPhysicalProxy::plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac)
|
||||
: plProxyGen(amb, dif, opac),
|
||||
fOwner(nil),
|
||||
fController(nil)
|
||||
{
|
||||
}
|
||||
|
||||
plPhysicalProxy::~plPhysicalProxy()
|
||||
{
|
||||
}
|
||||
|
||||
bool plPhysicalProxy::Init(plPhysical* liInfo)
|
||||
{
|
||||
plProxyGen::Init(liInfo);
|
||||
|
||||
fOwner = liInfo;
|
||||
fProxyMsgType = plProxyDrawMsg::kPhysical;
|
||||
|
||||
return fOwner != nil;
|
||||
}
|
||||
|
||||
bool plPhysicalProxy::Init(plPXPhysicalControllerCore* controller)
|
||||
{
|
||||
if (controller)
|
||||
if (controller->GetOwner())
|
||||
plProxyGen::Init(controller->GetOwner()->GetObjectPtr());
|
||||
|
||||
fController = controller;
|
||||
fProxyMsgType = plProxyDrawMsg::kPhysical;
|
||||
|
||||
return fController != nil;
|
||||
}
|
||||
|
||||
plKey plPhysicalProxy::IGetNode() const
|
||||
{
|
||||
if (fOwner)
|
||||
return fOwner->GetSceneNode();
|
||||
if (fController)
|
||||
return fController->GetOwner();
|
||||
return nil;
|
||||
}
|
||||
|
||||
plDrawableSpans* plPhysicalProxy::ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo)
|
||||
{
|
||||
if (fOwner)
|
||||
{
|
||||
return fOwner->CreateProxy(mat, idx, addTo);
|
||||
}
|
||||
if (fController)
|
||||
{
|
||||
return fController->CreateProxy(mat,idx,addTo);
|
||||
}
|
||||
return nil;
|
||||
}
|
@ -1,54 +1,54 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPhysicalProxy_inc
|
||||
#define plPhysicalProxy_inc
|
||||
|
||||
#include "plDrawable/plProxyGen.h"
|
||||
|
||||
class plDrawableSpans;
|
||||
class hsGMaterial;
|
||||
class plPhysical;
|
||||
class plPXPhysicalControllerCore;
|
||||
|
||||
class plPhysicalProxy : public plProxyGen
|
||||
{
|
||||
public:
|
||||
plPhysicalProxy();
|
||||
plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac);
|
||||
virtual ~plPhysicalProxy();
|
||||
|
||||
bool Init(plPhysical* phys);
|
||||
bool Init(plPXPhysicalControllerCore* controller);
|
||||
|
||||
protected:
|
||||
plPhysical* fOwner;
|
||||
plPXPhysicalControllerCore* fController;
|
||||
|
||||
virtual plDrawableSpans* ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo=nil);
|
||||
virtual plKey IGetNode() const;
|
||||
};
|
||||
|
||||
#endif // plPhysicalProxy_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPhysicalProxy_inc
|
||||
#define plPhysicalProxy_inc
|
||||
|
||||
#include "plDrawable/plProxyGen.h"
|
||||
|
||||
class plDrawableSpans;
|
||||
class hsGMaterial;
|
||||
class plPhysical;
|
||||
class plPXPhysicalControllerCore;
|
||||
|
||||
class plPhysicalProxy : public plProxyGen
|
||||
{
|
||||
public:
|
||||
plPhysicalProxy();
|
||||
plPhysicalProxy(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac);
|
||||
virtual ~plPhysicalProxy();
|
||||
|
||||
bool Init(plPhysical* phys);
|
||||
bool Init(plPXPhysicalControllerCore* controller);
|
||||
|
||||
protected:
|
||||
plPhysical* fOwner;
|
||||
plPXPhysicalControllerCore* fController;
|
||||
|
||||
virtual plDrawableSpans* ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo=nil);
|
||||
virtual plKey IGetNode() const;
|
||||
};
|
||||
|
||||
#endif // plPhysicalProxy_inc
|
||||
|
@ -1,256 +1,256 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plPhysicalSDLModifier.h"
|
||||
|
||||
#include "hsGeometry3.h"
|
||||
#include "plPhysical.h"
|
||||
#include "plSDL/plSDL.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "pnSceneObject/plSimulationInterface.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "hsQuat.h"
|
||||
//#include "plHavok1/plSimulationMgr.h"
|
||||
#include "plStatusLog/plStatusLog.h"
|
||||
|
||||
// static vars
|
||||
static const char* kStrLinear = "linear";
|
||||
static const char* kStrAngular = "angular";
|
||||
static const char* kStrPosition = "position";
|
||||
static const char* kStrOrientation = "orientation";
|
||||
|
||||
int plPhysicalSDLModifier::fLogLevel = 0;
|
||||
|
||||
static void IGetVars(plStateDataRecord::SimpleVarsList& vars,
|
||||
hsPoint3& pos, bool& isPosSet,
|
||||
hsQuat& rot, bool& isRotSet,
|
||||
hsVector3& linV, bool& isLinVSet,
|
||||
hsVector3& angV, bool& isAngVSet);
|
||||
|
||||
//
|
||||
// get current state from physical
|
||||
// fill out state data rec
|
||||
//
|
||||
void plPhysicalSDLModifier::IPutCurrentStateIn(plStateDataRecord* dstState)
|
||||
{
|
||||
plPhysical* phys = IGetPhysical();
|
||||
|
||||
// get latest state
|
||||
hsPoint3 curPos;
|
||||
hsQuat curOrientation;
|
||||
hsVector3 curLinear, curAngular;
|
||||
phys->GetSyncState(curPos, curOrientation, curLinear, curAngular);
|
||||
|
||||
// put it in sdl state record
|
||||
dstState->FindVar(kStrPosition)->Set(&curPos.fX);
|
||||
dstState->FindVar(kStrOrientation)->Set(&curOrientation.fX);
|
||||
dstState->FindVar(kStrLinear)->Set(&curLinear.fX);
|
||||
dstState->FindVar(kStrAngular)->Set(&curAngular.fX);
|
||||
|
||||
if (fLogLevel > 1)
|
||||
ILogState(dstState, false, "PUT", plStatusLog::kWhite);
|
||||
}
|
||||
|
||||
void plPhysicalSDLModifier::ISetCurrentStateFrom(const plStateDataRecord* srcState)
|
||||
{
|
||||
plPhysical* phys = IGetPhysical();
|
||||
|
||||
// FIXME PHYSX
|
||||
|
||||
// if(phys->GetBody()->isFixed())
|
||||
// {
|
||||
// plSimulationMgr::Log("Received synch for fixed body %s", phys->GetKey()->GetName());
|
||||
// return;
|
||||
// }
|
||||
// else if (phys->GetProperty(plSimulationInterface::kPinned))
|
||||
// {
|
||||
// // This is mainly intended for avatars. When pinning them (like in a multistage),
|
||||
// // we don't want physical updates to sneak in due to network lag. If necessary,
|
||||
// // this could be made a separate property on the physical, orthagonal to kPinned.
|
||||
// return;
|
||||
// }
|
||||
// else
|
||||
{
|
||||
hsPoint3 pos;
|
||||
bool isPosSet;
|
||||
hsQuat rot;
|
||||
bool isRotSet;
|
||||
hsVector3 linV;
|
||||
bool isLinVSet;
|
||||
hsVector3 angV;
|
||||
bool isAngVSet;
|
||||
|
||||
plStateDataRecord::SimpleVarsList vars;
|
||||
srcState->GetUsedVars(&vars);
|
||||
IGetVars(vars, pos, isPosSet, rot, isRotSet, linV, isLinVSet, angV, isAngVSet);
|
||||
|
||||
if (fLogLevel > 0)
|
||||
ILogState(srcState, false, "RCV", plStatusLog::kGreen);
|
||||
|
||||
phys->SetSyncState(
|
||||
isPosSet ? &pos : nil,
|
||||
isRotSet ? &rot : nil,
|
||||
isLinVSet ? &linV : nil,
|
||||
isAngVSet ? &angV : nil);
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicalSDLModifier::ISentState(const plStateDataRecord* sentState)
|
||||
{
|
||||
if (fLogLevel > 0)
|
||||
{
|
||||
ILogState(sentState, true, "SND", plStatusLog::kYellow);
|
||||
|
||||
// plPhysical* phys = IGetPhysical();
|
||||
// if (!phys->GetBody()->isActive())
|
||||
// IGetLog()->AddLineF("Phys %s sent state because it deactivated", phys->GetKeyName());
|
||||
}
|
||||
}
|
||||
|
||||
static void IGetVars(plStateDataRecord::SimpleVarsList& vars,
|
||||
hsPoint3& pos, bool& isPosSet,
|
||||
hsQuat& rot, bool& isRotSet,
|
||||
hsVector3& linV, bool& isLinVSet,
|
||||
hsVector3& angV, bool& isAngVSet)
|
||||
{
|
||||
isPosSet = false;
|
||||
isRotSet = false;
|
||||
isLinVSet = false;
|
||||
isAngVSet = false;
|
||||
|
||||
int num = vars.size();
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (vars[i]->IsNamed(kStrPosition))
|
||||
{
|
||||
vars[i]->Get(&pos.fX);
|
||||
isPosSet= true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed(kStrOrientation))
|
||||
{
|
||||
vars[i]->Get(&rot.fX);
|
||||
isRotSet = true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed(kStrLinear))
|
||||
{
|
||||
vars[i]->Get(&linV.fX);
|
||||
isLinVSet = true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed(kStrAngular))
|
||||
{
|
||||
vars[i]->Get(&angV.fX);
|
||||
isAngVSet = true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed("subworld"))
|
||||
{
|
||||
// Unused
|
||||
}
|
||||
else
|
||||
{
|
||||
hsAssert(false, "Unknown var name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDirty, const char* prefix, UInt32 color)
|
||||
{
|
||||
hsPoint3 pos;
|
||||
bool isPosSet;
|
||||
hsQuat rot;
|
||||
bool isRotSet;
|
||||
hsVector3 linV;
|
||||
bool isLinVSet;
|
||||
hsVector3 angV;
|
||||
bool isAngVSet;
|
||||
|
||||
plStateDataRecord::SimpleVarsList vars;
|
||||
if (useDirty)
|
||||
state->GetDirtyVars(&vars);
|
||||
else
|
||||
state->GetUsedVars(&vars);
|
||||
|
||||
IGetVars(vars, pos, isPosSet, rot, isRotSet, linV, isLinVSet, angV, isAngVSet);
|
||||
|
||||
plPhysical* phys = IGetPhysical();
|
||||
|
||||
std::string log = xtl::format("%s: %s", phys->GetKeyName(), prefix);
|
||||
|
||||
if (isPosSet)
|
||||
log += xtl::format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ);
|
||||
else
|
||||
log += " Pos=None";
|
||||
|
||||
if (isLinVSet)
|
||||
log += xtl::format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ);
|
||||
else
|
||||
log += " LinV=None";
|
||||
|
||||
if (isAngVSet)
|
||||
log += xtl::format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ);
|
||||
else
|
||||
log += " AngV=None";
|
||||
|
||||
if (isRotSet)
|
||||
log += xtl::format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW);
|
||||
else
|
||||
log += " Rot=None";
|
||||
|
||||
IGetLog()->AddLine(log.c_str(), color);
|
||||
}
|
||||
|
||||
plStatusLog* plPhysicalSDLModifier::IGetLog()
|
||||
{
|
||||
static plStatusLog* gLog = nil;
|
||||
if (!gLog)
|
||||
{
|
||||
gLog = plStatusLogMgr::GetInstance().CreateStatusLog(20, "PhysicsSDL.log",
|
||||
plStatusLog::kFilledBackground |
|
||||
plStatusLog::kTimestamp |
|
||||
plStatusLog::kDeleteForMe |
|
||||
plStatusLog::kAlignToTop);
|
||||
}
|
||||
|
||||
return gLog;
|
||||
}
|
||||
|
||||
plPhysical* plPhysicalSDLModifier::IGetPhysical()
|
||||
{
|
||||
plPhysical* phys = nil;
|
||||
|
||||
plSceneObject* sobj = GetTarget();
|
||||
if (sobj)
|
||||
{
|
||||
const plSimulationInterface* si = sobj->GetSimulationInterface();
|
||||
if (si)
|
||||
phys = si->GetPhysical();
|
||||
}
|
||||
|
||||
hsAssert(phys, "nil hkPhysical");
|
||||
return phys;
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plPhysicalSDLModifier.h"
|
||||
|
||||
#include "hsGeometry3.h"
|
||||
#include "plPhysical.h"
|
||||
#include "plSDL/plSDL.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "pnSceneObject/plSimulationInterface.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "hsQuat.h"
|
||||
//#include "plHavok1/plSimulationMgr.h"
|
||||
#include "plStatusLog/plStatusLog.h"
|
||||
|
||||
// static vars
|
||||
static const char* kStrLinear = "linear";
|
||||
static const char* kStrAngular = "angular";
|
||||
static const char* kStrPosition = "position";
|
||||
static const char* kStrOrientation = "orientation";
|
||||
|
||||
int plPhysicalSDLModifier::fLogLevel = 0;
|
||||
|
||||
static void IGetVars(plStateDataRecord::SimpleVarsList& vars,
|
||||
hsPoint3& pos, bool& isPosSet,
|
||||
hsQuat& rot, bool& isRotSet,
|
||||
hsVector3& linV, bool& isLinVSet,
|
||||
hsVector3& angV, bool& isAngVSet);
|
||||
|
||||
//
|
||||
// get current state from physical
|
||||
// fill out state data rec
|
||||
//
|
||||
void plPhysicalSDLModifier::IPutCurrentStateIn(plStateDataRecord* dstState)
|
||||
{
|
||||
plPhysical* phys = IGetPhysical();
|
||||
|
||||
// get latest state
|
||||
hsPoint3 curPos;
|
||||
hsQuat curOrientation;
|
||||
hsVector3 curLinear, curAngular;
|
||||
phys->GetSyncState(curPos, curOrientation, curLinear, curAngular);
|
||||
|
||||
// put it in sdl state record
|
||||
dstState->FindVar(kStrPosition)->Set(&curPos.fX);
|
||||
dstState->FindVar(kStrOrientation)->Set(&curOrientation.fX);
|
||||
dstState->FindVar(kStrLinear)->Set(&curLinear.fX);
|
||||
dstState->FindVar(kStrAngular)->Set(&curAngular.fX);
|
||||
|
||||
if (fLogLevel > 1)
|
||||
ILogState(dstState, false, "PUT", plStatusLog::kWhite);
|
||||
}
|
||||
|
||||
void plPhysicalSDLModifier::ISetCurrentStateFrom(const plStateDataRecord* srcState)
|
||||
{
|
||||
plPhysical* phys = IGetPhysical();
|
||||
|
||||
// FIXME PHYSX
|
||||
|
||||
// if(phys->GetBody()->isFixed())
|
||||
// {
|
||||
// plSimulationMgr::Log("Received synch for fixed body %s", phys->GetKey()->GetName());
|
||||
// return;
|
||||
// }
|
||||
// else if (phys->GetProperty(plSimulationInterface::kPinned))
|
||||
// {
|
||||
// // This is mainly intended for avatars. When pinning them (like in a multistage),
|
||||
// // we don't want physical updates to sneak in due to network lag. If necessary,
|
||||
// // this could be made a separate property on the physical, orthagonal to kPinned.
|
||||
// return;
|
||||
// }
|
||||
// else
|
||||
{
|
||||
hsPoint3 pos;
|
||||
bool isPosSet;
|
||||
hsQuat rot;
|
||||
bool isRotSet;
|
||||
hsVector3 linV;
|
||||
bool isLinVSet;
|
||||
hsVector3 angV;
|
||||
bool isAngVSet;
|
||||
|
||||
plStateDataRecord::SimpleVarsList vars;
|
||||
srcState->GetUsedVars(&vars);
|
||||
IGetVars(vars, pos, isPosSet, rot, isRotSet, linV, isLinVSet, angV, isAngVSet);
|
||||
|
||||
if (fLogLevel > 0)
|
||||
ILogState(srcState, false, "RCV", plStatusLog::kGreen);
|
||||
|
||||
phys->SetSyncState(
|
||||
isPosSet ? &pos : nil,
|
||||
isRotSet ? &rot : nil,
|
||||
isLinVSet ? &linV : nil,
|
||||
isAngVSet ? &angV : nil);
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicalSDLModifier::ISentState(const plStateDataRecord* sentState)
|
||||
{
|
||||
if (fLogLevel > 0)
|
||||
{
|
||||
ILogState(sentState, true, "SND", plStatusLog::kYellow);
|
||||
|
||||
// plPhysical* phys = IGetPhysical();
|
||||
// if (!phys->GetBody()->isActive())
|
||||
// IGetLog()->AddLineF("Phys %s sent state because it deactivated", phys->GetKeyName());
|
||||
}
|
||||
}
|
||||
|
||||
static void IGetVars(plStateDataRecord::SimpleVarsList& vars,
|
||||
hsPoint3& pos, bool& isPosSet,
|
||||
hsQuat& rot, bool& isRotSet,
|
||||
hsVector3& linV, bool& isLinVSet,
|
||||
hsVector3& angV, bool& isAngVSet)
|
||||
{
|
||||
isPosSet = false;
|
||||
isRotSet = false;
|
||||
isLinVSet = false;
|
||||
isAngVSet = false;
|
||||
|
||||
int num = vars.size();
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
if (vars[i]->IsNamed(kStrPosition))
|
||||
{
|
||||
vars[i]->Get(&pos.fX);
|
||||
isPosSet= true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed(kStrOrientation))
|
||||
{
|
||||
vars[i]->Get(&rot.fX);
|
||||
isRotSet = true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed(kStrLinear))
|
||||
{
|
||||
vars[i]->Get(&linV.fX);
|
||||
isLinVSet = true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed(kStrAngular))
|
||||
{
|
||||
vars[i]->Get(&angV.fX);
|
||||
isAngVSet = true;
|
||||
}
|
||||
else
|
||||
if (vars[i]->IsNamed("subworld"))
|
||||
{
|
||||
// Unused
|
||||
}
|
||||
else
|
||||
{
|
||||
hsAssert(false, "Unknown var name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDirty, const char* prefix, UInt32 color)
|
||||
{
|
||||
hsPoint3 pos;
|
||||
bool isPosSet;
|
||||
hsQuat rot;
|
||||
bool isRotSet;
|
||||
hsVector3 linV;
|
||||
bool isLinVSet;
|
||||
hsVector3 angV;
|
||||
bool isAngVSet;
|
||||
|
||||
plStateDataRecord::SimpleVarsList vars;
|
||||
if (useDirty)
|
||||
state->GetDirtyVars(&vars);
|
||||
else
|
||||
state->GetUsedVars(&vars);
|
||||
|
||||
IGetVars(vars, pos, isPosSet, rot, isRotSet, linV, isLinVSet, angV, isAngVSet);
|
||||
|
||||
plPhysical* phys = IGetPhysical();
|
||||
|
||||
std::string log = xtl::format("%s: %s", phys->GetKeyName(), prefix);
|
||||
|
||||
if (isPosSet)
|
||||
log += xtl::format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ);
|
||||
else
|
||||
log += " Pos=None";
|
||||
|
||||
if (isLinVSet)
|
||||
log += xtl::format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ);
|
||||
else
|
||||
log += " LinV=None";
|
||||
|
||||
if (isAngVSet)
|
||||
log += xtl::format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ);
|
||||
else
|
||||
log += " AngV=None";
|
||||
|
||||
if (isRotSet)
|
||||
log += xtl::format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW);
|
||||
else
|
||||
log += " Rot=None";
|
||||
|
||||
IGetLog()->AddLine(log.c_str(), color);
|
||||
}
|
||||
|
||||
plStatusLog* plPhysicalSDLModifier::IGetLog()
|
||||
{
|
||||
static plStatusLog* gLog = nil;
|
||||
if (!gLog)
|
||||
{
|
||||
gLog = plStatusLogMgr::GetInstance().CreateStatusLog(20, "PhysicsSDL.log",
|
||||
plStatusLog::kFilledBackground |
|
||||
plStatusLog::kTimestamp |
|
||||
plStatusLog::kDeleteForMe |
|
||||
plStatusLog::kAlignToTop);
|
||||
}
|
||||
|
||||
return gLog;
|
||||
}
|
||||
|
||||
plPhysical* plPhysicalSDLModifier::IGetPhysical()
|
||||
{
|
||||
plPhysical* phys = nil;
|
||||
|
||||
plSceneObject* sobj = GetTarget();
|
||||
if (sobj)
|
||||
{
|
||||
const plSimulationInterface* si = sobj->GetSimulationInterface();
|
||||
if (si)
|
||||
phys = si->GetPhysical();
|
||||
}
|
||||
|
||||
hsAssert(phys, "nil hkPhysical");
|
||||
return phys;
|
||||
}
|
@ -1,61 +1,61 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPhysicalSDLModifier_inc
|
||||
#define plPhysicalSDLModifier_inc
|
||||
|
||||
#include "plModifier/plSDLModifier.h"
|
||||
|
||||
class plStateDataRecord;
|
||||
class plStatusLog;
|
||||
class plPhysical;
|
||||
|
||||
//
|
||||
// This modifier is responsible for sending and recving
|
||||
// an object's physical state.
|
||||
//
|
||||
class plPhysicalSDLModifier : public plSDLModifier
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plPhysicalSDLModifier );
|
||||
GETINTERFACE_ANY( plPhysicalSDLModifier, plSDLModifier);
|
||||
|
||||
const char* GetSDLName() const { return kSDLPhysical; }
|
||||
|
||||
// For the console
|
||||
static void SetLogLevel(int level) { fLogLevel = level; }
|
||||
|
||||
protected:
|
||||
static int fLogLevel;
|
||||
static plStatusLog* IGetLog();
|
||||
void ILogState(const plStateDataRecord* state, bool useDirty, const char* prefix, UInt32 color);
|
||||
|
||||
plPhysical* IGetPhysical();
|
||||
virtual void IPutCurrentStateIn(plStateDataRecord* dstState);
|
||||
virtual void ISetCurrentStateFrom(const plStateDataRecord* srcState);
|
||||
virtual void ISentState(const plStateDataRecord* sentState);
|
||||
};
|
||||
|
||||
#endif // plPhysicalSDLModifier_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPhysicalSDLModifier_inc
|
||||
#define plPhysicalSDLModifier_inc
|
||||
|
||||
#include "plModifier/plSDLModifier.h"
|
||||
|
||||
class plStateDataRecord;
|
||||
class plStatusLog;
|
||||
class plPhysical;
|
||||
|
||||
//
|
||||
// This modifier is responsible for sending and recving
|
||||
// an object's physical state.
|
||||
//
|
||||
class plPhysicalSDLModifier : public plSDLModifier
|
||||
{
|
||||
public:
|
||||
CLASSNAME_REGISTER( plPhysicalSDLModifier );
|
||||
GETINTERFACE_ANY( plPhysicalSDLModifier, plSDLModifier);
|
||||
|
||||
const char* GetSDLName() const { return kSDLPhysical; }
|
||||
|
||||
// For the console
|
||||
static void SetLogLevel(int level) { fLogLevel = level; }
|
||||
|
||||
protected:
|
||||
static int fLogLevel;
|
||||
static plStatusLog* IGetLog();
|
||||
void ILogState(const plStateDataRecord* state, bool useDirty, const char* prefix, UInt32 color);
|
||||
|
||||
plPhysical* IGetPhysical();
|
||||
virtual void IPutCurrentStateIn(plStateDataRecord* dstState);
|
||||
virtual void ISetCurrentStateFrom(const plStateDataRecord* srcState);
|
||||
virtual void ISentState(const plStateDataRecord* sentState);
|
||||
};
|
||||
|
||||
#endif // plPhysicalSDLModifier_inc
|
||||
|
@ -1,167 +1,167 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plPhysicalSndGroup Class //
|
||||
// Simplistic container class to store the matchup info for a given //
|
||||
// physical sound group. Assigning one of these objects to a physical //
|
||||
// specifies the sound group it's in as well as the sounds it should make //
|
||||
// when colliding against objects of other sound groups. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hsResMgr.h"
|
||||
#include "plPhysicalSndGroup.h"
|
||||
#include "plAudio/plSound.h"
|
||||
#include "pnMessage/plRefMsg.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
|
||||
|
||||
plPhysicalSndGroup::plPhysicalSndGroup() : fPlayingSlideSound(false)
|
||||
{
|
||||
fGroup = kNone;
|
||||
}
|
||||
|
||||
plPhysicalSndGroup::plPhysicalSndGroup( UInt32 grp ) : fPlayingSlideSound(false)
|
||||
{
|
||||
fGroup = grp;
|
||||
}
|
||||
|
||||
plPhysicalSndGroup::~plPhysicalSndGroup()
|
||||
{
|
||||
}
|
||||
|
||||
bool plPhysicalSndGroup::HasSlideSound(UInt32 against)
|
||||
{
|
||||
return against < fSlideSounds.GetCount();
|
||||
}
|
||||
|
||||
bool plPhysicalSndGroup::HasImpactSound(UInt32 against)
|
||||
{
|
||||
return against < fImpactSounds.GetCount();
|
||||
}
|
||||
|
||||
hsBool plPhysicalSndGroup::MsgReceive( plMessage *pMsg )
|
||||
{
|
||||
return hsKeyedObject::MsgReceive( pMsg );
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::Read( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
hsKeyedObject::Read( s, mgr );
|
||||
|
||||
s->ReadSwap( &fGroup );
|
||||
|
||||
UInt32 i, count = s->ReadSwap32();
|
||||
fImpactSounds.Reset();
|
||||
|
||||
for( i = 0; i < count; i++ )
|
||||
fImpactSounds.Append( mgr->ReadKey( s ) );
|
||||
|
||||
count = s->ReadSwap32();
|
||||
fSlideSounds.Reset();
|
||||
for( i = 0; i < count; i++ )
|
||||
fSlideSounds.Append( mgr->ReadKey( s ) );
|
||||
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::Write( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
hsKeyedObject::Write( s, mgr );
|
||||
|
||||
s->WriteSwap( fGroup );
|
||||
|
||||
UInt32 i;
|
||||
s->WriteSwap32( fImpactSounds.GetCount() );
|
||||
for( i = 0; i < fImpactSounds.GetCount(); i++ )
|
||||
mgr->WriteKey( s, fImpactSounds[ i ] );
|
||||
|
||||
s->WriteSwap32( fSlideSounds.GetCount() );
|
||||
for( i = 0; i < fSlideSounds.GetCount(); i++ )
|
||||
mgr->WriteKey( s, fSlideSounds[ i ] );
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::AddImpactSound( UInt32 against, plKey receiver )
|
||||
{
|
||||
if( fImpactSounds.GetCount() <= against )
|
||||
{
|
||||
fImpactSounds.Expand( against + 1 );
|
||||
fImpactSounds.SetCount( against + 1 );
|
||||
}
|
||||
|
||||
fImpactSounds[ against ] = receiver;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::AddSlideSound( UInt32 against, plKey receiver )
|
||||
{
|
||||
if( fSlideSounds.GetCount() <= against )
|
||||
{
|
||||
fSlideSounds.Expand( against + 1 );
|
||||
fSlideSounds.SetCount( against + 1 );
|
||||
}
|
||||
|
||||
fSlideSounds[ against ] = receiver;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::PlaySlideSound(UInt32 against)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kContinue);
|
||||
animMsg->Send(fSlideSounds[against]);
|
||||
fPlayingSlideSound = true;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::StopSlideSound(UInt32 against)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kStop);
|
||||
animMsg->Send(fSlideSounds[against]);
|
||||
fPlayingSlideSound = false;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::PlayImpactSound(UInt32 against)
|
||||
{
|
||||
if(against >= fImpactSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kContinue);
|
||||
animMsg->Send(fImpactSounds[against]);
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::SetSlideSoundVolume(UInt32 against, hsScalar volume)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kSetSpeed);
|
||||
animMsg->fSpeed = volume;
|
||||
animMsg->Send(fSlideSounds[against]);
|
||||
|
||||
}
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plPhysicalSndGroup Class //
|
||||
// Simplistic container class to store the matchup info for a given //
|
||||
// physical sound group. Assigning one of these objects to a physical //
|
||||
// specifies the sound group it's in as well as the sounds it should make //
|
||||
// when colliding against objects of other sound groups. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hsResMgr.h"
|
||||
#include "plPhysicalSndGroup.h"
|
||||
#include "plAudio/plSound.h"
|
||||
#include "pnMessage/plRefMsg.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
|
||||
|
||||
plPhysicalSndGroup::plPhysicalSndGroup() : fPlayingSlideSound(false)
|
||||
{
|
||||
fGroup = kNone;
|
||||
}
|
||||
|
||||
plPhysicalSndGroup::plPhysicalSndGroup( UInt32 grp ) : fPlayingSlideSound(false)
|
||||
{
|
||||
fGroup = grp;
|
||||
}
|
||||
|
||||
plPhysicalSndGroup::~plPhysicalSndGroup()
|
||||
{
|
||||
}
|
||||
|
||||
bool plPhysicalSndGroup::HasSlideSound(UInt32 against)
|
||||
{
|
||||
return against < fSlideSounds.GetCount();
|
||||
}
|
||||
|
||||
bool plPhysicalSndGroup::HasImpactSound(UInt32 against)
|
||||
{
|
||||
return against < fImpactSounds.GetCount();
|
||||
}
|
||||
|
||||
hsBool plPhysicalSndGroup::MsgReceive( plMessage *pMsg )
|
||||
{
|
||||
return hsKeyedObject::MsgReceive( pMsg );
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::Read( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
hsKeyedObject::Read( s, mgr );
|
||||
|
||||
s->ReadSwap( &fGroup );
|
||||
|
||||
UInt32 i, count = s->ReadSwap32();
|
||||
fImpactSounds.Reset();
|
||||
|
||||
for( i = 0; i < count; i++ )
|
||||
fImpactSounds.Append( mgr->ReadKey( s ) );
|
||||
|
||||
count = s->ReadSwap32();
|
||||
fSlideSounds.Reset();
|
||||
for( i = 0; i < count; i++ )
|
||||
fSlideSounds.Append( mgr->ReadKey( s ) );
|
||||
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::Write( hsStream *s, hsResMgr *mgr )
|
||||
{
|
||||
hsKeyedObject::Write( s, mgr );
|
||||
|
||||
s->WriteSwap( fGroup );
|
||||
|
||||
UInt32 i;
|
||||
s->WriteSwap32( fImpactSounds.GetCount() );
|
||||
for( i = 0; i < fImpactSounds.GetCount(); i++ )
|
||||
mgr->WriteKey( s, fImpactSounds[ i ] );
|
||||
|
||||
s->WriteSwap32( fSlideSounds.GetCount() );
|
||||
for( i = 0; i < fSlideSounds.GetCount(); i++ )
|
||||
mgr->WriteKey( s, fSlideSounds[ i ] );
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::AddImpactSound( UInt32 against, plKey receiver )
|
||||
{
|
||||
if( fImpactSounds.GetCount() <= against )
|
||||
{
|
||||
fImpactSounds.Expand( against + 1 );
|
||||
fImpactSounds.SetCount( against + 1 );
|
||||
}
|
||||
|
||||
fImpactSounds[ against ] = receiver;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::AddSlideSound( UInt32 against, plKey receiver )
|
||||
{
|
||||
if( fSlideSounds.GetCount() <= against )
|
||||
{
|
||||
fSlideSounds.Expand( against + 1 );
|
||||
fSlideSounds.SetCount( against + 1 );
|
||||
}
|
||||
|
||||
fSlideSounds[ against ] = receiver;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::PlaySlideSound(UInt32 against)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kContinue);
|
||||
animMsg->Send(fSlideSounds[against]);
|
||||
fPlayingSlideSound = true;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::StopSlideSound(UInt32 against)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg *animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kStop);
|
||||
animMsg->Send(fSlideSounds[against]);
|
||||
fPlayingSlideSound = false;
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::PlayImpactSound(UInt32 against)
|
||||
{
|
||||
if(against >= fImpactSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kContinue);
|
||||
animMsg->Send(fImpactSounds[against]);
|
||||
}
|
||||
|
||||
void plPhysicalSndGroup::SetSlideSoundVolume(UInt32 against, hsScalar volume)
|
||||
{
|
||||
if(against >= fSlideSounds.Count())
|
||||
return;
|
||||
plAnimCmdMsg* animMsg = TRACKED_NEW plAnimCmdMsg;
|
||||
animMsg->SetCmd(plAnimCmdMsg::kSetSpeed);
|
||||
animMsg->fSpeed = volume;
|
||||
animMsg->Send(fSlideSounds[against]);
|
||||
|
||||
}
|
||||
|
@ -1,103 +1,103 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef _plPhysicalSndGroup_h
|
||||
#define _plPhysicalSndGroup_h
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plPhysicalSndGroup Class //
|
||||
// Simplistic container class to store the matchup info for a given //
|
||||
// physical sound group. Assigning one of these objects to a physical //
|
||||
// specifies the sound group it's in as well as the sounds it should make //
|
||||
// when colliding against objects of other sound groups. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsTemplates.h"
|
||||
|
||||
#include "pnKeyedObject/hsKeyedObject.h"
|
||||
#include "pnKeyedObject/plUoid.h"
|
||||
|
||||
class plSound;
|
||||
class plPhysicalSndGroup : public hsKeyedObject
|
||||
{
|
||||
public:
|
||||
|
||||
// The group enums
|
||||
enum SoundGroup
|
||||
{
|
||||
kNone = 0,
|
||||
kMetal,
|
||||
kGrass,
|
||||
kWood
|
||||
};
|
||||
|
||||
plPhysicalSndGroup();
|
||||
plPhysicalSndGroup( UInt32 grp );
|
||||
virtual ~plPhysicalSndGroup();
|
||||
|
||||
CLASSNAME_REGISTER( plPhysicalSndGroup );
|
||||
GETINTERFACE_ANY( plPhysicalSndGroup, hsKeyedObject );
|
||||
|
||||
// Our required virtual
|
||||
virtual hsBool MsgReceive( plMessage *pMsg );
|
||||
|
||||
virtual void Read( hsStream *s, hsResMgr *mgr );
|
||||
virtual void Write( hsStream *s, hsResMgr *mgr );
|
||||
|
||||
void PlaySlideSound(UInt32 against);
|
||||
void StopSlideSound(UInt32 against);
|
||||
void PlayImpactSound(UInt32 against);
|
||||
void SetSlideSoundVolume(UInt32 against, hsScalar volume);
|
||||
bool HasSlideSound(UInt32 against);
|
||||
bool HasImpactSound(UInt32 against);
|
||||
|
||||
UInt32 GetGroup( void ) const { return fGroup; }
|
||||
|
||||
// Export only
|
||||
void AddImpactSound( UInt32 against, plKey receiver );
|
||||
void AddSlideSound( UInt32 against, plKey receiver );
|
||||
bool IsSliding() { return fPlayingSlideSound; }
|
||||
|
||||
protected:
|
||||
|
||||
enum Refs
|
||||
{
|
||||
kRefImpactSound,
|
||||
kRefSlideSound
|
||||
};
|
||||
|
||||
UInt32 fGroup;
|
||||
bool fPlayingSlideSound;
|
||||
|
||||
// Sound key arrays for, well, our sounds!
|
||||
hsTArray<plKey> fImpactSounds;
|
||||
hsTArray<plKey> fSlideSounds;
|
||||
};
|
||||
|
||||
|
||||
#endif //_plPhysicalSndGroup_h
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef _plPhysicalSndGroup_h
|
||||
#define _plPhysicalSndGroup_h
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// plPhysicalSndGroup Class //
|
||||
// Simplistic container class to store the matchup info for a given //
|
||||
// physical sound group. Assigning one of these objects to a physical //
|
||||
// specifies the sound group it's in as well as the sounds it should make //
|
||||
// when colliding against objects of other sound groups. //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsTemplates.h"
|
||||
|
||||
#include "pnKeyedObject/hsKeyedObject.h"
|
||||
#include "pnKeyedObject/plUoid.h"
|
||||
|
||||
class plSound;
|
||||
class plPhysicalSndGroup : public hsKeyedObject
|
||||
{
|
||||
public:
|
||||
|
||||
// The group enums
|
||||
enum SoundGroup
|
||||
{
|
||||
kNone = 0,
|
||||
kMetal,
|
||||
kGrass,
|
||||
kWood
|
||||
};
|
||||
|
||||
plPhysicalSndGroup();
|
||||
plPhysicalSndGroup( UInt32 grp );
|
||||
virtual ~plPhysicalSndGroup();
|
||||
|
||||
CLASSNAME_REGISTER( plPhysicalSndGroup );
|
||||
GETINTERFACE_ANY( plPhysicalSndGroup, hsKeyedObject );
|
||||
|
||||
// Our required virtual
|
||||
virtual hsBool MsgReceive( plMessage *pMsg );
|
||||
|
||||
virtual void Read( hsStream *s, hsResMgr *mgr );
|
||||
virtual void Write( hsStream *s, hsResMgr *mgr );
|
||||
|
||||
void PlaySlideSound(UInt32 against);
|
||||
void StopSlideSound(UInt32 against);
|
||||
void PlayImpactSound(UInt32 against);
|
||||
void SetSlideSoundVolume(UInt32 against, hsScalar volume);
|
||||
bool HasSlideSound(UInt32 against);
|
||||
bool HasImpactSound(UInt32 against);
|
||||
|
||||
UInt32 GetGroup( void ) const { return fGroup; }
|
||||
|
||||
// Export only
|
||||
void AddImpactSound( UInt32 against, plKey receiver );
|
||||
void AddSlideSound( UInt32 against, plKey receiver );
|
||||
bool IsSliding() { return fPlayingSlideSound; }
|
||||
|
||||
protected:
|
||||
|
||||
enum Refs
|
||||
{
|
||||
kRefImpactSound,
|
||||
kRefSlideSound
|
||||
};
|
||||
|
||||
UInt32 fGroup;
|
||||
bool fPlayingSlideSound;
|
||||
|
||||
// Sound key arrays for, well, our sounds!
|
||||
hsTArray<plKey> fImpactSounds;
|
||||
hsTArray<plKey> fSlideSounds;
|
||||
};
|
||||
|
||||
|
||||
#endif //_plPhysicalSndGroup_h
|
||||
|
@ -1,217 +1,217 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include "hsTimer.h"
|
||||
#include "plPhysicsSoundMgr.h"
|
||||
#include "plPhysicalSndGroup.h"
|
||||
#include "pnKeyedObject/plFixedKey.h"
|
||||
#include "plStatusLog/plStatusLog.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
#include "pfAudio/plRandomSoundMod.h"
|
||||
|
||||
#define MIN_VOLUME 0.0001f
|
||||
|
||||
void plPhysicsSoundMgr::AddContact(plPhysical* phys1, plPhysical* phys2, const hsPoint3& hitPoint, const hsVector3& hitNormal)
|
||||
{
|
||||
CollidePair cp(phys1->GetKey(), phys2->GetKey(), hitPoint, hitNormal);
|
||||
fCurCollisions.insert(cp);
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::Update()
|
||||
{
|
||||
// Get all the physicals that only in the new list (started colliding)
|
||||
CollideSet startedColliding;
|
||||
std::set_difference(fCurCollisions.begin(), fCurCollisions.end(),
|
||||
fPrevCollisions.begin(), fPrevCollisions.end(),
|
||||
std::inserter(startedColliding, startedColliding.begin()));
|
||||
|
||||
for (CollideSet::iterator it = startedColliding.begin(); it != startedColliding.end(); it++)
|
||||
IStartCollision(*it);
|
||||
|
||||
for (CollideSet::iterator it = fPrevCollisions.begin(); it != fPrevCollisions.end(); it++)
|
||||
{
|
||||
CollideSet::iterator old = fCurCollisions.find(*it);
|
||||
if (old != fCurCollisions.end())
|
||||
{
|
||||
IUpdateCollision(*it);
|
||||
}
|
||||
else
|
||||
{
|
||||
IStopCollision(*it);
|
||||
}
|
||||
}
|
||||
|
||||
fPrevCollisions = fCurCollisions;
|
||||
fCurCollisions.clear();
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IStartCollision(const CollidePair& cp)
|
||||
{
|
||||
hsVector3 v1, v2;
|
||||
const hsScalar strengthThreshold = 20.0f;
|
||||
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
if (!physicalA || !physicalB)
|
||||
return;
|
||||
|
||||
plPhysicalSndGroup* sndA = physicalA->GetSoundGroup();
|
||||
plPhysicalSndGroup* sndB = physicalB->GetSoundGroup();
|
||||
|
||||
// If no impact sounds were specified in max don't do anything here.
|
||||
if (!sndA->HasImpactSound(sndB->GetGroup()) &&
|
||||
!sndB->HasImpactSound(sndA->GetGroup()))
|
||||
return;
|
||||
|
||||
physicalA->GetLinearVelocitySim(v1);
|
||||
physicalB->GetLinearVelocitySim(v2);
|
||||
hsVector3 vel = v1 - v2;
|
||||
hsScalar strength = vel.MagnitudeSquared();
|
||||
|
||||
if (strength >= strengthThreshold)
|
||||
{
|
||||
if (sndA->HasImpactSound(sndB->GetGroup()))
|
||||
{
|
||||
sndA->PlayImpactSound(sndB->GetGroup());
|
||||
}
|
||||
else
|
||||
{
|
||||
sndB->PlayImpactSound(sndA->GetGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IStopCollision(const CollidePair& cp)
|
||||
{
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
if (physicalA && physicalB)
|
||||
{
|
||||
plPhysicalSndGroup* sndA = physicalA->GetSoundGroup();
|
||||
plPhysicalSndGroup* sndB = physicalB->GetSoundGroup();
|
||||
|
||||
if (sndA->HasSlideSound(sndB->GetGroup()))
|
||||
{
|
||||
if(sndA->IsSliding())
|
||||
{
|
||||
sndA->StopSlideSound(sndB->GetGroup());
|
||||
}
|
||||
}
|
||||
if (sndB->HasSlideSound(sndA->GetGroup()))
|
||||
{
|
||||
if(sndB->IsSliding())
|
||||
{
|
||||
sndB->StopSlideSound(sndA->GetGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IUpdateCollision(const CollidePair& cp)
|
||||
{
|
||||
const hsScalar slideThreshhold = 0.f;
|
||||
hsVector3 v1, v2;
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
if (!physicalA || !physicalB)
|
||||
return;
|
||||
|
||||
plPhysicalSndGroup* sndA = physicalA->GetSoundGroup();
|
||||
plPhysicalSndGroup* sndB = physicalB->GetSoundGroup();
|
||||
|
||||
physicalA->GetLinearVelocitySim(v1);
|
||||
physicalB->GetLinearVelocitySim(v2);
|
||||
hsVector3 vel = v1 - v2;
|
||||
hsScalar strength = vel.MagnitudeSquared();
|
||||
|
||||
// scale strength to use as volume
|
||||
strength /= 16*8;
|
||||
if(strength < MIN_VOLUME)
|
||||
strength = 0;
|
||||
|
||||
if (sndA->HasSlideSound(sndB->GetGroup()))
|
||||
IProcessSlide(sndA, sndB, strength);
|
||||
else
|
||||
IProcessSlide(sndB, sndA, strength);
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength)
|
||||
{
|
||||
sndA->SetSlideSoundVolume(sndB->GetGroup(), strength);
|
||||
|
||||
if(strength > MIN_VOLUME)
|
||||
{
|
||||
if(!sndA->IsSliding())
|
||||
{
|
||||
sndA->PlaySlideSound(sndB->GetGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plPhysicsSoundMgr::CollidePair::CollidePair(const plKey& firstPhys, const plKey& secondPhys, const hsPoint3& point, const hsVector3& normal)
|
||||
{
|
||||
// To simplify searching and sorting, all pairs are set up with the pointer value of the
|
||||
// first element greater than the pointer value of the second.
|
||||
if (firstPhys->GetObjectPtr() < secondPhys->GetObjectPtr())
|
||||
{
|
||||
this->firstPhysKey = secondPhys;
|
||||
this->secondPhysKey = firstPhys;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->firstPhysKey = firstPhys;
|
||||
this->secondPhysKey = secondPhys;
|
||||
}
|
||||
|
||||
this->point = point;
|
||||
this->normalForce = normal;
|
||||
}
|
||||
|
||||
bool plPhysicsSoundMgr::CollidePair::operator<(const CollidePair& rhs) const
|
||||
{
|
||||
return (firstPhysKey->GetObjectPtr() < rhs.firstPhysKey->GetObjectPtr()
|
||||
|| (rhs.firstPhysKey->GetObjectPtr() == firstPhysKey->GetObjectPtr() && secondPhysKey->GetObjectPtr() < rhs.secondPhysKey->GetObjectPtr()));
|
||||
}
|
||||
|
||||
bool plPhysicsSoundMgr::CollidePair::operator==(const CollidePair& rhs) const
|
||||
{
|
||||
if (firstPhysKey == rhs.firstPhysKey && secondPhysKey == rhs.secondPhysKey)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
plPhysical* plPhysicsSoundMgr::CollidePair::FirstPhysical() const
|
||||
{
|
||||
return firstPhysKey ? static_cast<plPhysical*>(firstPhysKey->GetObjectPtr()) : nil;
|
||||
}
|
||||
|
||||
plPhysical* plPhysicsSoundMgr::CollidePair::SecondPhysical() const
|
||||
{
|
||||
return secondPhysKey ? static_cast<plPhysical*>(secondPhysKey->GetObjectPtr()) : nil;
|
||||
}
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include "hsTimer.h"
|
||||
#include "plPhysicsSoundMgr.h"
|
||||
#include "plPhysicalSndGroup.h"
|
||||
#include "pnKeyedObject/plFixedKey.h"
|
||||
#include "plStatusLog/plStatusLog.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
#include "pfAudio/plRandomSoundMod.h"
|
||||
|
||||
#define MIN_VOLUME 0.0001f
|
||||
|
||||
void plPhysicsSoundMgr::AddContact(plPhysical* phys1, plPhysical* phys2, const hsPoint3& hitPoint, const hsVector3& hitNormal)
|
||||
{
|
||||
CollidePair cp(phys1->GetKey(), phys2->GetKey(), hitPoint, hitNormal);
|
||||
fCurCollisions.insert(cp);
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::Update()
|
||||
{
|
||||
// Get all the physicals that only in the new list (started colliding)
|
||||
CollideSet startedColliding;
|
||||
std::set_difference(fCurCollisions.begin(), fCurCollisions.end(),
|
||||
fPrevCollisions.begin(), fPrevCollisions.end(),
|
||||
std::inserter(startedColliding, startedColliding.begin()));
|
||||
|
||||
for (CollideSet::iterator it = startedColliding.begin(); it != startedColliding.end(); it++)
|
||||
IStartCollision(*it);
|
||||
|
||||
for (CollideSet::iterator it = fPrevCollisions.begin(); it != fPrevCollisions.end(); it++)
|
||||
{
|
||||
CollideSet::iterator old = fCurCollisions.find(*it);
|
||||
if (old != fCurCollisions.end())
|
||||
{
|
||||
IUpdateCollision(*it);
|
||||
}
|
||||
else
|
||||
{
|
||||
IStopCollision(*it);
|
||||
}
|
||||
}
|
||||
|
||||
fPrevCollisions = fCurCollisions;
|
||||
fCurCollisions.clear();
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IStartCollision(const CollidePair& cp)
|
||||
{
|
||||
hsVector3 v1, v2;
|
||||
const hsScalar strengthThreshold = 20.0f;
|
||||
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
if (!physicalA || !physicalB)
|
||||
return;
|
||||
|
||||
plPhysicalSndGroup* sndA = physicalA->GetSoundGroup();
|
||||
plPhysicalSndGroup* sndB = physicalB->GetSoundGroup();
|
||||
|
||||
// If no impact sounds were specified in max don't do anything here.
|
||||
if (!sndA->HasImpactSound(sndB->GetGroup()) &&
|
||||
!sndB->HasImpactSound(sndA->GetGroup()))
|
||||
return;
|
||||
|
||||
physicalA->GetLinearVelocitySim(v1);
|
||||
physicalB->GetLinearVelocitySim(v2);
|
||||
hsVector3 vel = v1 - v2;
|
||||
hsScalar strength = vel.MagnitudeSquared();
|
||||
|
||||
if (strength >= strengthThreshold)
|
||||
{
|
||||
if (sndA->HasImpactSound(sndB->GetGroup()))
|
||||
{
|
||||
sndA->PlayImpactSound(sndB->GetGroup());
|
||||
}
|
||||
else
|
||||
{
|
||||
sndB->PlayImpactSound(sndA->GetGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IStopCollision(const CollidePair& cp)
|
||||
{
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
if (physicalA && physicalB)
|
||||
{
|
||||
plPhysicalSndGroup* sndA = physicalA->GetSoundGroup();
|
||||
plPhysicalSndGroup* sndB = physicalB->GetSoundGroup();
|
||||
|
||||
if (sndA->HasSlideSound(sndB->GetGroup()))
|
||||
{
|
||||
if(sndA->IsSliding())
|
||||
{
|
||||
sndA->StopSlideSound(sndB->GetGroup());
|
||||
}
|
||||
}
|
||||
if (sndB->HasSlideSound(sndA->GetGroup()))
|
||||
{
|
||||
if(sndB->IsSliding())
|
||||
{
|
||||
sndB->StopSlideSound(sndA->GetGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IUpdateCollision(const CollidePair& cp)
|
||||
{
|
||||
const hsScalar slideThreshhold = 0.f;
|
||||
hsVector3 v1, v2;
|
||||
plPhysical* physicalA = cp.FirstPhysical();
|
||||
plPhysical* physicalB = cp.SecondPhysical();
|
||||
if (!physicalA || !physicalB)
|
||||
return;
|
||||
|
||||
plPhysicalSndGroup* sndA = physicalA->GetSoundGroup();
|
||||
plPhysicalSndGroup* sndB = physicalB->GetSoundGroup();
|
||||
|
||||
physicalA->GetLinearVelocitySim(v1);
|
||||
physicalB->GetLinearVelocitySim(v2);
|
||||
hsVector3 vel = v1 - v2;
|
||||
hsScalar strength = vel.MagnitudeSquared();
|
||||
|
||||
// scale strength to use as volume
|
||||
strength /= 16*8;
|
||||
if(strength < MIN_VOLUME)
|
||||
strength = 0;
|
||||
|
||||
if (sndA->HasSlideSound(sndB->GetGroup()))
|
||||
IProcessSlide(sndA, sndB, strength);
|
||||
else
|
||||
IProcessSlide(sndB, sndA, strength);
|
||||
}
|
||||
|
||||
void plPhysicsSoundMgr::IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength)
|
||||
{
|
||||
sndA->SetSlideSoundVolume(sndB->GetGroup(), strength);
|
||||
|
||||
if(strength > MIN_VOLUME)
|
||||
{
|
||||
if(!sndA->IsSliding())
|
||||
{
|
||||
sndA->PlaySlideSound(sndB->GetGroup());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plPhysicsSoundMgr::CollidePair::CollidePair(const plKey& firstPhys, const plKey& secondPhys, const hsPoint3& point, const hsVector3& normal)
|
||||
{
|
||||
// To simplify searching and sorting, all pairs are set up with the pointer value of the
|
||||
// first element greater than the pointer value of the second.
|
||||
if (firstPhys->GetObjectPtr() < secondPhys->GetObjectPtr())
|
||||
{
|
||||
this->firstPhysKey = secondPhys;
|
||||
this->secondPhysKey = firstPhys;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->firstPhysKey = firstPhys;
|
||||
this->secondPhysKey = secondPhys;
|
||||
}
|
||||
|
||||
this->point = point;
|
||||
this->normalForce = normal;
|
||||
}
|
||||
|
||||
bool plPhysicsSoundMgr::CollidePair::operator<(const CollidePair& rhs) const
|
||||
{
|
||||
return (firstPhysKey->GetObjectPtr() < rhs.firstPhysKey->GetObjectPtr()
|
||||
|| (rhs.firstPhysKey->GetObjectPtr() == firstPhysKey->GetObjectPtr() && secondPhysKey->GetObjectPtr() < rhs.secondPhysKey->GetObjectPtr()));
|
||||
}
|
||||
|
||||
bool plPhysicsSoundMgr::CollidePair::operator==(const CollidePair& rhs) const
|
||||
{
|
||||
if (firstPhysKey == rhs.firstPhysKey && secondPhysKey == rhs.secondPhysKey)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
plPhysical* plPhysicsSoundMgr::CollidePair::FirstPhysical() const
|
||||
{
|
||||
return firstPhysKey ? static_cast<plPhysical*>(firstPhysKey->GetObjectPtr()) : nil;
|
||||
}
|
||||
|
||||
plPhysical* plPhysicsSoundMgr::CollidePair::SecondPhysical() const
|
||||
{
|
||||
return secondPhysKey ? static_cast<plPhysical*>(secondPhysKey->GetObjectPtr()) : nil;
|
||||
}
|
||||
|
@ -1,78 +1,78 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPhysicsSoundMgr_h_inc
|
||||
#define plPhysicsSoundMgr_h_inc
|
||||
|
||||
#include "hsStlUtils.h"
|
||||
#include "plPhysical.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class plPhysicsSoundMgr
|
||||
{
|
||||
public:
|
||||
void AddContact(plPhysical* phys1, plPhysical* phys2, const hsPoint3& hitPoint, const hsVector3& hitNormal);
|
||||
void Update();
|
||||
|
||||
private:
|
||||
enum EventType
|
||||
{
|
||||
kSlide,
|
||||
kContact,
|
||||
kEndSlide
|
||||
};
|
||||
|
||||
enum EventStopType
|
||||
{
|
||||
kStopFromImpact = 0,
|
||||
kStopFromEndSlide = 2
|
||||
};
|
||||
|
||||
class CollidePair
|
||||
{
|
||||
public:
|
||||
plKey firstPhysKey;
|
||||
plKey secondPhysKey;
|
||||
hsPoint3 point;
|
||||
hsVector3 normalForce;
|
||||
|
||||
CollidePair(const plKey& firstPhys, const plKey& secondPhys, const hsPoint3& point, const hsVector3& normal);
|
||||
bool operator<(const CollidePair& rhs) const;
|
||||
bool operator==(const CollidePair& rhs) const;
|
||||
plPhysical* FirstPhysical() const;
|
||||
plPhysical* SecondPhysical() const;
|
||||
};
|
||||
|
||||
void IStartCollision(const CollidePair& cp);
|
||||
void IStopCollision(const CollidePair& cp);
|
||||
void IUpdateCollision(const CollidePair& cp);
|
||||
void IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength);
|
||||
|
||||
typedef std::set<CollidePair> CollideSet;
|
||||
CollideSet fPrevCollisions;
|
||||
CollideSet fCurCollisions;
|
||||
};
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plPhysicsSoundMgr_h_inc
|
||||
#define plPhysicsSoundMgr_h_inc
|
||||
|
||||
#include "hsStlUtils.h"
|
||||
#include "plPhysical.h"
|
||||
#include "hsGeometry3.h"
|
||||
|
||||
class plPhysicsSoundMgr
|
||||
{
|
||||
public:
|
||||
void AddContact(plPhysical* phys1, plPhysical* phys2, const hsPoint3& hitPoint, const hsVector3& hitNormal);
|
||||
void Update();
|
||||
|
||||
private:
|
||||
enum EventType
|
||||
{
|
||||
kSlide,
|
||||
kContact,
|
||||
kEndSlide
|
||||
};
|
||||
|
||||
enum EventStopType
|
||||
{
|
||||
kStopFromImpact = 0,
|
||||
kStopFromEndSlide = 2
|
||||
};
|
||||
|
||||
class CollidePair
|
||||
{
|
||||
public:
|
||||
plKey firstPhysKey;
|
||||
plKey secondPhysKey;
|
||||
hsPoint3 point;
|
||||
hsVector3 normalForce;
|
||||
|
||||
CollidePair(const plKey& firstPhys, const plKey& secondPhys, const hsPoint3& point, const hsVector3& normal);
|
||||
bool operator<(const CollidePair& rhs) const;
|
||||
bool operator==(const CollidePair& rhs) const;
|
||||
plPhysical* FirstPhysical() const;
|
||||
plPhysical* SecondPhysical() const;
|
||||
};
|
||||
|
||||
void IStartCollision(const CollidePair& cp);
|
||||
void IStopCollision(const CollidePair& cp);
|
||||
void IUpdateCollision(const CollidePair& cp);
|
||||
void IProcessSlide(plPhysicalSndGroup* sndA, plPhysicalSndGroup* sndB, hsScalar strength);
|
||||
|
||||
typedef std::set<CollidePair> CollideSet;
|
||||
CollideSet fPrevCollisions;
|
||||
CollideSet fCurCollisions;
|
||||
};
|
||||
|
||||
#endif // plPhysicsSoundMgr_h_inc
|
@ -1,95 +1,95 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
#include "plPickingDetector.h"
|
||||
#include "plMessage/plActivatorMsg.h"
|
||||
#include "plMessage/plPickedMsg.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "pnKeyedObject/plKey.h"
|
||||
#include "pnMessage/plObjRefMsg.h"
|
||||
#include "pnMessage/plFakeOutMsg.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "plgDispatch.h"
|
||||
|
||||
|
||||
hsBool plPickingDetector::MsgReceive(plMessage* msg)
|
||||
{
|
||||
|
||||
plObjRefMsg* refMsg = plObjRefMsg::ConvertNoRef(msg);
|
||||
if( refMsg )
|
||||
{
|
||||
if( refMsg->fType == plObjRefMsg::kModifier)
|
||||
{
|
||||
if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace) )
|
||||
{
|
||||
plModifier* mod = plModifier::ConvertNoRef(refMsg->GetRef());
|
||||
SetRemote(mod);
|
||||
}
|
||||
else if( refMsg->GetContext() & (plRefMsg::kOnDestroy|plRefMsg::kOnRemove) )
|
||||
{
|
||||
SetRemote(nil);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
plPickedMsg* pPMsg = plPickedMsg::ConvertNoRef(msg);
|
||||
if (pPMsg)
|
||||
{
|
||||
for (int i = 0; i < fReceivers.Count(); i++)
|
||||
{
|
||||
plActivatorMsg* pMsg = TRACKED_NEW plActivatorMsg;
|
||||
pMsg->AddReceiver( fReceivers[i] );
|
||||
if (pPMsg->fPicked)
|
||||
pMsg->SetTriggerType( plActivatorMsg::kPickedTrigger );
|
||||
else
|
||||
pMsg->SetTriggerType( plActivatorMsg::kUnPickedTrigger );
|
||||
// pass on the hit point
|
||||
pMsg->fHitPoint = pPMsg->fHitPoint;
|
||||
|
||||
if (fProxyKey)
|
||||
pMsg->fPickedObj = fProxyKey;
|
||||
else
|
||||
pMsg->fPickedObj = GetTarget()->GetKey();
|
||||
|
||||
// assume that since this is something that was PICKED that it was done by the local player.
|
||||
plKey locPlayerKey = plNetClientApp::GetInstance()->GetLocalPlayerKey();
|
||||
if (locPlayerKey)
|
||||
pMsg->fHitterObj = locPlayerKey;
|
||||
|
||||
pMsg->SetSender(GetKey());
|
||||
plgDispatch::MsgSend( pMsg );
|
||||
hsStatusMessageF("%s sending activate message to %s\n",GetKey()->GetName(), fReceivers[i]->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
if (RemoteMod() && RemoteMod()->MsgReceive(msg))
|
||||
return true;
|
||||
|
||||
return plDetectorModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
#include "plPickingDetector.h"
|
||||
#include "plMessage/plActivatorMsg.h"
|
||||
#include "plMessage/plPickedMsg.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "pnKeyedObject/plKey.h"
|
||||
#include "pnMessage/plObjRefMsg.h"
|
||||
#include "pnMessage/plFakeOutMsg.h"
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "plgDispatch.h"
|
||||
|
||||
|
||||
hsBool plPickingDetector::MsgReceive(plMessage* msg)
|
||||
{
|
||||
|
||||
plObjRefMsg* refMsg = plObjRefMsg::ConvertNoRef(msg);
|
||||
if( refMsg )
|
||||
{
|
||||
if( refMsg->fType == plObjRefMsg::kModifier)
|
||||
{
|
||||
if( refMsg->GetContext() & (plRefMsg::kOnCreate|plRefMsg::kOnRequest|plRefMsg::kOnReplace) )
|
||||
{
|
||||
plModifier* mod = plModifier::ConvertNoRef(refMsg->GetRef());
|
||||
SetRemote(mod);
|
||||
}
|
||||
else if( refMsg->GetContext() & (plRefMsg::kOnDestroy|plRefMsg::kOnRemove) )
|
||||
{
|
||||
SetRemote(nil);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
plPickedMsg* pPMsg = plPickedMsg::ConvertNoRef(msg);
|
||||
if (pPMsg)
|
||||
{
|
||||
for (int i = 0; i < fReceivers.Count(); i++)
|
||||
{
|
||||
plActivatorMsg* pMsg = TRACKED_NEW plActivatorMsg;
|
||||
pMsg->AddReceiver( fReceivers[i] );
|
||||
if (pPMsg->fPicked)
|
||||
pMsg->SetTriggerType( plActivatorMsg::kPickedTrigger );
|
||||
else
|
||||
pMsg->SetTriggerType( plActivatorMsg::kUnPickedTrigger );
|
||||
// pass on the hit point
|
||||
pMsg->fHitPoint = pPMsg->fHitPoint;
|
||||
|
||||
if (fProxyKey)
|
||||
pMsg->fPickedObj = fProxyKey;
|
||||
else
|
||||
pMsg->fPickedObj = GetTarget()->GetKey();
|
||||
|
||||
// assume that since this is something that was PICKED that it was done by the local player.
|
||||
plKey locPlayerKey = plNetClientApp::GetInstance()->GetLocalPlayerKey();
|
||||
if (locPlayerKey)
|
||||
pMsg->fHitterObj = locPlayerKey;
|
||||
|
||||
pMsg->SetSender(GetKey());
|
||||
plgDispatch::MsgSend( pMsg );
|
||||
hsStatusMessageF("%s sending activate message to %s\n",GetKey()->GetName(), fReceivers[i]->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
if (RemoteMod() && RemoteMod()->MsgReceive(msg))
|
||||
return true;
|
||||
|
||||
return plDetectorModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
|
@ -1,66 +1,66 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plPickingDetector_inc
|
||||
#define plPickingDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
class plMessage;
|
||||
|
||||
class plPickingDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plPickingDetector(){;}
|
||||
virtual ~plPickingDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plPickingDetector );
|
||||
GETINTERFACE_ANY( plPickingDetector, plDetectorModifier );
|
||||
|
||||
};
|
||||
/*
|
||||
class plClickDragDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plPickingDetector(){;}
|
||||
virtual ~plPickingDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plPickingDetector );
|
||||
GETINTERFACE_ANY( plPickingDetector, plDetectorModifier );
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
#endif plPickingDetector_inc
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#ifndef plPickingDetector_inc
|
||||
#define plPickingDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
class plMessage;
|
||||
|
||||
class plPickingDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plPickingDetector(){;}
|
||||
virtual ~plPickingDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plPickingDetector );
|
||||
GETINTERFACE_ANY( plPickingDetector, plDetectorModifier );
|
||||
|
||||
};
|
||||
/*
|
||||
class plClickDragDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plPickingDetector(){;}
|
||||
virtual ~plPickingDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plPickingDetector );
|
||||
GETINTERFACE_ANY( plPickingDetector, plDetectorModifier );
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
#endif plPickingDetector_inc
|
||||
|
@ -1,123 +1,123 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef PLSIMDEFS_H
|
||||
#define PLSIMDEFS_H
|
||||
#pragma once
|
||||
|
||||
namespace plSimDefs
|
||||
{
|
||||
// Groups are used to determine what a physical collides with, and what a
|
||||
// detector detects
|
||||
enum Group
|
||||
{
|
||||
// A physical that blocks avatars and dynamics
|
||||
kGroupStatic,
|
||||
// Blocks only avatars
|
||||
kGroupAvatarBlocker,
|
||||
// Blocks only dynamics
|
||||
kGroupDynamicBlocker,
|
||||
// No physical should actually be set to this, since the avatar is
|
||||
// controlled by a special kind of physical. However, you can use this
|
||||
// for detecting.
|
||||
kGroupAvatar,
|
||||
// A physical that can be pushed around by the avatar or other dynamics
|
||||
kGroupDynamic,
|
||||
// A physical that doesn't block anything, but reports on any physical
|
||||
// that enters it
|
||||
kGroupDetector,
|
||||
// Blocks nothing, for los checks only
|
||||
kGroupLOSOnly,
|
||||
//kExcludeRegion setting up so only blocks avatars and only when not in seek mode
|
||||
kGroupExcludeRegion,
|
||||
// Just for error checking
|
||||
kGroupMax,
|
||||
};
|
||||
|
||||
/** A taxonomy of action types. Crucial for doing things like making sure you don't
|
||||
do things like attach duplicate actions. */
|
||||
enum ActionType
|
||||
{
|
||||
kUnknownAction = 0x01, // don't know the type (probably forgot to override GetType())
|
||||
kUnknownZAction = 0x02, // unknown type of z-order action
|
||||
kAntiGravityAction = 0x03, // an action that counters gravity exactly
|
||||
kUprightAction = 0x04, // an action that keeps an object upright by apply force
|
||||
kPhysAnimAction = 0x05, // an action that parses keyframed animation into physical information
|
||||
kConstraint = 0x06, // a general constraint.
|
||||
kCallbackAction = 0x07, // an action that just hands us the physics "tick"
|
||||
kPseudoPhysAction = 0x08, // replacement for the physAnim
|
||||
kAntiGravAction = 0x09, // makes things float in the air
|
||||
kBasicGroundAction = 0x0a, // for your basic walkAroundOnGround corrections
|
||||
kHorizontalFreeze = 0x0b, // Let's you fall vertically, but otherwise keeps you in place (generic brains)
|
||||
|
||||
kMaxAction = 0xffff // force 16-bit
|
||||
};
|
||||
|
||||
/** Different types of line-of-sight requests. */
|
||||
enum LOSReqType
|
||||
{
|
||||
// these are MASKS -- keep powers of two
|
||||
kLOS_IgnoreCameraRequest = 0x1,
|
||||
kLOS_IgnoreUIRequest = 0x2,
|
||||
kLOS_CameraAvoidObject = 0x4,
|
||||
|
||||
kLOS_Max = 0xffff // force 16-bit
|
||||
};
|
||||
|
||||
/** Different types of physics shapes. In most cases they dictate how we intepret
|
||||
the raw vertices. In some cases (sphere) they explain why there aren't any vertices */
|
||||
enum Bounds {
|
||||
kBoxBounds = 0x01, // bounding box
|
||||
kSphereBounds, // bounding sphere
|
||||
kHullBounds, // convex hull
|
||||
kProxyBounds, // use alternate proxy geometry
|
||||
kExplicitBounds, // use the primary geometry
|
||||
kNumBounds, // the number of bounds types
|
||||
|
||||
kBoundsMax = 0xff // force 8-bit
|
||||
};
|
||||
|
||||
enum plLOSDB {
|
||||
kLOSDBNone = 0x0000,
|
||||
|
||||
kLOSDBUIBlockers = 0x0001, // things that block ui probes
|
||||
kLOSDBUIItems = 0x0002, // ui items -- we check these first for a hit before checking blockers
|
||||
kLOSDBCameraBlockers = 0x0004, // things that block camera probes
|
||||
kLOSDBCustom = 0x0008, // special things. only the user knows
|
||||
kLOSDBLocalAvatar = 0x0010, // yes, this is silly. it's transitional :)
|
||||
kLOSDBShootableItems = 0x0020, // shootable items, like from the VaporMiner gun
|
||||
|
||||
kLOSDBAvatarWalkable = 0x0040, // stuff the avatar is expected to walk on. Used to prevent sliding and allow
|
||||
// jumping. All terrain automatically goes here.
|
||||
|
||||
kLOSDBSwimRegion = 0x0080,
|
||||
|
||||
kLOSDBMax = 0x0100, // MOVE THIS UP if you add new classes under it. we need it to iterate through the DBs
|
||||
kLOSDBForce16 = 0xffff
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef PLSIMDEFS_H
|
||||
#define PLSIMDEFS_H
|
||||
#pragma once
|
||||
|
||||
namespace plSimDefs
|
||||
{
|
||||
// Groups are used to determine what a physical collides with, and what a
|
||||
// detector detects
|
||||
enum Group
|
||||
{
|
||||
// A physical that blocks avatars and dynamics
|
||||
kGroupStatic,
|
||||
// Blocks only avatars
|
||||
kGroupAvatarBlocker,
|
||||
// Blocks only dynamics
|
||||
kGroupDynamicBlocker,
|
||||
// No physical should actually be set to this, since the avatar is
|
||||
// controlled by a special kind of physical. However, you can use this
|
||||
// for detecting.
|
||||
kGroupAvatar,
|
||||
// A physical that can be pushed around by the avatar or other dynamics
|
||||
kGroupDynamic,
|
||||
// A physical that doesn't block anything, but reports on any physical
|
||||
// that enters it
|
||||
kGroupDetector,
|
||||
// Blocks nothing, for los checks only
|
||||
kGroupLOSOnly,
|
||||
//kExcludeRegion setting up so only blocks avatars and only when not in seek mode
|
||||
kGroupExcludeRegion,
|
||||
// Just for error checking
|
||||
kGroupMax,
|
||||
};
|
||||
|
||||
/** A taxonomy of action types. Crucial for doing things like making sure you don't
|
||||
do things like attach duplicate actions. */
|
||||
enum ActionType
|
||||
{
|
||||
kUnknownAction = 0x01, // don't know the type (probably forgot to override GetType())
|
||||
kUnknownZAction = 0x02, // unknown type of z-order action
|
||||
kAntiGravityAction = 0x03, // an action that counters gravity exactly
|
||||
kUprightAction = 0x04, // an action that keeps an object upright by apply force
|
||||
kPhysAnimAction = 0x05, // an action that parses keyframed animation into physical information
|
||||
kConstraint = 0x06, // a general constraint.
|
||||
kCallbackAction = 0x07, // an action that just hands us the physics "tick"
|
||||
kPseudoPhysAction = 0x08, // replacement for the physAnim
|
||||
kAntiGravAction = 0x09, // makes things float in the air
|
||||
kBasicGroundAction = 0x0a, // for your basic walkAroundOnGround corrections
|
||||
kHorizontalFreeze = 0x0b, // Let's you fall vertically, but otherwise keeps you in place (generic brains)
|
||||
|
||||
kMaxAction = 0xffff // force 16-bit
|
||||
};
|
||||
|
||||
/** Different types of line-of-sight requests. */
|
||||
enum LOSReqType
|
||||
{
|
||||
// these are MASKS -- keep powers of two
|
||||
kLOS_IgnoreCameraRequest = 0x1,
|
||||
kLOS_IgnoreUIRequest = 0x2,
|
||||
kLOS_CameraAvoidObject = 0x4,
|
||||
|
||||
kLOS_Max = 0xffff // force 16-bit
|
||||
};
|
||||
|
||||
/** Different types of physics shapes. In most cases they dictate how we intepret
|
||||
the raw vertices. In some cases (sphere) they explain why there aren't any vertices */
|
||||
enum Bounds {
|
||||
kBoxBounds = 0x01, // bounding box
|
||||
kSphereBounds, // bounding sphere
|
||||
kHullBounds, // convex hull
|
||||
kProxyBounds, // use alternate proxy geometry
|
||||
kExplicitBounds, // use the primary geometry
|
||||
kNumBounds, // the number of bounds types
|
||||
|
||||
kBoundsMax = 0xff // force 8-bit
|
||||
};
|
||||
|
||||
enum plLOSDB {
|
||||
kLOSDBNone = 0x0000,
|
||||
|
||||
kLOSDBUIBlockers = 0x0001, // things that block ui probes
|
||||
kLOSDBUIItems = 0x0002, // ui items -- we check these first for a hit before checking blockers
|
||||
kLOSDBCameraBlockers = 0x0004, // things that block camera probes
|
||||
kLOSDBCustom = 0x0008, // special things. only the user knows
|
||||
kLOSDBLocalAvatar = 0x0010, // yes, this is silly. it's transitional :)
|
||||
kLOSDBShootableItems = 0x0020, // shootable items, like from the VaporMiner gun
|
||||
|
||||
kLOSDBAvatarWalkable = 0x0040, // stuff the avatar is expected to walk on. Used to prevent sliding and allow
|
||||
// jumping. All terrain automatically goes here.
|
||||
|
||||
kLOSDBSwimRegion = 0x0080,
|
||||
|
||||
kLOSDBMax = 0x0100, // MOVE THIS UP if you add new classes under it. we need it to iterate through the DBs
|
||||
kLOSDBForce16 = 0xffff
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif PLSIMDEFS_H
|
@ -1,26 +1,26 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
// Obsolete
|
@ -1,26 +1,26 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
// Obsolete
|
Reference in New Issue
Block a user