afxPhysicalZone.cpp
Engine/source/afx/ce/afxPhysicalZone.cpp
Public Defines
define
myOffset(field) (field, )
Public Functions
ConsoleDocClass(afxPhysicalZoneData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classphysicalzone/">PhysicalZone</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Physical <a href="/coding/class/classzone/">Zone</a> is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Torque effect that applies physical forces <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> Players and other movable objects that enter <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> specific " "region of influence. AFX has enhanced Physical Zones by allowing orientation of vector forces and adding radial forces. " "AFX has also optimized Physical <a href="/coding/class/classzone/">Zone</a> networking so that they can be constrained <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> moving objects <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> variety of " "effects including repelling and flying." "\<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(afxPhysicalZoneData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/class/classphysicalzone/">PhysicalZone</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Physical <a href="/coding/class/classzone/">Zone</a> is <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> Torque effect that applies physical forces <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> Players and other movable objects that enter <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> specific " "region of influence. AFX has enhanced Physical Zones by allowing orientation of vector forces and adding radial forces. " "AFX has also optimized Physical <a href="/coding/class/classzone/">Zone</a> networking so that they can be constrained <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> moving objects <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> variety of " "effects including repelling and flying." "\<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(afxPhysicalZoneData )
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 "T3D/physicalZone.h" 30 31#include "afx/ce/afxPhysicalZone.h" 32 33//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 34//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 35// afxPhysicalZoneData 36 37IMPLEMENT_CO_DATABLOCK_V1(afxPhysicalZoneData); 38 39ConsoleDocClass( afxPhysicalZoneData, 40 "@brief A datablock that specifies a PhysicalZone effect.\n\n" 41 42 "A Physical Zone is a Torque effect that applies physical forces to Players and other movable objects that enter a specific " 43 "region of influence. AFX has enhanced Physical Zones by allowing orientation of vector forces and adding radial forces. " 44 "AFX has also optimized Physical Zone networking so that they can be constrained to moving objects for a variety of " 45 "effects including repelling and flying." 46 "\n\n" 47 48 "@ingroup afxEffects\n" 49 "@ingroup AFX\n" 50 "@ingroup Datablocks\n" 51); 52 53afxPhysicalZoneData::afxPhysicalZoneData() 54{ 55 mVelocityMod = 1.0f; 56 mGravityMod = 1.0f; 57 mAppliedForce.zero(); 58 mPolyhedron = ST_NULLSTRING; 59 force_type = PhysicalZone::VECTOR; 60 orient_force = false; 61 exclude_cons_obj = false; 62} 63 64afxPhysicalZoneData::afxPhysicalZoneData(const afxPhysicalZoneData& other, bool temp_clone) : GameBaseData(other, temp_clone) 65{ 66 mVelocityMod = other.mVelocityMod; 67 mGravityMod = other.mGravityMod; 68 mAppliedForce = other.mAppliedForce; 69 mPolyhedron = other.mPolyhedron; 70 force_type = other.force_type; 71 orient_force = other.orient_force; 72 exclude_cons_obj = other.exclude_cons_obj; 73} 74 75#define myOffset(field) Offset(field, afxPhysicalZoneData) 76 77void afxPhysicalZoneData::initPersistFields() 78{ 79 addField("velocityMod", TypeF32, myOffset(mVelocityMod), 80 "A multiplier that biases the velocity of an object every tick it is within the " 81 "zone."); 82 addField("gravityMod", TypeF32, myOffset(mGravityMod), 83 "A multiplier that biases the influence of gravity on objects within the zone."); 84 addField("appliedForce", TypePoint3F, myOffset(mAppliedForce), 85 "A three-valued vector representing a directional force applied to objects withing " 86 "the zone."); 87 addField("polyhedron", TypeString, myOffset(mPolyhedron), 88 "Floating point values describing the outer bounds of the PhysicalZone's region of " 89 "influence."); 90 91 addField("forceType", TYPEID<PhysicalZone::ForceType>(), myOffset(force_type), 92 "This enumerated attribute defines the type of force used in the PhysicalZone. " 93 "Possible values: vector, sphere, or cylinder."); 94 95 addField("orientForce", TypeBool, myOffset(orient_force), 96 "Determines if the force can be oriented by the PhysicalZone's transform matrix."); 97 addField("excludeConstraintObject", TypeBool, myOffset(exclude_cons_obj), 98 "When true, an object used as the primary position constraint of a physical-zone " 99 "effect will not be influenced by the forces of the zone."); 100 101 Parent::initPersistFields(); 102} 103 104void afxPhysicalZoneData::packData(BitStream* stream) 105{ 106 Parent::packData(stream); 107} 108 109void afxPhysicalZoneData::unpackData(BitStream* stream) 110{ 111 Parent::unpackData(stream); 112} 113 114 115//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 116