Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
eae9fc3
Added steering centre members to VehicleData.
crabmusket Oct 2, 2012
e3cb30b
Added steering return to Vehicle.
crabmusket Oct 2, 2012
b097c76
Fixed stream read/write mismatch bug.
crabmusket Oct 2, 2012
75baf20
Send back RayInfo distance with ContainerRayCast
Haulien Oct 6, 2012
ac9d24d
Doc changes for RayInfo distance
Haulien Oct 6, 2012
5b033f7
BitVector don't have copy-constructor/operator=
Oct 6, 2012
c6b6ffc
For for Issue #106 Convex Shape Bandwidth
DavidWyand-GG Nov 5, 2012
e363c6e
Merge pull request #107 from DavidWyand-GG/issue106-ConvexShapeBandwidth
DavidWyand-GG Nov 5, 2012
956f304
Fix for Issue #108 Turret Heading Node
DavidWyand-GG Nov 5, 2012
70415d0
Merge pull request #109 from DavidWyand-GG/issue108-TurretHeadingNode
DavidWyand-GG Nov 5, 2012
1a35014
Fix for Issue #111 for BitStream Issues
DavidWyand-GG Nov 5, 2012
38f908f
Merge pull request #112 from DavidWyand-GG/issue111-BitStreamIssues
DavidWyand-GG Nov 5, 2012
e7beec9
Fix for Issue #110 for Particle Emitter Ejection
DavidWyand-GG Nov 5, 2012
028ea19
Merge pull request #113 from DavidWyand-GG/issue110-ParticleEmitterEj…
DavidWyand-GG Nov 5, 2012
d6b85a2
Fix for Issue #114 for Footstep Sounds
DavidWyand-GG Nov 6, 2012
942b1c3
Merge pull request #115 from DavidWyand-GG/issue114-FootStepSounds
DavidWyand-GG Nov 6, 2012
b085a76
Fix for Issue #116 for Crash with unicode
DavidWyand-GG Nov 6, 2012
5f4edf8
Merge pull request #117 from DavidWyand-GG/issue116-CrashWithUnicode
DavidWyand-GG Nov 6, 2012
05b3a32
Fix for Issue #118 for Collada Importer Materials
DavidWyand-GG Nov 8, 2012
cd8bca4
Merge pull request #119 from DavidWyand-GG/issue118-ColladaMaterials
DavidWyand-GG Nov 8, 2012
deba1b3
Fix for Issue #120 for Inverted ArrayObject Sort
DavidWyand-GG Nov 8, 2012
a6d86a1
Merge pull request #121 from DavidWyand-GG/issue120-InvertedArrayObje…
DavidWyand-GG Nov 8, 2012
dc25f17
Fix for Issue #122 for Material Sounds
DavidWyand-GG Nov 8, 2012
aa3a6d5
Merge pull request #123 from DavidWyand-GG/issue122-MaterialSounds
DavidWyand-GG Nov 8, 2012
0047842
Fix for Issue #124 for CustomMaterial Refraction
DavidWyand-GG Nov 8, 2012
2291451
Merge pull request #125 from DavidWyand-GG/issue124-CustomMaterialRef…
DavidWyand-GG Nov 8, 2012
e9b1ec5
Fix for Issue #126 for TCPObject Bad Connect
DavidWyand-GG Nov 8, 2012
4290c1d
Merge pull request #127 from DavidWyand-GG/issue126-TCPObjectBadConnect
DavidWyand-GG Nov 8, 2012
88bb577
Fix for Issue #128 for Player First Person Shadow
DavidWyand-GG Nov 8, 2012
9a76293
Merge pull request #129 from DavidWyand-GG/issue128-SoldierFPShadow
DavidWyand-GG Nov 8, 2012
a803398
Fix for Issue #130 for Decals and Smoothing Groups
DavidWyand-GG Nov 8, 2012
74cbcb3
Merge pull request #131 from DavidWyand-GG/issue130-DecalSmoothingGroups
DavidWyand-GG Nov 8, 2012
6637948
Fix for Issue #132 for RenderOcclusionMgr Rendering
DavidWyand-GG Nov 8, 2012
34db24a
Merge pull request #133 from DavidWyand-GG/issue132-RenderOcclusionMg…
DavidWyand-GG Nov 8, 2012
2089239
Fix for Issue #134 for VS2010 RC Files
DavidWyand-GG Nov 8, 2012
e2f0404
Merge pull request #135 from DavidWyand-GG/issue134-VS2010RCFiles
DavidWyand-GG Nov 8, 2012
cfb90f3
Fix for Issue #136 for Zoning Bug
DavidWyand-GG Nov 8, 2012
1af290b
Merge pull request #137 from DavidWyand-GG/issue136-ZoningBug
DavidWyand-GG Nov 8, 2012
2a6a177
Fix for Issue #138 for guiArrayCtrl Fix
DavidWyand-GG Nov 8, 2012
b465cae
Merge pull request #139 from DavidWyand-GG/issue138-GuiArrayCtrlFix
DavidWyand-GG Nov 8, 2012
9ebc6ec
Merge branch 'development' of https://github.com/BoomBox/Torque3D int…
DavidWyand-GG Nov 9, 2012
df01dd8
Merge branch 'BitVector_copy_constructor' of https://github.com/Luis-…
DavidWyand-GG Nov 9, 2012
88cc412
Reformatted code for Pull Request #71
DavidWyand-GG Nov 9, 2012
093252a
Updated logic in MissionArea::getServerObject.
crabmusket Nov 13, 2012
e65d404
Work for Issue #141 for Remove Toolbox
DavidWyand-GG Nov 13, 2012
9c343d1
Merge pull request #142 from DavidWyand-GG/issue141-RemoveToolbox
DavidWyand-GG Nov 13, 2012
fa1a012
Merge branch 'healthtexthud' of https://github.com/T3DCE/CE-OSLab int…
DavidWyand-GG Nov 15, 2012
e5b64aa
New gitignore for Project Manager
DavidWyand-GG Nov 23, 2012
7368dc2
Merge pull request #151 from DavidWyand-GG/gitignore-ProjectManager
DavidWyand-GG Nov 23, 2012
a2466bf
Fix for Issue #152 for Unmatch Bitstream
DavidWyand-GG Nov 23, 2012
f9cb217
Merge pull request #153 from DavidWyand-GG/issue152-UnmatchedBitstream
DavidWyand-GG Nov 23, 2012
5951195
Fix for Issue #155 for Billboard Creation
DavidWyand-GG Nov 26, 2012
70b95d6
Merge pull request #156 from DavidWyand-GG/issue155-BillboardCreation
DavidWyand-GG Nov 26, 2012
4a11d54
Partial revert of changes from Pull #125
DavidWyand-GG Nov 26, 2012
a98dfb9
Merge pull request #158 from DavidWyand-GG/issue124-RevertMaterialCha…
DavidWyand-GG Nov 26, 2012
0598b6a
Fix for Issue #166 for Client Not Loading
DavidWyand-GG Dec 10, 2012
37f44a6
Merge pull request #167 from DavidWyand-GG/issue166-ClientNotLoading
DavidWyand-GG Dec 10, 2012
5dd5814
Fix for Issue #170 Asset loading under Linux
DavidWyand-GG Dec 12, 2012
6f56dcf
Merge pull request #171 from DavidWyand-GG/issue170-AssetLoadLinux
DavidWyand-GG Dec 12, 2012
63b8c27
Fix for Issue #172 for Turret Crash on Dedicated Server
DavidWyand-GG Dec 13, 2012
20b1d1f
Merge pull request #173 from DavidWyand-GG/issue172-DedicatedTurretCrash
DavidWyand-GG Dec 13, 2012
539fa70
Fix for Issue 174 for Turret Targeting Wrong Direction
DavidWyand-GG Dec 14, 2012
60a13ca
Merge pull request #175 from DavidWyand-GG/issue174-TurretTargetWrong
DavidWyand-GG Dec 14, 2012
ee0018c
Merge branch 'master' into development
DavidWyand-GG Dec 14, 2012
440103e
Removal of SDL dependency for linux dedicated server
timmgt Dec 15, 2012
0d3a0f8
Bug fix for loading compiled dsos
timmgt Dec 15, 2012
358412f
New readme for v2.0
DavidWyand-GG Dec 18, 2012
455efbe
Merge pull request #182 from DavidWyand-GG/docs-2.0
DavidWyand-GG Dec 18, 2012
4cebb0c
Merge branch 'dedsdlchanges' of https://github.com/timmgt/Torque3D in…
DavidWyand-GG Jan 7, 2013
1d4b723
Removed MGT comments from Pull Request
DavidWyand-GG Jan 7, 2013
0b3e9d7
Merge pull request #179 from timmgt/dsocompilebugfix
thecelloman Jan 9, 2013
03211bc
Merge pull request #140 from eightyeight/missionarea-server-object
thecelloman Jan 9, 2013
b2e2c7b
Merge pull request #49 from eightyeight/vehicle-steering
thecelloman Jan 11, 2013
48c64db
Fix for Issue_190
skaughtx0r Jan 3, 2013
35082e9
Fix for Issue #214
DavidWyand-GG Jan 22, 2013
c2ae9de
Merge pull request #215 from DavidWyand-GG/issue214-JoystickPOV2
DavidWyand-GG Jan 22, 2013
e4ad890
Expanded signals and journaled signals to support up to 13 parameters
DavidWyand-GG Jan 22, 2013
1d4ed1d
Merge pull request #216 from DavidWyand-GG/ExpandedSignals
DavidWyand-GG Jan 22, 2013
b56f867
New ScriptTickObject
DavidWyand-GG Jan 22, 2013
f43e878
Merge pull request #217 from DavidWyand-GG/ScriptTickObject
DavidWyand-GG Jan 22, 2013
af7787b
New console type for Point3I
DavidWyand-GG Jan 22, 2013
5d6751c
Merge pull request #218 from DavidWyand-GG/ConsoleTypePoint3I
DavidWyand-GG Jan 22, 2013
539efcb
Input event changes
DavidWyand-GG Jan 22, 2013
c7769f0
Merge pull request #219 from DavidWyand-GG/InputEventManager
DavidWyand-GG Jan 22, 2013
0e87a8b
New RigidShape method to force client
DavidWyand-GG Jan 22, 2013
404cffc
Merge pull request #220 from DavidWyand-GG/RigidShapeChanges
DavidWyand-GG Jan 22, 2013
35374f9
ExtendedMove class and support
DavidWyand-GG Jan 23, 2013
2112878
Merge pull request #221 from DavidWyand-GG/ExtendedMove
DavidWyand-GG Jan 23, 2013
32a3bab
Moved platform input event files under new input directory
DavidWyand-GG Jan 23, 2013
4edcb60
Merge pull request #222 from DavidWyand-GG/MovePlatformInputEvent
DavidWyand-GG Jan 23, 2013
b04f060
Added support for debug and ignored libraries
skaughtx0r Dec 21, 2012
ecb592b
Merge branch 'skaughtx0r-master' into development
DavidWyand-GG Jan 23, 2013
6105849
Leap Motion input device support
DavidWyand-GG Jan 23, 2013
27a81f9
Merge pull request #223 from DavidWyand-GG/LeapMotionSupport
DavidWyand-GG Jan 23, 2013
447af86
CE AS_OPTIMIZATIONS_STAGE2
josh-leeming Jan 30, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,7 @@ pip-log.txt
console.log
*.cached.dts
!Engine/bin
My Projects/
My Projects/
Project Manager.exe
projects.xml
Qt*.dll
32 changes: 26 additions & 6 deletions Engine/source/T3D/convexShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,14 @@ void ConvexShape::writeFields( Stream &stream, U32 tabStop )

stream.write(2, "\r\n");

for ( U32 i = 0; i < mSurfaces.size(); i++ )
S32 count = mSurfaces.size();
if ( count > smMaxSurfaces )
{
Con::errorf( "ConvexShape has too many surfaces to save! Truncated value %d to maximum value of %d", count, smMaxSurfaces );
count = smMaxSurfaces;
}

for ( U32 i = 0; i < count; i++ )
{
const MatrixF &mat = mSurfaces[i];

Expand Down Expand Up @@ -423,12 +430,18 @@ U32 ConvexShape::packUpdate( NetConnection *conn, U32 mask, BitStream *stream )
if ( stream->writeFlag( mask & UpdateMask ) )
{
stream->write( mMaterialName );

const U32 surfCount = mSurfaces.size();
U32 surfCount = mSurfaces.size();
stream->writeInt( surfCount, 32 );

for ( S32 i = 0; i < surfCount; i++ )
mathWrite( *stream, mSurfaces[i] );
for ( S32 i = 0; i < surfCount; i++ )
{
QuatF quat( mSurfaces[i] );
Point3F pos( mSurfaces[i].getPosition() );

mathWrite( *stream, quat );
mathWrite( *stream, pos );
}
}

return retMask;
Expand Down Expand Up @@ -462,7 +475,14 @@ void ConvexShape::unpackUpdate( NetConnection *conn, BitStream *stream )
mSurfaces.increment();
MatrixF &mat = mSurfaces.last();

mathRead( *stream, &mat );
QuatF quat;
Point3F pos;

mathRead( *stream, &quat );
mathRead( *stream, &pos );

quat.setMatrix( &mat );
mat.setPosition( pos );
}

if ( isProperlyAdded() )
Expand Down
4 changes: 4 additions & 0 deletions Engine/source/T3D/convexShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ class ConvexShape : public SceneObject

static bool smRenderEdges;

// To prevent bitpack overflows.
// This is only indirectly enforced by trucation when serializing.
static const S32 smMaxSurfaces = 100;

public:

ConvexShape();
Expand Down
200 changes: 200 additions & 0 deletions Engine/source/T3D/fps/guiHealthTextHud.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------

// ----------------------------------------------------------------------------
// A gui control that displays health or energy information. Based upon the
// stock healthBar control but rewritten by M.Hall to display a numerical value.
// ----------------------------------------------------------------------------

#include "platform/platform.h"
#include "gui/core/guiControl.h"
#include "console/consoleTypes.h"
#include "T3D/gameBase/gameConnection.h"
#include "T3D/shapeBase.h"
#include "gfx/gfxDrawUtil.h"

class GuiHealthTextHud : public GuiControl
{
typedef GuiControl Parent;

bool mShowFrame;
bool mShowFill;
bool mShowEnergy;
bool mShowTrueHealth;

ColorF mFillColor;
ColorF mFrameColor;
ColorF mTextColor;
ColorF mWarnColor;

F32 mWarnLevel;
F32 mPulseThreshold;
S32 mPulseRate;

F32 mValue;

public:
GuiHealthTextHud();

void onRender(Point2I, const RectI &);
static void initPersistFields();
DECLARE_CONOBJECT(GuiHealthTextHud);
DECLARE_CATEGORY("Gui Game");
DECLARE_DESCRIPTION("Shows the damage or energy level of the current\n"
"PlayerObjectType control object as a numerical text display.");
};

// ----------------------------------------------------------------------------

IMPLEMENT_CONOBJECT(GuiHealthTextHud);

ConsoleDocClass(GuiHealthTextHud,
"@brief Shows the health or energy value of the current PlayerObjectType control object.\n\n"
"This gui can be configured to display either the health or energy value of the current Player Object. "
"It can use an alternate display color if the health or drops below a set value. "
"It can also be set to pulse if the health or energy drops below a set value. "
"This control only works if a server connection exists and it's control object "
"is a PlayerObjectType. If either of these requirements is false, the control is not rendered.\n\n"

"@tsexample\n"
"\n new GuiHealthTextHud()"
"{\n"
" fillColor = \"0.0 0.0 0.0 0.5\"; // Fills with a transparent black color\n"
" frameColor = \"1.0 1.0 1.0 1.0\"; // Solid white frame color\n"
" textColor = \"0.0 1.0 0.0 1.0\" // Solid green text color\n"
" warningColor = \"1.0 0.0 0.0 1.0\"; // Solid red color, used when damaged\n"
" showFill = \"true\";\n"
" showFrame = \"true\";\n"
" showTrueValue = \"false\";\n"
" showEnergy = \"false\";\n"
" warnThreshold = \"50\";\n"
" pulseThreshold = \"25\";\n"
" pulseRate = \"500\";\n"
" profile = \"GuiBigTextProfile\";\n"
"};\n"
"@endtsexample\n\n"

"@ingroup GuiGame\n"
);

GuiHealthTextHud::GuiHealthTextHud()
{
mShowFrame = mShowFill = true;
mShowEnergy = false;
mShowTrueHealth = false;

mFillColor.set(0, 0, 0, 0.5);
mFrameColor.set(1, 1, 1, 1);
mTextColor.set(0, 1, 0, 1);
mWarnColor.set(1, 0, 0, 1);

mWarnLevel = 50.0f;
mPulseThreshold = 25.0f;
mPulseRate = 0;

mValue = 0.2f;
}

void GuiHealthTextHud::initPersistFields()
{
addGroup("Colors");
addField("fillColor", TypeColorF, Offset(mFillColor, GuiHealthTextHud), "Color for the background of the control.");
addField("frameColor", TypeColorF, Offset(mFrameColor, GuiHealthTextHud), "Color for the control's frame.");
addField("textColor", TypeColorF, Offset(mTextColor, GuiHealthTextHud), "Color for the text on this control.");
addField("warningColor", TypeColorF, Offset(mWarnColor, GuiHealthTextHud), "Color for the text when health is low.");
endGroup("Colors");

addGroup("View");
addField("showFill", TypeBool, Offset(mShowFill, GuiHealthTextHud), "If true, draw the background.");
addField("showFrame", TypeBool, Offset(mShowFrame, GuiHealthTextHud), "If true, draw the frame.");
addField("showTrueValue", TypeBool, Offset(mShowTrueHealth, GuiHealthTextHud), "If true, we don't hardcode maxHealth to 100.");
addField("showEnergy", TypeBool, Offset(mShowEnergy, GuiHealthTextHud), "If true, display the energy value rather than the damage value.");
endGroup("View");

addGroup("Alert");
addField("warnThreshold", TypeF32, Offset(mWarnLevel, GuiHealthTextHud), "The health level at which to use the warningColor.");
addField("pulseThreshold", TypeF32, Offset(mPulseThreshold, GuiHealthTextHud), "Health level at which to begin pulsing.");
addField("pulseRate", TypeS32, Offset(mPulseRate, GuiHealthTextHud), "Speed at which the control will pulse.");
endGroup("Alert");

Parent::initPersistFields();
}

// ----------------------------------------------------------------------------

void GuiHealthTextHud::onRender(Point2I offset, const RectI &updateRect)
{
// Must have a connection and player control object
GameConnection* conn = GameConnection::getConnectionToServer();
if (!conn)
return;
ShapeBase* control = dynamic_cast<ShapeBase*>(conn->getControlObject());
if (!control || !(control->getTypeMask() & PlayerObjectType))
return;

// Just grab the damage/energy right off the control object.
// Damage value 0 = no damage (full health).
if(mShowEnergy)
mValue = control->getEnergyLevel();
else
{
if (mShowTrueHealth)
mValue = control->getMaxDamage() - control->getDamageLevel();
else
mValue = 100 - (100 * control->getDamageValue());
}

// If enabled draw background first
if (mShowFill)
GFX->getDrawUtil()->drawRectFill(updateRect, mFillColor);

// Prepare text and center it
S32 val = (S32)mValue;
char buf[256];
dSprintf(buf, sizeof(buf), "%d", val);
offset.x += (getBounds().extent.x - mProfile->mFont->getStrWidth((const UTF8 *)buf)) / 2;
offset.y += (getBounds().extent.y - mProfile->mFont->getHeight()) / 2;

ColorF tColor = mTextColor;

// If warning level is exceeded switch to warning color
if(mValue < mWarnLevel)
{
tColor = mWarnColor;

// If the pulseRate is set then pulse the text if health is below the threshold
if (mPulseRate != 0 && mValue < mPulseThreshold)
{
U32 time = Platform::getVirtualMilliseconds();
F32 alpha = 2.0f * F32(time % mPulseRate) / F32(mPulseRate);
tColor.alpha = (alpha > 1.0f)? 2.0f - alpha: alpha;
}
}

GFX->getDrawUtil()->setBitmapModulation(tColor);
GFX->getDrawUtil()->drawText(mProfile->mFont, offset, buf);
GFX->getDrawUtil()->clearBitmapModulation();

// If enabled draw the border last
if (mShowFrame)
GFX->getDrawUtil()->drawRect(updateRect, mFrameColor);
}
7 changes: 4 additions & 3 deletions Engine/source/T3D/fx/particle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
//-----------------------------------------------------------------------------
#include "particle.h"
#include "console/consoleTypes.h"
#include "console/typeValidators.h"
#include "core/stream/bitStream.h"
#include "math/mRandom.h"
#include "math/mathIO.h"
Expand Down Expand Up @@ -132,13 +133,13 @@ ParticleData::~ParticleData()
//-----------------------------------------------------------------------------
void ParticleData::initPersistFields()
{
addField( "dragCoefficient", TYPEID< F32 >(), Offset(dragCoefficient, ParticleData),
addFieldV( "dragCoefficient", TYPEID< F32 >(), Offset(dragCoefficient, ParticleData), new FRangeValidator(0, 5),
"Particle physics drag amount." );
addField( "windCoefficient", TYPEID< F32 >(), Offset(windCoefficient, ParticleData),
"Strength of wind on the particles." );
addField( "gravityCoefficient", TYPEID< F32 >(), Offset(gravityCoefficient, ParticleData),
addFieldV( "gravityCoefficient", TYPEID< F32 >(), Offset(gravityCoefficient, ParticleData), new FRangeValidator(-10, 10),
"Strength of gravity on the particles." );
addField( "inheritedVelFactor", TYPEID< F32 >(), Offset(inheritedVelFactor, ParticleData),
addFieldV( "inheritedVelFactor", TYPEID< F32 >(), Offset(inheritedVelFactor, ParticleData), &CommonValidators::NormalizedFloat,
"Amount of emitter velocity to add to particle initial velocity." );
addField( "constantAcceleration", TYPEID< F32 >(), Offset(constantAcceleration, ParticleData),
"Constant acceleration to apply to this particle." );
Expand Down
27 changes: 14 additions & 13 deletions Engine/source/T3D/fx/particleEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "scene/sceneManager.h"
#include "scene/sceneRenderState.h"
#include "console/consoleTypes.h"
#include "console/typeValidators.h"
#include "core/stream/bitStream.h"
#include "core/strings/stringUnit.h"
#include "math/mRandom.h"
Expand Down Expand Up @@ -177,31 +178,31 @@ void ParticleEmitterData::initPersistFields()
{
addGroup( "ParticleEmitterData" );

addField("ejectionPeriodMS", TYPEID< S32 >(), Offset(ejectionPeriodMS, ParticleEmitterData),
addFieldV("ejectionPeriodMS", TYPEID< S32 >(), Offset(ejectionPeriodMS, ParticleEmitterData), new IRangeValidator(1, 2047),
"Time (in milliseconds) between each particle ejection." );

addField("periodVarianceMS", TYPEID< S32 >(), Offset(periodVarianceMS, ParticleEmitterData),
addFieldV("periodVarianceMS", TYPEID< S32 >(), Offset(periodVarianceMS, ParticleEmitterData), new IRangeValidator(0, 2047),
"Variance in ejection period, from 1 - ejectionPeriodMS." );

addField( "ejectionVelocity", TYPEID< F32 >(), Offset(ejectionVelocity, ParticleEmitterData),
addFieldV( "ejectionVelocity", TYPEID< F32 >(), Offset(ejectionVelocity, ParticleEmitterData), new FRangeValidator(0, 655.35f),
"Particle ejection velocity." );

addField( "velocityVariance", TYPEID< F32 >(), Offset(velocityVariance, ParticleEmitterData),
addFieldV( "velocityVariance", TYPEID< F32 >(), Offset(velocityVariance, ParticleEmitterData), new FRangeValidator(0, 163.83f),
"Variance for ejection velocity, from 0 - ejectionVelocity." );

addField( "ejectionOffset", TYPEID< F32 >(), Offset(ejectionOffset, ParticleEmitterData),
addFieldV( "ejectionOffset", TYPEID< F32 >(), Offset(ejectionOffset, ParticleEmitterData), new FRangeValidator(0, 655.35f),
"Distance along ejection Z axis from which to eject particles." );

addField( "thetaMin", TYPEID< F32 >(), Offset(thetaMin, ParticleEmitterData),
addFieldV( "thetaMin", TYPEID< F32 >(), Offset(thetaMin, ParticleEmitterData), new FRangeValidator(0, 180.0f),
"Minimum angle, from the horizontal plane, to eject from." );

addField( "thetaMax", TYPEID< F32 >(), Offset(thetaMax, ParticleEmitterData),
addFieldV( "thetaMax", TYPEID< F32 >(), Offset(thetaMax, ParticleEmitterData), new FRangeValidator(0, 180.0f),
"Maximum angle, from the horizontal plane, to eject particles from." );

addField( "phiReferenceVel", TYPEID< F32 >(), Offset(phiReferenceVel, ParticleEmitterData),
addFieldV( "phiReferenceVel", TYPEID< F32 >(), Offset(phiReferenceVel, ParticleEmitterData), new FRangeValidator(0, 360.0f),
"Reference angle, from the vertical plane, to eject particles from." );

addField( "phiVariance", TYPEID< F32 >(), Offset(phiVariance, ParticleEmitterData),
addFieldV( "phiVariance", TYPEID< F32 >(), Offset(phiVariance, ParticleEmitterData), new FRangeValidator(0, 360.0f),
"Variance from the reference angle, from 0 - 360." );

addField( "softnessDistance", TYPEID< F32 >(), Offset(softnessDistance, ParticleEmitterData),
Expand Down Expand Up @@ -302,8 +303,8 @@ void ParticleEmitterData::packData(BitStream* stream)
{
Parent::packData(stream);

stream->writeInt(ejectionPeriodMS, 10);
stream->writeInt(periodVarianceMS, 10);
stream->writeInt(ejectionPeriodMS, 11); // must match limit on valid range in ParticleEmitterData::initPersistFields
stream->writeInt(periodVarianceMS, 11);
stream->writeInt((S32)(ejectionVelocity * 100), 16);
stream->writeInt((S32)(velocityVariance * 100), 14);
if( stream->writeFlag( ejectionOffset != sgDefaultEjectionOffset ) )
Expand Down Expand Up @@ -352,8 +353,8 @@ void ParticleEmitterData::unpackData(BitStream* stream)
{
Parent::unpackData(stream);

ejectionPeriodMS = stream->readInt(10);
periodVarianceMS = stream->readInt(10);
ejectionPeriodMS = stream->readInt(11);
periodVarianceMS = stream->readInt(11);
ejectionVelocity = stream->readInt(16) / 100.0f;
velocityVariance = stream->readInt(14) / 100.0f;
if( stream->readFlag() )
Expand Down
Loading