123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- //-----------------------------------------------------------------------------
- // Copyright (c) 2012 GarageGames, LLC
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the "Software"), to
- // deal in the Software without restriction, including without limitation the
- // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- // sell copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- //
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- // IN THE SOFTWARE.
- //-----------------------------------------------------------------------------
- #ifndef _MISSIONMARKER_H_
- #define _MISSIONMARKER_H_
- #ifndef _BITSTREAM_H_
- #include "core/stream/bitStream.h"
- #endif
- #ifndef _SIMBASE_H_
- #include "console/simBase.h"
- #endif
- #ifndef _SHAPEBASE_H_
- #include "T3D/shapeBase.h"
- #endif
- #ifndef _MATHIO_H_
- #include "math/mathIO.h"
- #endif
- #ifndef _COLOR_H_
- #include "core/color.h"
- #endif
- class MissionMarkerData : public ShapeBaseData
- {
- private:
- typedef ShapeBaseData Parent;
- public:
- DECLARE_CONOBJECT(MissionMarkerData);
- };
- //------------------------------------------------------------------------------
- // Class: MissionMarker
- //------------------------------------------------------------------------------
- class MissionMarker : public ShapeBase
- {
- private:
- typedef ShapeBase Parent;
- protected:
- enum MaskBits {
- PositionMask = Parent::NextFreeMask,
- NextFreeMask = Parent::NextFreeMask << 1
- };
- MissionMarkerData * mDataBlock;
- bool mAddedToScene;
- public:
- MissionMarker();
- // GameBase
- bool onNewDataBlock( GameBaseData *dptr, bool reload );
- // SceneObject
- void setTransform(const MatrixF &mat);
- // SimObject
- bool onAdd();
- void onRemove();
- void onEditorEnable();
- void onEditorDisable();
- void inspectPostApply();
- // NetObject
- U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream);
- void unpackUpdate(NetConnection *conn, BitStream *stream);
- DECLARE_CONOBJECT(MissionMarker);
- static void initPersistFields();
- };
- //------------------------------------------------------------------------------
- // Class: WayPoint
- //------------------------------------------------------------------------------
- class WayPoint;
- class WayPoint : public MissionMarker
- {
- private:
- typedef MissionMarker Parent;
- public:
- enum WayPointMasks {
- UpdateNameMask = Parent::NextFreeMask,
- UpdateTeamMask = Parent::NextFreeMask << 1,
- UpdateHiddenMask = Parent::NextFreeMask << 2,
- NextFreeMask = Parent::NextFreeMask << 3
- };
- WayPoint();
- // ShapeBase: only ever added to scene if in the editor
- void setHidden(bool hidden);
- // SimObject
- bool onAdd();
- void inspectPostApply();
- // NetObject
- U32 packUpdate(NetConnection *conn, U32 mask, BitStream *stream);
- void unpackUpdate(NetConnection *conn, BitStream *stream);
- // field data
- StringTableEntry mName;
- static void initPersistFields();
- DECLARE_CONOBJECT(WayPoint);
- };
- //------------------------------------------------------------------------------
- // Class: SpawnSphere
- //------------------------------------------------------------------------------
- class SpawnSphere : public MissionMarker
- {
- private:
- typedef MissionMarker Parent;
- public:
- SpawnSphere();
- // SimObject
- bool onAdd();
- void inspectPostApply();
- // NetObject
- enum SpawnSphereMasks
- {
- UpdateSphereMask = Parent::NextFreeMask,
- NextFreeMask = Parent::NextFreeMask << 1
- };
- U32 packUpdate (NetConnection *conn, U32 mask, BitStream *stream);
- void unpackUpdate(NetConnection *conn, BitStream *stream);
- // ProcessObject
- void advanceTime( F32 timeDelta );
- void processTick( const Move *move );
- // Spawn info
- String mSpawnClass;
- String mSpawnDataBlock;
- String mSpawnName;
- String mSpawnProperties;
- String mSpawnScript;
- bool mAutoSpawn;
- bool mSpawnTransform;
- // Radius/weight info
- F32 mRadius;
- F32 mSphereWeight;
- F32 mIndoorWeight;
- F32 mOutdoorWeight;
- SimObject* spawnObject(String additionalProps = String::EmptyString);
- static void initPersistFields();
- DECLARE_CONOBJECT(SpawnSphere);
- DECLARE_CALLBACK( void, onAdd, ( U32 objectId ) );
- };
- //------------------------------------------------------------------------------
- // Class: CameraBookmark
- //------------------------------------------------------------------------------
- class CameraBookmark : public MissionMarker
- {
- private:
- typedef MissionMarker Parent;
- public:
- enum WayPointMasks {
- UpdateNameMask = Parent::NextFreeMask,
- NextFreeMask = Parent::NextFreeMask << 1
- };
- CameraBookmark();
- // SimObject
- virtual bool onAdd();
- virtual void onRemove();
- virtual void onGroupAdd();
- virtual void onGroupRemove();
- void inspectPostApply();
- // NetObject
- U32 packUpdate(NetConnection *conn, U32 mask, BitStream *stream);
- void unpackUpdate(NetConnection *conn, BitStream *stream);
- // field data
- StringTableEntry mName;
- static void initPersistFields();
- DECLARE_CONOBJECT(CameraBookmark);
- /*DECLARE_CALLBACK( void, onAdd, () );
- DECLARE_CALLBACK( void, onRemove, () );
- DECLARE_CALLBACK( void, onGroupAdd, () );
- DECLARE_CALLBACK( void, onGroupRemove, () );
- DECLARE_CALLBACK( void, onInspectPostApply, () );*/
- };
- #endif // _MISSIONMARKER_H_
|