staticShape.cpp
Engine/source/T3D/staticShape.cpp
Public Variables
Public Functions
ConsoleDocClass(StaticShape , "@brief The most basic 3D shape with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock available in Torque 3<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">D.\n\n</a>" "When it comes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> placing 3D objects in the scene, you technically have two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">options:\n\n</a>" "1. <a href="/coding/class/classtsstatic/">TSStatic</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "2. <a href="/coding/class/classshapebase/">ShapeBase</a> derived <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "Since <a href="/coding/class/classshapebase/">ShapeBase</a> and <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> are not meant <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be instantiated in script, you " "will use one of its child classes instead. Several game related objects are derived " "from ShapeBase:Player , <a href="/coding/class/classvehicle/">Vehicle</a> , <a href="/coding/class/classitem/">Item</a> , and so <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">on.\n\n</a>" "When you need <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object with datablock capabilities, you will use an object derived " "from ShapeBase. When you need an object with extremely low overhead, and with no other " "purpose than <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object in the scene, you will use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic.\n\n</a>" "The most basic child of <a href="/coding/class/classshapebase/">ShapeBase</a> is StaticShape. It does not introduce any of the " "additional functionality you see in Player, <a href="/coding/class/classitem/">Item</a> , <a href="/coding/class/classvehicle/">Vehicle</a> or the other game play " "heavy classes. At its core, it is comparable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> TSStatic, but with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datbalock. Having " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock provides <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> location <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> common variables as well as having access <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "various ShapeBaseData, <a href="/coding/class/structgamebasedata/">GameBaseData</a> and <a href="/coding/class/classsimdatablock/">SimDataBlock</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callbacks.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Create <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classstaticshape/">StaticShape</a> using <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock\n</a>" "datablock <a href="/coding/class/structstaticshapedata/">StaticShapeData</a>(BasicShapeData)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " shapeFile=\"art/shapes/items/kit/healthkit.dts\";\n" " testVar = \"Simple string, not <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> stock variable\";\n" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classstaticshape/">StaticShape</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock = \"BasicShapeData\";\n" " position = \"0.0 0.0 0.0\";\<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>" "};\<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">StaticShapeData\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBase\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" )
ConsoleDocClass(StaticShapeData , "@brief The most basic <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> derrived shape datablock available in Torque 3<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">D.\n\n</a>" "When it comes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> placing 3D objects in the scene, you effectively have two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">options:\n\n</a>" "1. <a href="/coding/class/classtsstatic/">TSStatic</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "2. <a href="/coding/class/classshapebase/">ShapeBase</a> derived <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "Since <a href="/coding/class/classshapebase/">ShapeBase</a> and <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> are not meant <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be instantiated in script, you " "will use one of its child classes instead. Several game related objects are derived " "from ShapeBase:Player , <a href="/coding/class/classvehicle/">Vehicle</a> , <a href="/coding/class/classitem/">Item</a> , and so <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">on.\n\n</a>" "When you need <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object with datablock capabilities, you will use an object derived " "from ShapeBase. When you need an object with extremely low overhead, and with no other " "purpose than <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object in the scene, you will use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic.\n\n</a>" "The most basic child of <a href="/coding/class/classshapebase/">ShapeBase</a> is StaticShape. It does not introduce any of the " "additional functionality you see in Player, <a href="/coding/class/classitem/">Item</a> , <a href="/coding/class/classvehicle/">Vehicle</a> or the other game play " "heavy classes. At its core, it is comparable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> TSStatic, but with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datbalock. Having " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock provides <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> location <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> common variables as well as having access <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "various ShapeBaseData, <a href="/coding/class/structgamebasedata/">GameBaseData</a> and <a href="/coding/class/classsimdatablock/">SimDataBlock</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callbacks.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Create <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classstaticshape/">StaticShape</a> using <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock\n</a>" "datablock <a href="/coding/class/structstaticshapedata/">StaticShapeData</a>(BasicShapeData)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " shapeFile=\"art/shapes/items/kit/healthkit.dts\";\n" " testVar = \"Simple string, not <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> stock variable\";\n" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classstaticshape/">StaticShape</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock = \"BasicShapeData\";\n" " position = \"0.0 0.0 0.0\";\<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>" "};\<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">StaticShape\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBaseData\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" "@ingroup Datablocks" )
DefineEngineMethod(StaticShape , getPoweredState , bool , () , "@internal" )
DefineEngineMethod(StaticShape , setPoweredState , void , (bool isPowered) , "(bool isPowered)" "@internal" )
Detailed Description
Public Variables
const U32 sgAllowedDynamicTypes
Public Functions
ConsoleDocClass(StaticShape , "@brief The most basic 3D shape with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock available in Torque 3<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">D.\n\n</a>" "When it comes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> placing 3D objects in the scene, you technically have two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">options:\n\n</a>" "1. <a href="/coding/class/classtsstatic/">TSStatic</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "2. <a href="/coding/class/classshapebase/">ShapeBase</a> derived <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "Since <a href="/coding/class/classshapebase/">ShapeBase</a> and <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> are not meant <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be instantiated in script, you " "will use one of its child classes instead. Several game related objects are derived " "from ShapeBase:Player , <a href="/coding/class/classvehicle/">Vehicle</a> , <a href="/coding/class/classitem/">Item</a> , and so <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">on.\n\n</a>" "When you need <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object with datablock capabilities, you will use an object derived " "from ShapeBase. When you need an object with extremely low overhead, and with no other " "purpose than <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object in the scene, you will use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic.\n\n</a>" "The most basic child of <a href="/coding/class/classshapebase/">ShapeBase</a> is StaticShape. It does not introduce any of the " "additional functionality you see in Player, <a href="/coding/class/classitem/">Item</a> , <a href="/coding/class/classvehicle/">Vehicle</a> or the other game play " "heavy classes. At its core, it is comparable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> TSStatic, but with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datbalock. Having " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock provides <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> location <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> common variables as well as having access <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "various ShapeBaseData, <a href="/coding/class/structgamebasedata/">GameBaseData</a> and <a href="/coding/class/classsimdatablock/">SimDataBlock</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callbacks.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Create <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classstaticshape/">StaticShape</a> using <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock\n</a>" "datablock <a href="/coding/class/structstaticshapedata/">StaticShapeData</a>(BasicShapeData)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " shapeFile=\"art/shapes/items/kit/healthkit.dts\";\n" " testVar = \"Simple string, not <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> stock variable\";\n" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classstaticshape/">StaticShape</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock = \"BasicShapeData\";\n" " position = \"0.0 0.0 0.0\";\<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>" "};\<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">StaticShapeData\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBase\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" )
ConsoleDocClass(StaticShapeData , "@brief The most basic <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> derrived shape datablock available in Torque 3<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">D.\n\n</a>" "When it comes <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> placing 3D objects in the scene, you effectively have two <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">options:\n\n</a>" "1. <a href="/coding/class/classtsstatic/">TSStatic</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "2. <a href="/coding/class/classshapebase/">ShapeBase</a> derived <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">objects\n\n</a>" "Since <a href="/coding/class/classshapebase/">ShapeBase</a> and <a href="/coding/class/structshapebasedata/">ShapeBaseData</a> are not meant <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be instantiated in script, you " "will use one of its child classes instead. Several game related objects are derived " "from ShapeBase:Player , <a href="/coding/class/classvehicle/">Vehicle</a> , <a href="/coding/class/classitem/">Item</a> , and so <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">on.\n\n</a>" "When you need <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object with datablock capabilities, you will use an object derived " "from ShapeBase. When you need an object with extremely low overhead, and with no other " "purpose than <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> 3D object in the scene, you will use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic.\n\n</a>" "The most basic child of <a href="/coding/class/classshapebase/">ShapeBase</a> is StaticShape. It does not introduce any of the " "additional functionality you see in Player, <a href="/coding/class/classitem/">Item</a> , <a href="/coding/class/classvehicle/">Vehicle</a> or the other game play " "heavy classes. At its core, it is comparable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> TSStatic, but with <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datbalock. Having " "<a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock provides <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> location <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> common variables as well as having access <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> " "various ShapeBaseData, <a href="/coding/class/structgamebasedata/">GameBaseData</a> and <a href="/coding/class/classsimdatablock/">SimDataBlock</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callbacks.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Create <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classstaticshape/">StaticShape</a> using <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">datablock\n</a>" "datablock <a href="/coding/class/structstaticshapedata/">StaticShapeData</a>(BasicShapeData)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " shapeFile=\"art/shapes/items/kit/healthkit.dts\";\n" " testVar = \"Simple string, not <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> stock variable\";\n" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classstaticshape/">StaticShape</a>()\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " dataBlock = \"BasicShapeData\";\n" " position = \"0.0 0.0 0.0\";\<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>" "};\<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">StaticShape\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">ShapeBaseData\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">TSStatic\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">gameObjects\n</a>" "@ingroup Datablocks" )
DefineEngineMethod(StaticShape , getPoweredState , bool , () , "@internal" )
DefineEngineMethod(StaticShape , setPoweredState , void , (bool isPowered) , "(bool isPowered)" "@internal" )
IMPLEMENT_CO_DATABLOCK_V1(StaticShapeData )
IMPLEMENT_CO_NETOBJECT_V1(StaticShape )
wireCube(F32 size, Point3F pos)
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//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 25// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames 26// Copyright (C) 2015 Faust Logic, Inc. 27//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 28#include "platform/platform.h" 29#include "core/dnet.h" 30#include "core/stream/bitStream.h" 31#include "app/game.h" 32#include "math/mMath.h" 33#include "console/simBase.h" 34#include "console/console.h" 35#include "console/consoleTypes.h" 36#include "console/engineAPI.h" 37#include "T3D/gameBase/moveManager.h" 38#include "ts/tsShapeInstance.h" 39#include "T3D/staticShape.h" 40#include "math/mathIO.h" 41#include "sim/netConnection.h" 42#include "scene/sceneObjectLightingPlugin.h" 43 44extern void wireCube(F32 size,Point3F pos); 45 46static const U32 sgAllowedDynamicTypes = 0xffffff; 47 48//---------------------------------------------------------------------------- 49 50IMPLEMENT_CO_DATABLOCK_V1(StaticShapeData); 51 52ConsoleDocClass( StaticShapeData, 53 "@brief The most basic ShapeBaseData derrived shape datablock available in Torque 3D.\n\n" 54 55 "When it comes to placing 3D objects in the scene, you effectively have two options:\n\n" 56 "1. TSStatic objects\n\n" 57 "2. ShapeBase derived objects\n\n" 58 59 "Since ShapeBase and ShapeBaseData are not meant to be instantiated in script, you " 60 "will use one of its child classes instead. Several game related objects are derived " 61 "from ShapeBase: Player, Vehicle, Item, and so on.\n\n" 62 63 "When you need a 3D object with datablock capabilities, you will use an object derived " 64 "from ShapeBase. When you need an object with extremely low overhead, and with no other " 65 "purpose than to be a 3D object in the scene, you will use TSStatic.\n\n" 66 67 "The most basic child of ShapeBase is StaticShape. It does not introduce any of the " 68 "additional functionality you see in Player, Item, Vehicle or the other game play " 69 "heavy classes. At its core, it is comparable to a TSStatic, but with a datbalock. Having " 70 "a datablock provides a location for common variables as well as having access to " 71 "various ShapeBaseData, GameBaseData and SimDataBlock callbacks.\n\n" 72 73 "@tsexample\n" 74 "// Create a StaticShape using a datablock\n" 75 "datablock StaticShapeData(BasicShapeData)\n" 76 "{\n" 77 " shapeFile = \"art/shapes/items/kit/healthkit.dts\";\n" 78 " testVar = \"Simple string, not a stock variable\";\n" 79 "};\n\n" 80 "new StaticShape()\n" 81 "{\n" 82 " dataBlock = \"BasicShapeData\";\n" 83 " position = \"0.0 0.0 0.0\";\n" 84 " rotation = \"1 0 0 0\";\n" 85 " scale = \"1 1 1\";\n" 86 "};\n" 87 "@endtsexample\n\n" 88 89 "@see StaticShape\n" 90 "@see ShapeBaseData\n" 91 "@see TSStatic\n\n" 92 93 "@ingroup gameObjects\n" 94 "@ingroup Datablocks"); 95 96StaticShapeData::StaticShapeData() 97{ 98 dynamicTypeField = 0; 99 100 shadowEnable = true; 101 102 noIndividualDamage = false; 103} 104 105StaticShapeData::StaticShapeData(const StaticShapeData& other, bool temp_clone) : ShapeBaseData(other, temp_clone) 106{ 107 noIndividualDamage = other.noIndividualDamage; 108 dynamicTypeField = other.dynamicTypeField; 109 isShielded = other.isShielded; // -- uninitialized, unused 110 energyPerDamagePoint = other.energyPerDamagePoint; // -- uninitialized, unused 111} 112 113void StaticShapeData::initPersistFields() 114{ 115 addField("noIndividualDamage", TypeBool, Offset(noIndividualDamage, StaticShapeData), "Deprecated\n\n @internal"); 116 addField("dynamicType", TypeS32, Offset(dynamicTypeField, StaticShapeData), 117 "@brief An integer value which, if speficied, is added to the value retured by getType().\n\n" 118 "This allows you to extend the type mask for a StaticShape that uses this datablock. Type masks " 119 "are used for container queries, etc."); 120 121 Parent::initPersistFields(); 122} 123 124void StaticShapeData::packData(BitStream* stream) 125{ 126 Parent::packData(stream); 127 stream->writeFlag(noIndividualDamage); 128 stream->write(dynamicTypeField); 129} 130 131void StaticShapeData::unpackData(BitStream* stream) 132{ 133 Parent::unpackData(stream); 134 noIndividualDamage = stream->readFlag(); 135 stream->read(&dynamicTypeField); 136} 137 138 139//---------------------------------------------------------------------------- 140 141IMPLEMENT_CO_NETOBJECT_V1(StaticShape); 142 143ConsoleDocClass( StaticShape, 144 "@brief The most basic 3D shape with a datablock available in Torque 3D.\n\n" 145 146 "When it comes to placing 3D objects in the scene, you technically have two options:\n\n" 147 "1. TSStatic objects\n\n" 148 "2. ShapeBase derived objects\n\n" 149 150 "Since ShapeBase and ShapeBaseData are not meant to be instantiated in script, you " 151 "will use one of its child classes instead. Several game related objects are derived " 152 "from ShapeBase: Player, Vehicle, Item, and so on.\n\n" 153 154 "When you need a 3D object with datablock capabilities, you will use an object derived " 155 "from ShapeBase. When you need an object with extremely low overhead, and with no other " 156 "purpose than to be a 3D object in the scene, you will use TSStatic.\n\n" 157 158 "The most basic child of ShapeBase is StaticShape. It does not introduce any of the " 159 "additional functionality you see in Player, Item, Vehicle or the other game play " 160 "heavy classes. At its core, it is comparable to a TSStatic, but with a datbalock. Having " 161 "a datablock provides a location for common variables as well as having access to " 162 "various ShapeBaseData, GameBaseData and SimDataBlock callbacks.\n\n" 163 164 "@tsexample\n" 165 "// Create a StaticShape using a datablock\n" 166 "datablock StaticShapeData(BasicShapeData)\n" 167 "{\n" 168 " shapeFile = \"art/shapes/items/kit/healthkit.dts\";\n" 169 " testVar = \"Simple string, not a stock variable\";\n" 170 "};\n\n" 171 "new StaticShape()\n" 172 "{\n" 173 " dataBlock = \"BasicShapeData\";\n" 174 " position = \"0.0 0.0 0.0\";\n" 175 " rotation = \"1 0 0 0\";\n" 176 " scale = \"1 1 1\";\n" 177 "};\n" 178 "@endtsexample\n\n" 179 180 "@see StaticShapeData\n" 181 "@see ShapeBase\n" 182 "@see TSStatic\n\n" 183 184 "@ingroup gameObjects\n"); 185 186StaticShape::StaticShape() 187{ 188 mTypeMask |= StaticShapeObjectType | StaticObjectType; 189 mDataBlock = 0; 190} 191 192StaticShape::~StaticShape() 193{ 194} 195 196 197//---------------------------------------------------------------------------- 198 199void StaticShape::initPersistFields() 200{ 201 Parent::initPersistFields(); 202} 203 204bool StaticShape::onAdd() 205{ 206 if(!Parent::onAdd() || !mDataBlock) 207 return false; 208 209 // We need to modify our type mask based on what our datablock says... 210 mTypeMask |= (mDataBlock->dynamicTypeField & sgAllowedDynamicTypes); 211 212 addToScene(); 213 214 if (isServerObject()) 215 scriptOnAdd(); 216 return true; 217} 218 219bool StaticShape::onNewDataBlock(GameBaseData* dptr, bool reload) 220{ 221 mDataBlock = dynamic_cast<StaticShapeData*>(dptr); 222 if (!mDataBlock || !Parent::onNewDataBlock(dptr, reload)) 223 return false; 224 225 scriptOnNewDataBlock(); 226 return true; 227} 228 229void StaticShape::onRemove() 230{ 231 scriptOnRemove(); 232 removeFromScene(); 233 Parent::onRemove(); 234} 235 236 237//---------------------------------------------------------------------------- 238 239void StaticShape::processTick(const Move* move) 240{ 241 Parent::processTick(move); 242 243 // Image Triggers 244 if (move && mDamageState == Enabled) { 245 setImageTriggerState(0,move->trigger[0]); 246 setImageTriggerState(1,move->trigger[1]); 247 } 248} 249 250void StaticShape::interpolateTick(F32 delta) 251{ 252 Parent::interpolateTick(delta); 253 // PATHSHAPE 254 updateRenderChangesByParent(); 255 // PATHSHAPE END 256} 257 258void StaticShape::setTransform(const MatrixF& mat) 259{ 260 Parent::setTransform(mat); 261 setMaskBits(PositionMask); 262} 263 264void StaticShape::onUnmount(SceneObject*,S32) 265{ 266 // Make sure the client get's the final server pos. 267 setMaskBits(PositionMask); 268} 269 270 271//---------------------------------------------------------------------------- 272 273U32 StaticShape::packUpdate(NetConnection *connection, U32 mask, BitStream *bstream) 274{ 275 U32 retMask = Parent::packUpdate(connection,mask,bstream); 276 if (bstream->writeFlag(mask & (PositionMask | ExtendedInfoMask))) 277 { 278 279 // Write the transform (do _not_ use writeAffineTransform. Since this is a static 280 // object, the transform must be RIGHT THE *&)*$&^ ON or it will goof up the 281 // synchronization between the client and the server. 282 mathWrite(*bstream,mObjToWorld); 283 mathWrite(*bstream, mObjScale); 284 } 285 286 // powered? 287 bstream->writeFlag(mPowered); 288 289 if (mLightPlugin) 290 { 291 retMask |= mLightPlugin->packUpdate(this, ExtendedInfoMask, connection, mask, bstream); 292 } 293 294 return retMask; 295} 296 297void StaticShape::unpackUpdate(NetConnection *connection, BitStream *bstream) 298{ 299 Parent::unpackUpdate(connection,bstream); 300 if (bstream->readFlag()) 301 { 302 MatrixF mat; 303 mathRead(*bstream,&mat); 304 Parent::setTransform(mat); 305 Parent::setRenderTransform(mat); 306 307 VectorF scale; 308 mathRead(*bstream, &scale); 309 setScale(scale); 310 } 311 312 // powered? 313 mPowered = bstream->readFlag(); 314 315 if (mLightPlugin) 316 { 317 mLightPlugin->unpackUpdate(this, connection, bstream); 318 } 319} 320 321 322//---------------------------------------------------------------------------- 323// This appears to be legacy T2 stuff 324// Marked internal, as this is flagged to be deleted 325// [8/1/2010 mperry] 326DefineEngineMethod( StaticShape, setPoweredState, void, (bool isPowered), , "(bool isPowered)" 327 "@internal") 328{ 329 if(!object->isServerObject()) 330 return; 331 object->setPowered(isPowered); 332} 333 334DefineEngineMethod( StaticShape, getPoweredState, bool, (), , "@internal") 335{ 336 if(!object->isServerObject()) 337 return(false); 338 return(object->isPowered()); 339} 340