Torque3D Documentation / _generateds / afxCollisionEvent.cpp

afxCollisionEvent.cpp

Engine/source/afx/ce/afxCollisionEvent.cpp

More...

Public Defines

define
myOffset(field) (field, )

Public Functions

ConsoleDocClass(afxCollisionEventData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/structcollision/">Collision</a> Event <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "MORE NEEDED <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">HERE.\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )

Detailed Description

Public Defines

myOffset(field) (field, )

Public Functions

ConsoleDocClass(afxCollisionEventData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/structcollision/">Collision</a> Event <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "MORE NEEDED <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">HERE.\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )

IMPLEMENT_CO_DATABLOCK_V1(afxCollisionEventData )

  1
  2
  3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  5// Copyright (C) 2015 Faust Logic, Inc.
  6//
  7// Permission is hereby granted, free of charge, to any person obtaining a copy
  8// of this software and associated documentation files (the "Software"), to
  9// deal in the Software without restriction, including without limitation the
 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 11// sell copies of the Software, and to permit persons to whom the Software is
 12// furnished to do so, subject to the following conditions:
 13//
 14// The above copyright notice and this permission notice shall be included in
 15// all copies or substantial portions of the Software.
 16//
 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 23// IN THE SOFTWARE.
 24//
 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 26
 27#include "afx/arcaneFX.h"
 28
 29#include "console/consoleTypes.h"
 30#include "core/stream/bitStream.h"
 31
 32#include "afx/ce/afxCollisionEvent.h"
 33
 34//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 35// afxCollisionEventData
 36
 37IMPLEMENT_CO_DATABLOCK_V1(afxCollisionEventData);
 38
 39ConsoleDocClass( afxCollisionEventData,
 40   "@brief A datablock that specifies a Collision Event effect.\n\n"
 41
 42   "MORE NEEDED HERE.\n"
 43
 44   "@ingroup afxEffects\n"
 45   "@ingroup AFX\n"
 46   "@ingroup Datablocks\n"
 47);
 48
 49afxCollisionEventData::afxCollisionEventData()
 50{
 51  method_name = ST_NULLSTRING;
 52  script_data = ST_NULLSTRING;
 53  gen_trigger = false;
 54  trigger_bit = 0;
 55}
 56
 57afxCollisionEventData::afxCollisionEventData(const afxCollisionEventData& other, bool temp_clone) : GameBaseData(other, temp_clone)
 58{
 59  method_name = other.method_name;
 60  script_data = other.script_data;
 61  gen_trigger = other.gen_trigger;
 62  trigger_bit = other.trigger_bit;
 63}
 64
 65#define myOffset(field) Offset(field, afxCollisionEventData)
 66
 67void afxCollisionEventData::initPersistFields()
 68{
 69  addField("methodName",        TypeString,   myOffset(method_name),
 70    "...");
 71  addField("scriptData",        TypeString,   myOffset(script_data),
 72    "...");
 73  addField("generateTrigger",   TypeBool,     myOffset(gen_trigger),
 74    "...");
 75  addField("triggerBit",        TypeS8,       myOffset(trigger_bit),
 76    "...");
 77
 78  Parent::initPersistFields();
 79}
 80
 81void afxCollisionEventData::packData(BitStream* stream)
 82{
 83  Parent::packData(stream);
 84
 85  stream->writeString(method_name);
 86  stream->writeString(script_data);
 87  if (stream->writeFlag(gen_trigger))
 88    stream->write(trigger_bit);
 89}
 90
 91void afxCollisionEventData::unpackData(BitStream* stream)
 92{
 93  Parent::unpackData(stream);
 94
 95  method_name = stream->readSTString();
 96  script_data = stream->readSTString();
 97  gen_trigger = stream->readFlag();
 98  if (gen_trigger)
 99    stream->read(&trigger_bit);
100  else
101    trigger_bit = 0;
102}
103
104//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
105