Game Development Community

TX2D 3.1.5 Beta - Particles spin in the opposite direction (FIXED in the new Beta)

by Giuseppe De Francesco · in Torque X 2D · 06/08/2010 (2:59 pm) · 8 replies

Build: 3.1.5 Beta

Platform: Windows 7, 32 bit (I think it doesn't matter)

Target: Editor

Issues: Particles spinning clockwise in the Editor spin anticlockwise in the game and vice versa.

Steps to Repeat:
1. Add a simple particle emitter in a scene
2. Make the particles spin clockwise in a visible manner (a spiral will do)
3. Run the game: the particles spin in the opposite direction

About the author

In the software eng. field since 1981, in charge of R&D during last 10 years. IEEE Senior Member (and volunteer).


#1
06/08/2010 (4:10 pm)
Logged as TRQX-75
#2
06/16/2010 (5:58 pm)
Looked into the problem, made a tiny fix. Here it is. Let me know if it blows up anything else and I'll look into it ASAP.

Replace the following line in your ...\Torque2D\T2D\T2DParticleEmitter.cs file. It should be on line 1652.

particle.Spin = -T2DKeyGraph.CalcGraphBVE(_emitterData.SpinBase, _emitterData.SpinVariation, parentEffectData.SpinScale, effectAge);

Fixed it here, holla at me if it needs further looking into.

:D
#3
06/17/2010 (12:59 am)
Hi Ray,

I'm not sure that's correct to apply an engine fix for this because it would change the particles' behaviour in the existent (released) games. IMO this problem shall be addressed in the editor along with other small but quite annoying issues ;)
#4
06/17/2010 (12:15 pm)
I don't have access to the source code right now, I'm waiting to get it from SVN. Though I will have it soon and revisit the issue. Thanks for bringing that up though :)

Feel free to use it as a "quick fix" until then though.
#5
06/17/2010 (12:20 pm)
I agree Pino, the editor should be looked at on a few levels. I really don't think it has been for a few years...
#6
06/17/2010 (12:40 pm)
Actually, I just reread your post.

Would you mind sharing a couple of these "small but quite annoying issues" and I'll get them looked at? Thanks :]
#7
06/25/2010 (9:44 am)
Fixed in the new beta, ok ;)

@Ray: sorry, I missed your request, at any rate all the issues are logged as bugs in this thread ;)
#8
06/30/2010 (3:42 pm)
I know this is a bit old, but it has been fixed correctly now for the next release. The following fix will spin your particles in a clockwise direction on a positive SpinBase value as originally intended. (Previously I believe this logic was reversed)

The change I had up there in the engine is in the beta (So you may want to revert the change before adding this one in).

Add the following change to line 2620 in your \Tools\TorqueX2D\engine\source\T2D\t2DParticleEmitter.cc file.

pParticleNode->mOrientationAngle += -pParticleNode->mRenderSpin * elapsedTime;

There we go, now everybody's particles are happy...for now :)