afxPointLight_T3D.cpp
Engine/source/afx/ce/afxPointLight_T3D.cpp
Public Functions
ConsoleDocClass(afxT3DPointLightData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> dynamic Point <a href="/coding/file/shapebase_8h/#shapebase_8h_1a5dd6c7d5f77e2fb9e790a22a8677b5f3">Light</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Point <a href="/coding/file/shapebase_8h/#shapebase_8h_1a5dd6c7d5f77e2fb9e790a22a8677b5f3">Light</a> effect that uses the T3D <a href="/coding/class/classpointlight/">PointLight</a> object. <a href="/coding/class/classafxt3dpointlightdata/">afxT3DPointLightData</a> has the same fields found in <a href="/coding/class/classpointlight/">PointLight</a> but " "in <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock structure." "\<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 Functions
ConsoleDocClass(afxT3DPointLightData , "@brief A datablock that specifies <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> dynamic Point <a href="/coding/file/shapebase_8h/#shapebase_8h_1a5dd6c7d5f77e2fb9e790a22a8677b5f3">Light</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "A Point <a href="/coding/file/shapebase_8h/#shapebase_8h_1a5dd6c7d5f77e2fb9e790a22a8677b5f3">Light</a> effect that uses the T3D <a href="/coding/class/classpointlight/">PointLight</a> object. <a href="/coding/class/classafxt3dpointlightdata/">afxT3DPointLightData</a> has the same fields found in <a href="/coding/class/classpointlight/">PointLight</a> but " "in <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> datablock structure." "\<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(afxT3DPointLightData )
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/afxPointLight_T3D.h" 33 34//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 35// afxT3DPointLightData 36 37IMPLEMENT_CO_DATABLOCK_V1(afxT3DPointLightData); 38 39ConsoleDocClass( afxT3DPointLightData, 40 "@brief A datablock that specifies a dynamic Point Light effect.\n\n" 41 42 "A Point Light effect that uses the T3D PointLight object. afxT3DPointLightData has the same fields found in PointLight but " 43 "in a datablock structure." 44 "\n\n" 45 46 "@ingroup afxEffects\n" 47 "@ingroup AFX\n" 48 "@ingroup Datablocks\n" 49); 50 51afxT3DPointLightData::afxT3DPointLightData() 52 : mRadius( 5.0f ) 53{ 54} 55 56afxT3DPointLightData::afxT3DPointLightData(const afxT3DPointLightData& other, bool temp_clone) : afxT3DLightBaseData(other, temp_clone) 57{ 58 mRadius = other.mRadius; 59} 60 61// 62// NOTE: keep this as consistent as possible with PointLight::initPersistFields() 63// 64void afxT3DPointLightData::initPersistFields() 65{ 66 addGroup( "Light" ); 67 68 addField( "radius", TypeF32, Offset( mRadius, afxT3DPointLightData ), 69 "Controls the falloff of the light emission"); 70 71 endGroup( "Light" ); 72 73 // We do the parent fields at the end so that 74 // they show up that way in the inspector. 75 Parent::initPersistFields(); 76 77 // Remove the scale field... it's already 78 // defined by the light radius. 79 removeField( "scale" ); 80} 81 82bool afxT3DPointLightData::onAdd() 83{ 84 if (Parent::onAdd() == false) 85 return false; 86 87 return true; 88} 89 90void afxT3DPointLightData::packData(BitStream* stream) 91{ 92 Parent::packData(stream); 93 94 stream->write( mRadius ); 95} 96 97void afxT3DPointLightData::unpackData(BitStream* stream) 98{ 99 Parent::unpackData(stream); 100 101 stream->read( &mRadius ); 102} 103 104//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// 105