fxDecal
by Joshua "The Power Nap" Taylor · 03/21/2003 (10:32 am) · 25 comments
Download Code File
This code works with ver 1.1.2,
I've split this tutorial into two sections, install and example.
Thanks goes to Jeff Wilkinson for the art, and Ian Backlund for his donation.
Remember to BACK UP your code before you use this tutorial.
Feedback is allmost a must! I want to know how people feel about this contibution. That, and if anything is wrong.
This code works with ver 1.1.2,
I've split this tutorial into two sections, install and example.
Thanks goes to Jeff Wilkinson for the art, and Ian Backlund for his donation.
Remember to BACK UP your code before you use this tutorial.
Feedback is allmost a must! I want to know how people feel about this contibution. That, and if anything is wrong.
About the author
#2
Thanx
03/22/2003 (8:56 am)
yes up a screen please, so we can see if this code is something we need or other.Thanx
#3
03/22/2003 (12:10 pm)
A screen shot really doesn't do justice to the way the decal animates.
#4
main.obj : error LNK2001: unresolved external symbol "class fxDecalManager * gfxDecalManager" (?gfxDecalManager@@3PAVfxDecalManager@@A)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall fxDecalManager::fxDecalManager(void)" (??0fxDecalManager@@QAE@XZ)
../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
I checked everything and rebuilt everything four times now...
A little help..
03/22/2003 (12:17 pm)
I'm having a little problem linking this...main.obj : error LNK2001: unresolved external symbol "class fxDecalManager * gfxDecalManager" (?gfxDecalManager@@3PAVfxDecalManager@@A)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall fxDecalManager::fxDecalManager(void)" (??0fxDecalManager@@QAE@XZ)
../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
I checked everything and rebuilt everything four times now...
A little help..
#5
You need to put the fxDecalManager.h and fxDecalManager.cc in the sim folder under the engine.
That should do it, because the fxDecalManager.cc declares the gfxDecalMangager resolving the external declaration in the header.
It looks as if main.cc cannot resolve the external declaration of gfxDecalManager.
-Josh
03/22/2003 (2:23 pm)
Okay, I think I know what happened.You need to put the fxDecalManager.h and fxDecalManager.cc in the sim folder under the engine.
That should do it, because the fxDecalManager.cc declares the gfxDecalMangager resolving the external declaration in the header.
It looks as if main.cc cannot resolve the external declaration of gfxDecalManager.
-Josh
#6
03/22/2003 (7:58 pm)
Alright, It works now.. Thax
#7
03/30/2003 (8:27 pm)
Can we get a larger screenshot?
#8
so when it snows, the snow leaves little pools of mud when it drops?
04/13/2003 (5:09 am)
Would it be possible to add this to precipitation (snow,rain)?so when it snows, the snow leaves little pools of mud when it drops?
#9
But it doesn't behave like a water block, so it depends on what you'd use it for.
04/13/2003 (9:48 am)
Yes, you could.But it doesn't behave like a water block, so it depends on what you'd use it for.
#10
Edit: Never mind...I messed up and had the write code section out of place which messed up a couple things. Sorry :( looks like it still works fine on the curent HEAD.
06/22/2003 (6:22 am)
I had this working on the Head from around mid March, but the same example in the updateDeathOffsets section seems to make the current HEAD engine crash. As soon as a client connected player dies, the engine locks up. It works the same as before on a single server player connection. I'm not sure what would be different.Edit: Never mind...I messed up and had the write code section out of place which messed up a couple things. Sorry :( looks like it still works fine on the curent HEAD.
#11
d:\torque 1\torque\engine\sim\fxdecalmanager.cc(122) : error C2065: 'TypefxDecalDataPtr' : undeclared identifier
06/05/2004 (10:07 am)
i am trying to get this to work with current head version and get this errord:\torque 1\torque\engine\sim\fxdecalmanager.cc(122) : error C2065: 'TypefxDecalDataPtr' : undeclared identifier
#12
04/17/2005 (3:45 pm)
Great resource. FYI, it works w/ TGE 1.3.1.
#13
04/18/2005 (11:54 pm)
Just put this into version 1.3 and it works great. Thanks for contributing this great resource!!!
#15
I first thought it had to do with .dif surfaces, but it does it on terrains also. Has anyone else had this problem? I've tried to find where the decal offset is set, but I don't understand the code well enough to find it. I believe it is just too close to the surface that it is on...I think.
Any ideas would be appreciated.
-Alan
12/29/2005 (2:25 pm)
Got this in ok (no errors) but I get a lot of flickering with camera movement in the decal, i.e. the decal disappears and reappears with left-right, up-down movement.I first thought it had to do with .dif surfaces, but it does it on terrains also. Has anyone else had this problem? I've tried to find where the decal offset is set, but I don't understand the code well enough to find it. I believe it is just too close to the surface that it is on...I think.
Any ideas would be appreciated.
-Alan
#16
01/16/2006 (4:01 am)
Awsoome Resource. Finally I have Blood.
#17
06/11/2006 (9:27 pm)
Anyone get this to work with 1.4? I noticed most of the initial install instructions don't apply to the 1.4 code.
#18
Should read
Then this:
Should read:
09/28/2006 (7:53 pm)
To get this to work in 1.4 or 1.4.2 these are the changes to the instructions.In consoleTypes.h in enum ConsoleDynamicTypes right after TypeDecalDataPtr, Add: //---fxDecal-- TypefxDecalDataPtr, //---Joshua Taylor---
Should read
In consoleTypes.h right after DefineConsoleType( TypeSimObjectName ) Add: //---fxDecal-- DefineConsoleType( TypefxDecalDataPtr ) //---Joshua Taylor---
Then this:
In SceneGraph::removeObjectFromScene add:
Should read:
In SceneGraph::removeObjectFromScene add right after AssertFatal(obj->mSceneManager == this, "Error, removing from the wrong sceneGraph!");
#19
Then you must add right above:
this line:
I guess you probably just have to do this anyway come to think of it, otherwise it will not work.
09/28/2006 (9:58 pm)
Additionally, if you want the example to work you must comment out these lines in fxDecalManager:Con::registerType("fxDecalDataPtr", TypefxDecalDataPtr, sizeof(fxDecalData*),
//REF_GETDATATYPE(fxDecalData),
//REF_SETDATATYPE(fxDecalData));Then you must add right above:
IMPLEMENT_SETDATATYPE(fxDecalData)
this line:
IMPLEMENT_CONSOLETYPE(fxDecalData)
I guess you probably just have to do this anyway come to think of it, otherwise it will not work.
#20
09/28/2006 (10:29 pm)
Now I am still seeing the problem Alan James had. Has anyone managed to get past that yet? 
Associate Anthony Rosenbaum