missionMarker.cpp
Engine/source/T3D/missionMarker.cpp
Public Variables
bool
For frame signal.
Public Functions
_SpawnSpherespawnObject1("@brief Dynamically create <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> game object with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> specified class, datablock , and optional <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">properties.\n\n</a>" "This is called on the actual SpawnSphere)
ConsoleDocClass(CameraBookmark , "@brief Special type of mission marker which allows <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> level editor's camera <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> jump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> specific <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">points.\n\n</a>" "For Torque 3D editors only, not <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> actual game <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">development\n\n</a>" " @internal" )
ConsoleDocClass(MissionMarker , "@brief This is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> all \"marker\" related objets. It is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D representation of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> point in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "The <a href="/coding/file/x86unixmain_8cpp/#x86unixmain_8cpp_1a217dbf8b442f20279ea00b898af96f52">main</a> use of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classmissionmarker/">MissionMarker</a> is <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> represent <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> point in 3D space with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh and basic <a href="/coding/class/classshapebase/">ShapeBase</a> information. " "If you simply need <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mark <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> spot in your level, with no overhead from additional fields, this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classmissionmarker/">MissionMarker</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock=\"WayPointMarker\";\n" " position = \"295.699 -171.817 280.124\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " rotation = \"0 0 -1 13.8204\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " scale = \"1 1 1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " isRenderEnabled = \"true\";\n" " canSaveDynamicFields = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " enabled = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@note MissionMarkers will not add themselves <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the scene except when in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">editor.\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarkerData\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SpawnSphere\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">WayPoint\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
ConsoleDocClass(MissionMarkerData , "@brief A very basic class containing information used by <a href="/coding/class/classmissionmarker/">MissionMarker</a> objects <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendering\n\n</a>" " MissionMarkerData, is an extremely barebones class derived from ShapeBaseData. It is solely used by " "<a href="/coding/class/classmissionmarker/">MissionMarker</a> classes, so that you can see the object <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> editing <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "datablock <a href="/coding/class/classmissionmarkerdata/">MissionMarkerData</a>(SpawnSphereMarker)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " category=\"Misc\";\n" " shapeFile = \"core/art/shapes/octahedron.dts\";\n" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarker\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SpawnSphere\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">WayPoint\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
ConsoleDocClass(SpawnSphere , "@brief This class is used <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> creating any type of game object, assigning it <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> class, datablock , and other " "properties when it is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned.\n\n</a>" "Torque 3D uses <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> simple spawn system, which can be easily modified <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> spawn any kind of object(of any class). " "Each <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> level already contains at least one SpawnSphere, which is represented by <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> green octahedron in stock Torque 3D. " "The spawnClass field determines the object type, such as Player, <a href="/coding/class/classaiplayer/">AIPlayer</a> , etc. The spawnDataBlock field applies the " "pre-defined datablock <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> each spawned object instance. The really powerful feature of this class is provided by " "the spawnScript field which allows you <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> define <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> simple script(multiple lines) that will be executed once the " "object has been <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Define an <a href="/coding/class/classspawnsphere/">SpawnSphere</a> that essentially performs the following each time an object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned\n</a>" "// $SpawnObject, the following <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lines\n</a>" "//of code will execute AFTER the <a href="/coding/class/classplayer/">Player</a> object has been <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned.\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Object Spawned\");\n" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Hello World\");\n\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarker\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarkerData\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
ConsoleDocClass(WayPoint , "@brief Special type of marker, distinguished by <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> name and team ID <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number\n\n</a>" "The original Torque engines were built from <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> multi-player game called Tribes. " "The Tribes series featured various team based game modes, such as capture the flag. " "The <a href="/coding/class/classwaypoint/">WayPoint</a> class survived the conversion from game(Tribes) <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> game engine(Torque).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " Essentially, this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classmissionmarker/">MissionMarker</a> with the addition of two variables:markerName and team. " "Whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classwaypoint/">WayPoint</a> is created, it is added <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> unique global list called WayPointSet. " "You can iterate through this set, seeking out specific markers determined by their markerName and team ID. " "This avoids the overhead of constantly calling commandToClient and commandToServer <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> determine " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classwaypoint/">WayPoint</a> object 's name, unique ID, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">etc.\n\n</a>" " @note The< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> >markerName< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> > field was previously called< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> >name</<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> > , but was changed " "because this conflicted with the <a href="/coding/class/classsimobject/">SimObject</a> name field. Existing scripts that relied " "on the <a href="/coding/class/classwaypoint/">WayPoint</a>< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> >name</<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> > field will need <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">updated.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classwaypoint/">WayPoint</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " team=\"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock = \"WayPointMarker\";\n" " position = \"-0.0224786 1.53471 2.93219\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " rotation = \"1 0 0 0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " scale = \"1 1 1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSave = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSaveDynamicFields = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarker\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarkerData\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
DefineEngineMethod(SpawnSphere , spawnObject , S32 , (String additionalProps) , "([string additionalProps]) Spawns the object based on the <a href="/coding/class/classspawnsphere/">SpawnSphere</a>'s " " class, datablock , properties , and script settings. Allows you <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> pass in " "extra properties." " @hide" )
IMPLEMENT_CALLBACK(SpawnSphere , onAdd , void , (U32 objectId) , (objectId) , "Called when the <a href="/coding/class/classspawnsphere/">SpawnSphere</a> is being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">created.\n</a>" "@param objectId The unique <a href="/coding/file/sim_8h/#sim_8h_1a49bacc02fe88c44cd96633dd77e34ebc">SimObjectId</a> generated when <a href="/coding/class/classspawnsphere/">SpawnSphere</a> is created (%%this in script)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
Detailed Description
Public Variables
bool gEditingMission
For frame signal.
Public Functions
_SpawnSpherespawnObject1("@brief Dynamically create <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> game object with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> specified class, datablock , and optional <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">properties.\n\n</a>" "This is called on the actual SpawnSphere)
ConsoleDocClass(CameraBookmark , "@brief Special type of mission marker which allows <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> level editor's camera <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> jump <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> specific <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">points.\n\n</a>" "For Torque 3D editors only, not <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> actual game <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">development\n\n</a>" " @internal" )
ConsoleDocClass(MissionMarker , "@brief This is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> base class <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> all \"marker\" related objets. It is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D representation of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> point in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" "The <a href="/coding/file/x86unixmain_8cpp/#x86unixmain_8cpp_1a217dbf8b442f20279ea00b898af96f52">main</a> use of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classmissionmarker/">MissionMarker</a> is <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> represent <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> point in 3D space with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> mesh and basic <a href="/coding/class/classshapebase/">ShapeBase</a> information. " "If you simply need <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mark <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> spot in your level, with no overhead from additional fields, this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classmissionmarker/">MissionMarker</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock=\"WayPointMarker\";\n" " position = \"295.699 -171.817 280.124\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " rotation = \"0 0 -1 13.8204\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " scale = \"1 1 1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " isRenderEnabled = \"true\";\n" " canSaveDynamicFields = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " enabled = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@note MissionMarkers will not add themselves <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the scene except when in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">editor.\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarkerData\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SpawnSphere\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">WayPoint\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
ConsoleDocClass(MissionMarkerData , "@brief A very basic class containing information used by <a href="/coding/class/classmissionmarker/">MissionMarker</a> objects <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">rendering\n\n</a>" " MissionMarkerData, is an extremely barebones class derived from ShapeBaseData. It is solely used by " "<a href="/coding/class/classmissionmarker/">MissionMarker</a> classes, so that you can see the object <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> editing <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">level.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "datablock <a href="/coding/class/classmissionmarkerdata/">MissionMarkerData</a>(SpawnSphereMarker)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " category=\"Misc\";\n" " shapeFile = \"core/art/shapes/octahedron.dts\";\n" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarker\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SpawnSphere\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">WayPoint\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
ConsoleDocClass(SpawnSphere , "@brief This class is used <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> creating any type of game object, assigning it <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> class, datablock , and other " "properties when it is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned.\n\n</a>" "Torque 3D uses <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> simple spawn system, which can be easily modified <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> spawn any kind of object(of any class). " "Each <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> level already contains at least one SpawnSphere, which is represented by <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> green octahedron in stock Torque 3D. " "The spawnClass field determines the object type, such as Player, <a href="/coding/class/classaiplayer/">AIPlayer</a> , etc. The spawnDataBlock field applies the " "pre-defined datablock <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> each spawned object instance. The really powerful feature of this class is provided by " "the spawnScript field which allows you <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> define <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> simple script(multiple lines) that will be executed once the " "object has been <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Define an <a href="/coding/class/classspawnsphere/">SpawnSphere</a> that essentially performs the following each time an object is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned\n</a>" "// $SpawnObject, the following <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">lines\n</a>" "//of code will execute AFTER the <a href="/coding/class/classplayer/">Player</a> object has been <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">spawned.\n</a>" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Object Spawned\");\n" "<a href="/coding/file/ggendoflinefix_8txt/#ggendoflinefix_8txt_1a7f8fee038817022b75b8865e5da4eba3">echo</a>(\"Hello World\");\n\n" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarker\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarkerData\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
ConsoleDocClass(WayPoint , "@brief Special type of marker, distinguished by <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> name and team ID <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">number\n\n</a>" "The original Torque engines were built from <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> multi-player game called Tribes. " "The Tribes series featured various team based game modes, such as capture the flag. " "The <a href="/coding/class/classwaypoint/">WayPoint</a> class survived the conversion from game(Tribes) <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> game engine(Torque).\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " Essentially, this is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classmissionmarker/">MissionMarker</a> with the addition of two variables:markerName and team. " "Whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classwaypoint/">WayPoint</a> is created, it is added <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> unique global list called WayPointSet. " "You can iterate through this set, seeking out specific markers determined by their markerName and team ID. " "This avoids the overhead of constantly calling commandToClient and commandToServer <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> determine " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classwaypoint/">WayPoint</a> object 's name, unique ID, <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">etc.\n\n</a>" " @note The< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> >markerName< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> > field was previously called< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> >name</<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> > , but was changed " "because this conflicted with the <a href="/coding/class/classsimobject/">SimObject</a> name field. Existing scripts that relied " "on the <a href="/coding/class/classwaypoint/">WayPoint</a>< <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> >name</<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1acb559820d9ca11295b4500f179ef6392">i</a> > field will need <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">updated.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classwaypoint/">WayPoint</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " team=\"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock = \"WayPointMarker\";\n" " position = \"-0.0224786 1.53471 2.93219\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " rotation = \"1 0 0 0\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " scale = \"1 1 1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSave = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " canSaveDynamicFields = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarker\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">MissionMarkerData\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">enviroMisc\n</a>" )
DefineEngineMethod(SpawnSphere , spawnObject , S32 , (String additionalProps) , "([string additionalProps]) Spawns the object based on the <a href="/coding/class/classspawnsphere/">SpawnSphere</a>'s " " class, datablock , properties , and script settings. Allows you <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> pass in " "extra properties." " @hide" )
IMPLEMENT_CALLBACK(SpawnSphere , onAdd , void , (U32 objectId) , (objectId) , "Called when the <a href="/coding/class/classspawnsphere/">SpawnSphere</a> is being <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">created.\n</a>" "@param objectId The unique <a href="/coding/file/sim_8h/#sim_8h_1a49bacc02fe88c44cd96633dd77e34ebc">SimObjectId</a> generated when <a href="/coding/class/classspawnsphere/">SpawnSphere</a> is created (%%this in script)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" )
IMPLEMENT_CO_DATABLOCK_V1(MissionMarkerData )
IMPLEMENT_CO_NETOBJECT_V1(CameraBookmark )
IMPLEMENT_CO_NETOBJECT_V1(MissionMarker )
IMPLEMENT_CO_NETOBJECT_V1(SpawnSphere )
IMPLEMENT_CO_NETOBJECT_V1(WayPoint )
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "T3D/missionMarker.h" 25#include "console/consoleTypes.h" 26#include "core/color.h" 27#include "console/engineAPI.h" 28 29extern bool gEditingMission; 30IMPLEMENT_CO_DATABLOCK_V1(MissionMarkerData); 31 32ConsoleDocClass( MissionMarkerData, 33 "@brief A very basic class containing information used by MissionMarker objects for rendering\n\n" 34 35 "MissionMarkerData, is an extremely barebones class derived from ShapeBaseData. It is solely used by " 36 "MissionMarker classes (such as SpawnSphere), so that you can see the object while editing a level.\n\n" 37 38 "@tsexample\n" 39 "datablock MissionMarkerData(SpawnSphereMarker)\n" 40 "{\n" 41 " category = \"Misc\";\n" 42 " shapeFile = \"core/art/shapes/octahedron.dts\";\n" 43 "};\n" 44 "@endtsexample\n\n" 45 46 "@see MissionMarker\n\n" 47 "@see SpawnSphere\n\n" 48 "@see WayPoint\n\n" 49 "@ingroup enviroMisc\n" 50); 51 52//------------------------------------------------------------------------------ 53// Class: MissionMarker 54//------------------------------------------------------------------------------ 55IMPLEMENT_CO_NETOBJECT_V1(MissionMarker); 56 57ConsoleDocClass( MissionMarker, 58 "@brief This is a base class for all \"marker\" related objets. It is a 3D representation of a point in the level.\n\n" 59 60 "The main use of a MissionMarker is to represent a point in 3D space with a mesh and basic ShapeBase information. " 61 "If you simply need to mark a spot in your level, with no overhead from additional fields, this is a useful object.\n\n" 62 63 "@tsexample\n" 64 "new MissionMarker()\n" 65 "{\n" 66 " dataBlock = \"WayPointMarker\";\n" 67 " position = \"295.699 -171.817 280.124\";\n" 68 " rotation = \"0 0 -1 13.8204\";\n" 69 " scale = \"1 1 1\";\n" 70 " isRenderEnabled = \"true\";\n" 71 " canSaveDynamicFields = \"1\";\n" 72 " enabled = \"1\";\n" 73 "};\n" 74 "@endtsexample\n\n" 75 76 "@note MissionMarkers will not add themselves to the scene except when in the editor.\n\n" 77 78 "@see MissionMarkerData\n\n" 79 "@see SpawnSphere\n\n" 80 "@see WayPoint\n\n" 81 "@ingroup enviroMisc\n" 82); 83 84MissionMarker::MissionMarker() 85{ 86 mTypeMask |= StaticObjectType | MarkerObjectType; 87 mDataBlock = 0; 88 mAddedToScene = false; 89 mNetFlags.set(Ghostable | ScopeAlways); 90} 91 92bool MissionMarker::onAdd() 93{ 94 if(!Parent::onAdd() || !mDataBlock) 95 return(false); 96 97 if(gEditingMission) 98 { 99 addToScene(); 100 mAddedToScene = true; 101 } 102 103 return(true); 104} 105 106void MissionMarker::onRemove() 107{ 108 if( mAddedToScene ) 109 { 110 removeFromScene(); 111 mAddedToScene = false; 112 } 113 114 Parent::onRemove(); 115} 116 117void MissionMarker::inspectPostApply() 118{ 119 Parent::inspectPostApply(); 120 setMaskBits(PositionMask); 121} 122 123void MissionMarker::onEditorEnable() 124{ 125 if(!mAddedToScene) 126 { 127 addToScene(); 128 mAddedToScene = true; 129 } 130} 131 132void MissionMarker::onEditorDisable() 133{ 134 if(mAddedToScene) 135 { 136 removeFromScene(); 137 mAddedToScene = false; 138 } 139} 140 141bool MissionMarker::onNewDataBlock( GameBaseData *dptr, bool reload ) 142{ 143 mDataBlock = dynamic_cast<MissionMarkerData*>( dptr ); 144 if ( !mDataBlock || !Parent::onNewDataBlock( dptr, reload ) ) 145 return(false); 146 scriptOnNewDataBlock(); 147 return(true); 148} 149 150void MissionMarker::setTransform(const MatrixF& mat) 151{ 152 Parent::setTransform(mat); 153 setMaskBits(PositionMask); 154} 155 156U32 MissionMarker::packUpdate(NetConnection * con, U32 mask, BitStream * stream) 157{ 158 U32 retMask = Parent::packUpdate(con, mask, stream); 159 if(stream->writeFlag(mask & PositionMask)) 160 { 161 stream->writeAffineTransform(mObjToWorld); 162 mathWrite(*stream, mObjScale); 163 } 164 165 return(retMask); 166} 167 168void MissionMarker::unpackUpdate(NetConnection * con, BitStream * stream) 169{ 170 Parent::unpackUpdate(con, stream); 171 if(stream->readFlag()) 172 { 173 MatrixF mat; 174 stream->readAffineTransform(&mat); 175 Parent::setTransform(mat); 176 177 Point3F scale; 178 mathRead(*stream, &scale); 179 setScale(scale); 180 } 181} 182 183void MissionMarker::initPersistFields() { 184 Parent::initPersistFields(); 185} 186 187//------------------------------------------------------------------------------ 188// Class: WayPoint 189//------------------------------------------------------------------------------ 190IMPLEMENT_CO_NETOBJECT_V1(WayPoint); 191 192ConsoleDocClass( WayPoint, 193 "@brief Special type of marker, distinguished by a name and team ID number\n\n" 194 195 "The original Torque engines were built from a multi-player game called Tribes. " 196 "The Tribes series featured various team based game modes, such as capture the flag. " 197 "The WayPoint class survived the conversion from game (Tribes) to game engine (Torque).\n\n" 198 199 "Essentially, this is a MissionMarker with the addition of two variables: markerName and team. " 200 "Whenever a WayPoint is created, it is added to a unique global list called WayPointSet. " 201 "You can iterate through this set, seeking out specific markers determined by their markerName and team ID. " 202 "This avoids the overhead of constantly calling commandToClient and commandToServer to determine " 203 "a WayPoint object's name, unique ID, etc.\n\n" 204 205 "@note The <i>markerName<i> field was previously called <i>name</i>, but was changed " 206 "because this conflicted with the SimObject name field. Existing scripts that relied " 207 "on the WayPoint <i>name</i> field will need to be updated.\n\n" 208 209 "@tsexample\n" 210 "new WayPoint()\n" 211 "{\n" 212 " team = \"1\";\n" 213 " dataBlock = \"WayPointMarker\";\n" 214 " position = \"-0.0224786 1.53471 2.93219\";\n" 215 " rotation = \"1 0 0 0\";\n" 216 " scale = \"1 1 1\";\n" 217 " canSave = \"1\";\n" 218 " canSaveDynamicFields = \"1\";\n" 219 "};\n" 220 "@endtsexample\n\n" 221 222 "@see MissionMarker\n\n" 223 "@see MissionMarkerData\n\n" 224 "@ingroup enviroMisc\n" 225); 226 227WayPoint::WayPoint() 228{ 229 mName = StringTable->EmptyString(); 230} 231 232void WayPoint::setHidden(bool hidden) 233{ 234 // Skip ShapeBase::setHidden (only ever added to scene if in the editor) 235 ShapeBase::Parent::setHidden( hidden ); 236 if(isServerObject()) 237 setMaskBits(UpdateHiddenMask); 238} 239 240bool WayPoint::onAdd() 241{ 242 if(!Parent::onAdd()) 243 return(false); 244 245 // 246 if(isClientObject()) 247 Sim::getWayPointSet()->addObject(this); 248 else 249 { 250 setMaskBits(UpdateNameMask</a>|<a href="/coding/class/classwaypoint/#classwaypoint_1afaf8b720e6e6310306f4be311e1ada78a9d1d48ad8af0bf87a763e3165aba6d16">UpdateTeamMask); 251 } 252 253 return(true); 254} 255 256void WayPoint::inspectPostApply() 257{ 258 Parent::inspectPostApply(); 259 if(!mName || !mName[0]) 260 mName = StringTable->EmptyString(); 261 setMaskBits(UpdateNameMask</a>|<a href="/coding/class/classwaypoint/#classwaypoint_1afaf8b720e6e6310306f4be311e1ada78a9d1d48ad8af0bf87a763e3165aba6d16">UpdateTeamMask); 262} 263 264U32 WayPoint::packUpdate(NetConnection * con, U32 mask, BitStream * stream) 265{ 266 U32 retMask = Parent::packUpdate(con, mask, stream); 267 if(stream->writeFlag(mask & UpdateNameMask)) 268 stream->writeString(mName); 269 if(stream->writeFlag(mask & UpdateHiddenMask)) 270 stream->writeFlag(isHidden()); 271 return(retMask); 272} 273 274void WayPoint::unpackUpdate(NetConnection * con, BitStream * stream) 275{ 276 Parent::unpackUpdate(con, stream); 277 if(stream->readFlag()) 278 mName = stream->readSTString(true); 279 if(stream->readFlag()) 280 setHidden(stream->readFlag()); 281} 282 283void WayPoint::initPersistFields() 284{ 285 addGroup("Misc"); 286 addField("markerName", TypeCaseString, Offset(mName, WayPoint), "Unique name representing this waypoint"); 287 endGroup("Misc"); 288 Parent::initPersistFields(); 289} 290 291//------------------------------------------------------------------------------ 292// Class: SpawnSphere 293//------------------------------------------------------------------------------ 294IMPLEMENT_CO_NETOBJECT_V1(SpawnSphere); 295 296ConsoleDocClass( SpawnSphere, 297 "@brief This class is used for creating any type of game object, assigning it a class, datablock, and other " 298 "properties when it is spawned.\n\n" 299 300 "Torque 3D uses a simple spawn system, which can be easily modified to spawn any kind of object (of any class). " 301 "Each new level already contains at least one SpawnSphere, which is represented by a green octahedron in stock Torque 3D. " 302 "The spawnClass field determines the object type, such as Player, AIPlayer, etc. The spawnDataBlock field applies the " 303 "pre-defined datablock to each spawned object instance. The really powerful feature of this class is provided by " 304 "the spawnScript field which allows you to define a simple script (multiple lines) that will be executed once the " 305 "object has been spawned.\n\n" 306 307 "@tsexample\n" 308 "// Define an SpawnSphere that essentially performs the following each time an object is spawned\n" 309 "//$SpawnObject = new Player()\n" 310 "//{\n" 311 "// dataBlock = \"DefaultPlayerData\";\n" 312 "// name = \"Bob\";\n" 313 "// lifeTotal = 3;\n" 314 "//};\n" 315 "//echo(\"Spawned a Player: \" @ $SpawnObject);\n\n" 316 "new SpawnSphere(DefaultSpawnSphere)\n" 317 "{\n" 318 " spawnClass = \"Player\";\n" 319 " spawnDatablock = \"DefaultPlayerData\";\n" 320 " spawnScript = \"echo(\\\"Spawned a Player: \\\" @ $SpawnObject);\"; // embedded quotes must be escaped with \\ \n" 321 " spawnProperties = \"name = \\\"Bob\\\";lifeTotal = 3;\"; // embedded quotes must be escaped with \\ \n" 322 " autoSpawn = \"1\";\n" 323 " dataBlock = \"SpawnSphereMarker\";\n" 324 " position = \"-0.77266 -19.882 17.8153\";\n" 325 " rotation = \"1 0 0 0\";\n" 326 " scale = \"1 1 1\";\n" 327 " canSave = \"1\";\n" 328 " canSaveDynamicFields = \"1\";\n" 329 "};\n\n" 330 "// Because autoSpawn is set to true in the above example, the following lines\n" 331 "// of code will execute AFTER the Player object has been spawned.\n" 332 "echo(\"Object Spawned\");\n" 333 "echo(\"Hello World\");\n\n" 334 "@endtsexample\n\n" 335 336 "@see MissionMarker\n\n" 337 "@see MissionMarkerData\n\n" 338 "@ingroup gameObjects\n" 339 "@ingroup enviroMisc\n" 340); 341 342SpawnSphere::SpawnSphere() 343{ 344 mAutoSpawn = false; 345 mSpawnTransform = false; 346 347 mRadius = 100.f; 348 mSphereWeight = 100.f; 349 mIndoorWeight = 100.f; 350 mOutdoorWeight = 100.f; 351} 352 353IMPLEMENT_CALLBACK( SpawnSphere, onAdd, void, ( U32 objectId ), ( objectId ), 354 "Called when the SpawnSphere is being created.\n" 355 "@param objectId The unique SimObjectId generated when SpawnSphere is created (%%this in script)\n" ); 356 357bool SpawnSphere::onAdd() 358{ 359 if(!Parent::onAdd()) 360 return(false); 361 362 if(!isClientObject()) 363 setMaskBits(UpdateSphereMask); 364 365 if (!isGhost()) 366 { 367 onAdd_callback( getId()); 368 369 if (mAutoSpawn) 370 spawnObject(); 371 } 372 373 return true; 374} 375 376SimObject* SpawnSphere::spawnObject(String additionalProps) 377{ 378 SimObject* spawnObject = Sim::spawnObject(mSpawnClass, mSpawnDataBlock, mSpawnName, 379 mSpawnProperties + " " + additionalProps, mSpawnScript); 380 381 // If we have a spawnObject add it to the MissionCleanup group 382 if (spawnObject) 383 { 384 if (mSpawnTransform) 385 { 386 if(SceneObject *s = dynamic_cast<SceneObject*>(spawnObject)) 387 s->setTransform(getTransform()); 388 } 389 390 SimObject* cleanup = Sim::findObject("MissionCleanup"); 391 392 if (cleanup) 393 { 394 SimGroup* missionCleanup = dynamic_cast<SimGroup*>(cleanup); 395 396 missionCleanup->addObject(spawnObject); 397 } 398 } 399 400 return spawnObject; 401} 402 403void SpawnSphere::inspectPostApply() 404{ 405 Parent::inspectPostApply(); 406 setMaskBits(UpdateSphereMask); 407} 408 409U32 SpawnSphere::packUpdate(NetConnection * con, U32 mask, BitStream * stream) 410{ 411 U32 retMask = Parent::packUpdate(con, mask, stream); 412 413 // 414 if(stream->writeFlag(mask & UpdateSphereMask)) 415 { 416 stream->writeFlag(mAutoSpawn); 417 stream->writeFlag(mSpawnTransform); 418 419 stream->write(mSpawnClass); 420 stream->write(mSpawnDataBlock); 421 stream->write(mSpawnName); 422 stream->write(mSpawnProperties); 423 stream->write(mSpawnScript); 424 } 425 return(retMask); 426} 427 428void SpawnSphere::unpackUpdate(NetConnection * con, BitStream * stream) 429{ 430 Parent::unpackUpdate(con, stream); 431 if(stream->readFlag()) 432 { 433 mAutoSpawn = stream->readFlag(); 434 mSpawnTransform = stream->readFlag(); 435 436 stream->read(&mSpawnClass); 437 stream->read(&mSpawnDataBlock); 438 stream->read(&mSpawnName); 439 stream->read(&mSpawnProperties); 440 stream->read(&mSpawnScript); 441 } 442} 443 444void SpawnSphere::processTick( const Move *move ) 445{ 446 Parent::processTick( move ); 447} 448 449void SpawnSphere::advanceTime( F32 timeDelta ) 450{ 451 Parent::advanceTime( timeDelta ); 452} 453 454void SpawnSphere::initPersistFields() 455{ 456 addGroup( "Spawn" ); 457 addField( "spawnClass", TypeRealString, Offset(mSpawnClass, SpawnSphere), 458 "Object class to create (eg. Player, AIPlayer, Debris etc)" ); 459 addField( "spawnDatablock", TypeRealString, Offset(mSpawnDataBlock, SpawnSphere), 460 "Predefined datablock assigned to the object when created" ); 461 addField( "spawnProperties", TypeRealString, Offset(mSpawnProperties, SpawnSphere), 462 "String containing semicolon (;) delimited properties to set when the object is created." ); 463 addField( "spawnScript", TypeCommand, Offset(mSpawnScript, SpawnSphere), 464 "Command to execute immediately after spawning an object. New object id is stored in $SpawnObject. Max 255 characters." ); 465 addField( "autoSpawn", TypeBool, Offset(mAutoSpawn, SpawnSphere), 466 "Flag to spawn object as soon as SpawnSphere is created, true to enable or false to disable." ); 467 addField( "spawnTransform", TypeBool, Offset(mSpawnTransform, SpawnSphere), 468 "Flag to set the spawned object's transform to the SpawnSphere's transform." ); 469 endGroup( "Spawn" ); 470 471 addGroup( "Dimensions" ); 472 addField( "radius", TypeF32, Offset(mRadius, SpawnSphere), "Deprecated" ); 473 endGroup( "Dimensions" ); 474 475 addGroup( "Weight" ); 476 addField( "sphereWeight", TypeF32, Offset(mSphereWeight, SpawnSphere), "Deprecated" ); 477 addField( "indoorWeight", TypeF32, Offset(mIndoorWeight, SpawnSphere), "Deprecated" ); 478 addField( "outdoorWeight", TypeF32, Offset(mOutdoorWeight, SpawnSphere), "Deprecated" ); 479 endGroup( "Weight" ); 480 481 Parent::initPersistFields(); 482} 483 484ConsoleDocFragment _SpawnSpherespawnObject1( 485 "@brief Dynamically create a new game object with a specified class, datablock, and optional properties.\n\n" 486 "This is called on the actual SpawnSphere, not to be confused with the Sim::spawnObject() " 487 "global function\n\n" 488 "@param additionalProps Optional set of semiconlon delimited parameters applied to the spawn object during creation.\n\n" 489 "@tsexample\n" 490 "// Use the SpawnSphere::spawnObject function to create a game object\n" 491 "// No additional properties assigned\n" 492 "%player = DefaultSpawnSphere.spawnObject();\n\n" 493 "@endtsexample\n\n", 494 "SpawnSphere", 495 "bool spawnObject(string additionalProps);" 496); 497 498DefineEngineMethod(SpawnSphere, spawnObject, S32, (String additionalProps), , 499 "([string additionalProps]) Spawns the object based on the SpawnSphere's " 500 "class, datablock, properties, and script settings. Allows you to pass in " 501 "extra properties." 502 "@hide" ) 503{ 504 //String additionalProps; 505 506 //if (argc == 3) 507 // additionalProps = String(argv[2]); 508 509 SimObject* obj = object->spawnObject(additionalProps); 510 511 if (obj) 512 return obj->getId(); 513 514 return -1; 515} 516 517 518//------------------------------------------------------------------------------ 519// Class: CameraBookmark 520//------------------------------------------------------------------------------ 521IMPLEMENT_CO_NETOBJECT_V1(CameraBookmark); 522 523ConsoleDocClass( CameraBookmark, 524 "@brief Special type of mission marker which allows a level editor's camera to jump to specific points.\n\n" 525 "For Torque 3D editors only, not for actual game development\n\n" 526 "@internal" 527); 528 529CameraBookmark::CameraBookmark() 530{ 531 mName = StringTable->EmptyString(); 532} 533 534bool CameraBookmark::onAdd() 535{ 536 if(!Parent::onAdd()) 537 return(false); 538 539 // 540 if(!isClientObject()) 541 { 542 setMaskBits(UpdateNameMask); 543 } 544 545 if( isServerObject() && isMethod("onAdd") ) 546 Con::executef( this, "onAdd" ); 547 548 return(true); 549} 550 551void CameraBookmark::onRemove() 552{ 553 if( isServerObject() && isMethod("onRemove") ) 554 Con::executef( this, "onRemove" ); 555 556 Parent::onRemove(); 557} 558 559void CameraBookmark::onGroupAdd() 560{ 561 if( isServerObject() && isMethod("onGroupAdd") ) 562 Con::executef( this, "onGroupAdd" ); 563} 564 565void CameraBookmark::onGroupRemove() 566{ 567 if( isServerObject() && isMethod("onGroupRemove") ) 568 Con::executef( this, "onGroupRemove" ); 569} 570 571void CameraBookmark::inspectPostApply() 572{ 573 Parent::inspectPostApply(); 574 if(!mName || !mName[0]) 575 mName = StringTable->EmptyString(); 576 setMaskBits(UpdateNameMask); 577 578 if( isMethod("onInspectPostApply") ) 579 Con::executef( this, "onInspectPostApply" ); 580} 581 582U32 CameraBookmark::packUpdate(NetConnection * con, U32 mask, BitStream * stream) 583{ 584 U32 retMask = Parent::packUpdate(con, mask, stream); 585 if(stream->writeFlag(mask & UpdateNameMask)) 586 stream->writeString(mName); 587 return(retMask); 588} 589 590void CameraBookmark::unpackUpdate(NetConnection * con, BitStream * stream) 591{ 592 Parent::unpackUpdate(con, stream); 593 if(stream->readFlag()) 594 mName = stream->readSTString(true); 595} 596 597void CameraBookmark::initPersistFields() 598{ 599 //addGroup("Misc"); 600 //addField("name", TypeCaseString, Offset(mName, CameraBookmark)); 601 //endGroup("Misc"); 602 603 Parent::initPersistFields(); 604 605 removeField("nameTag"); // From GameBase 606} 607