Mount Bug
by bentgarney · in Torque Game Builder · 04/07/2005 (7:31 pm) · 9 replies
#2
Let's see more of your code and we can maybe find what the problem is.
04/07/2005 (7:41 pm)
Yes i'm sure :)Let's see more of your code and we can maybe find what the problem is.
#3
@Rob: You answered your own question. If you can transparently use %pos in "setPosition()" and "mount()" then %pos is obviously in world-space which is incorrect. The mount system uses local-space values the same as the polygon routines. Also, you mention about %pos being "true"; what does that mean?
The mounting system takes a value of -1/+1 is both axis.
- Melv.
04/08/2005 (12:10 am)
I would ask that you post in other threads and when it seems that there is an actual bug, we can then take it to this section. The alternative is that we end up with a category which documents 90% of problems with peoples code and 10% with T2D which kinda defeats the purpose. I'd prefer to not have this section a scratch-pad for problems. :)@Rob: You answered your own question. If you can transparently use %pos in "setPosition()" and "mount()" then %pos is obviously in world-space which is incorrect. The mount system uses local-space values the same as the polygon routines. Also, you mention about %pos being "true"; what does that mean?
The mounting system takes a value of -1/+1 is both axis.
- Melv.
#4
I'm willing to accept that there's some problem but at this point, I don't see any problem. The basic mounting code you posted is standard stuff and is/has been working without problem.
I've already spent way too much time searching for problems that are not there and helping people debug their code.
Could you send me a simple example in "client.cs" that shows me the problem?
I do want to help but you need to send/post a working example.
- Melv.
04/08/2005 (4:09 am)
Rob,I'm willing to accept that there's some problem but at this point, I don't see any problem. The basic mounting code you posted is standard stuff and is/has been working without problem.
I've already spent way too much time searching for problems that are not there and helping people debug their code.
Could you send me a simple example in "client.cs" that shows me the problem?
I do want to help but you need to send/post a working example.
- Melv.
#5
I do want to help man, I'm not being grumpy by being cautious over spending too much time on it. :)
- Melv.
04/08/2005 (4:29 am)
If you've got a couple of lines of code that are not working then I'd ask that you post them and the values of the variables.I do want to help man, I'm not being grumpy by being cautious over spending too much time on it. :)
- Melv.
#6
With regards to your other post; where do you set the size of "stringsprite"? Where do the size of the letters get set? How do you determine what the mount coordinates mean?
debug debug debug. :)
- Melv.
04/08/2005 (5:08 am)
What gets to me Rob is that it's so easy to try to determine if it's T2D without posting an apparent bug in T2D first. Unlike other posts, I have to take posts in this forum seriously which means I end up wading through peoples code only to find that 90% of the time, it's a problem they've created. This wastes so much time when it is easy to determine if the problem is in T2D or not.%a = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
%b = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
%a.setImageMap( tileMapImageMap );
%b.setImageMap( ggLogoImageMap );
%b.mount( %a, "0.001 0", 0 );... which works and indicates that there isn't a problem with the code you submitted.Quote:@Rob: You answered your own question. If you can transparently use %pos in "setPosition()" and "mount()" then %pos is obviously in world-space which is incorrect. The mount system uses local-space values the same as the polygon routines. Also, you mention about %pos being "true"; what does that mean?What about the response to this?
With regards to your other post; where do you set the size of "stringsprite"? Where do the size of the letters get set? How do you determine what the mount coordinates mean?
debug debug debug. :)
- Melv.
#8
04/08/2005 (6:52 am)
Not calling setSize actually makes a LOT of things not work right i've found. I assumed that it had something to do with basicly you need to call setSize :p
#9
If left at the default, the mounting coordinates result in the following mount to world conversion; 1 = 5, 2 = 10, 3 = 15, 10 = 50 etc.
After changing to "1 1", it results in the following world conversion; 1 = 0.5, 2 = 1, 3 = 1.5, 10 = 0.5 etc.
If you had tried doing a simpler case as I originally mentioned, you'd see this. ;)
Why are you using static-sprites to mount to? Why not use a fxSceneObject2D as a mounting platform that doesn't have any rendering overhead?
Rendering objects have no concept of celled-images. The imagemaps abstract that. All they see are regions in textures so it cannot affect any functionality.
There was a report of an issue with having to use "setSize()" and this was fixed but this is a different problem. It related to retrieving the link-points immediately after mounting as the mount-points were only calculated each frame. This is nothing to do with your problem here so I'm digressing.
Your problem here is that you are incorrectly assuming that "setPosition()" and "mount()" use the same coordinate space when indeed it doesn't.
Help?
- Melv.
04/08/2005 (7:13 am)
Quote:* creating a dummy t2dsprite without an image will cause mounting to not work if any value above 0 is passed to the mount. The sprite I used to mount to the dummy had a celled imagemap applied.
%a = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
%b = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
%b.setImageMap( ggLogoImageMap );
%b.mount( %a, "0.001 0", 0 );Works.Quote:Both issues are fixed if an explicit call to %dummy.setSize("1 1"); is done.That's because T2D objects default to a size of "10 10". Your mounting code will only work if the size is "1 1" as you assume that the mount system uses world-space coordinates which I've mentioned twice above. It doesn't of course and uses a -1 to +1 local-space range. The script is in error.
If left at the default, the mounting coordinates result in the following mount to world conversion; 1 = 5, 2 = 10, 3 = 15, 10 = 50 etc.
After changing to "1 1", it results in the following world conversion; 1 = 0.5, 2 = 1, 3 = 1.5, 10 = 0.5 etc.
If you had tried doing a simpler case as I originally mentioned, you'd see this. ;)
Why are you using static-sprites to mount to? Why not use a fxSceneObject2D as a mounting platform that doesn't have any rendering overhead?
Rendering objects have no concept of celled-images. The imagemaps abstract that. All they see are regions in textures so it cannot affect any functionality.
There was a report of an issue with having to use "setSize()" and this was fixed but this is a different problem. It related to retrieving the link-points immediately after mounting as the mount-points were only calculated each frame. This is nothing to do with your problem here so I'm digressing.
Your problem here is that you are incorrectly assuming that "setPosition()" and "mount()" use the same coordinate space when indeed it doesn't.
Help?
- Melv.
Torque Owner John Vanderbeck
VanderGames
I've spent the last 3 or 4 days HEAVILY involved in the use of mount() with both normal images and cell mode images and trust me it works correctly :)