afxFootSwitch.cpp
Engine/source/afx/ce/afxFootSwitch.cpp
Public Defines
define
myOffset(field) (field, )
Public Functions
ConsoleDocClass(afxFootSwitchData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Foot Switch <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Foot Switch effect is used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> disable some or all of the standard built-in footstep effects generated by <a href="/coding/class/classplayer/">Player</a> objects." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "Stock <a href="/coding/class/classplayer/">Player</a> objects generate footprint decals, footstep sounds, and puffs of particle dust in response <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> special " "animation triggers embedded in the <a href="/coding/class/classplayer/">Player</a> 's dts model. With the help of Phase Effects, AFX can substitute alternatives <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> " "these built-in effects. When this is done, it is often preferable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> turn off some or all of the built-in footstep effects." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "Foot Switch effects are only meaningful when the primary position constraint is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classplayer/">Player</a> or <a href="/coding/class/classplayer/">Player</a>-derived object." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\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(afxFootSwitchData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Foot Switch <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Foot Switch effect is used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> disable some or all of the standard built-in footstep effects generated by <a href="/coding/class/classplayer/">Player</a> objects." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "Stock <a href="/coding/class/classplayer/">Player</a> objects generate footprint decals, footstep sounds, and puffs of particle dust in response <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> special " "animation triggers embedded in the <a href="/coding/class/classplayer/">Player</a> 's dts model. With the help of Phase Effects, AFX can substitute alternatives <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> " "these built-in effects. When this is done, it is often preferable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> turn off some or all of the built-in footstep effects." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "Foot Switch effects are only meaningful when the primary position constraint is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classplayer/">Player</a> or <a href="/coding/class/classplayer/">Player</a>-derived object." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\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(afxFootSwitchData )
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/afxFootSwitch.h" 33 34//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 35// afxFootSwitchData 36 37IMPLEMENT_CO_DATABLOCK_V1(afxFootSwitchData); 38 39ConsoleDocClass( afxFootSwitchData, 40 "@brief A datablock that specifies a Foot Switch effect.\n\n" 41 42 "A Foot Switch effect is used to disable some or all of the standard built-in footstep effects generated by Player objects." 43 "\n\n" 44 45 "Stock Player objects generate footprint decals, footstep sounds, and puffs of particle dust in response to special " 46 "animation triggers embedded in the Player's dts model. With the help of Phase Effects, AFX can substitute alternatives for " 47 "these built-in effects. When this is done, it is often preferable to turn off some or all of the built-in footstep effects." 48 "\n\n" 49 50 "Foot Switch effects are only meaningful when the primary position constraint is a Player or Player-derived object." 51 "\n\n" 52 53 "@ingroup afxEffects\n" 54 "@ingroup AFX\n" 55 "@ingroup Datablocks\n" 56); 57 58afxFootSwitchData::afxFootSwitchData() 59{ 60 override_all = false; 61 override_decals = false; 62 override_sounds = false; 63 override_dust = false; 64} 65 66afxFootSwitchData::afxFootSwitchData(const afxFootSwitchData& other, bool temp_clone) : GameBaseData(other, temp_clone) 67{ 68 override_all = other.override_all; 69 override_decals = other.override_decals; 70 override_sounds = other.override_sounds; 71 override_dust = other.override_dust; 72} 73 74#define myOffset(field) Offset(field, afxFootSwitchData) 75 76void afxFootSwitchData::initPersistFields() 77{ 78 addField("overrideAll", TypeBool, myOffset(override_all), 79 "When true, all of a Player's footstep effects are turned off for the duration of " 80 "the foot-switch effect."); 81 addField("overrideDecals", TypeBool, myOffset(override_decals), 82 "Specifically selects whether the Player's footprint decals are enabled."); 83 addField("overrideSounds", TypeBool, myOffset(override_sounds), 84 "Specifically selects whether the Player's footstep sounds are enabled."); 85 addField("overrideDust", TypeBool, myOffset(override_dust), 86 "Specifically selects whether the Player's footstep puffs of dust are enabled."); 87 88 Parent::initPersistFields(); 89} 90 91void afxFootSwitchData::packData(BitStream* stream) 92{ 93 Parent::packData(stream); 94 95 if (!stream->writeFlag(override_all)) 96 { 97 stream->writeFlag(override_decals); 98 stream->writeFlag(override_sounds); 99 stream->writeFlag(override_dust); 100 } 101} 102 103void afxFootSwitchData::unpackData(BitStream* stream) 104{ 105 Parent::unpackData(stream); 106 107 override_all = stream->readFlag(); 108 if (!override_all) 109 { 110 override_decals = stream->readFlag(); 111 override_sounds = stream->readFlag(); 112 override_dust = stream->readFlag(); 113 } 114} 115 116 117//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 118