SceneObject mountObject Questions
by Nathan Bowhay - ESAL · in Torque 3D Professional · 05/10/2010 (12:01 pm) · 5 replies
So I have some questions about mountObject in the SceneObject class. We are going to extensively use the mounting system so I want to get a feel for the limitations of it. These questions are mainly for that, so if there is any other helpful info let me know.
I see the comment A.mountObject( SceneObject B, slot N, [ Matrix M = Identity ] ). So that is what I was basing my assumptions off of when using it.
So it seems you can pass any SceneObject in, but there seems to be issues when you pass in a TSStatic it doesn't move along with the object. There may be other classes that don't work as well. From what I have seen StaticShape and Camera work.
When I try and use the offset with slot -1 or the origin it gives me an error: "SceneObject::resetWorldBox - Bad world box!" and I get two options both seem to force exit torque. However I don't seem to get it when using an actual mount (correct slot number), but it doesn't seem to make a difference what "x y z xrot yrot zrot theta" I pass it.
Can the offset be used (last param)? What does it do? What Classes does mounting really work for?
Note: I am using Torque 3D 1.1 Beta 1.
I see the comment A.mountObject( SceneObject B, slot N, [ Matrix M = Identity ] ). So that is what I was basing my assumptions off of when using it.
So it seems you can pass any SceneObject in, but there seems to be issues when you pass in a TSStatic it doesn't move along with the object. There may be other classes that don't work as well. From what I have seen StaticShape and Camera work.
When I try and use the offset with slot -1 or the origin it gives me an error: "SceneObject::resetWorldBox - Bad world box!" and I get two options both seem to force exit torque. However I don't seem to get it when using an actual mount (correct slot number), but it doesn't seem to make a difference what "x y z xrot yrot zrot theta" I pass it.
Can the offset be used (last param)? What does it do? What Classes does mounting really work for?
Note: I am using Torque 3D 1.1 Beta 1.
#2
05/11/2010 (4:59 pm)
Glad to see that is an issue for more than just me. Wonder about the offset, cause that is the key thing we want to be able to use. Has anyone else had this issue or can shed some light on it?
#3
But mounting object as ShapeBaseImage, the offset is fully operational.
05/12/2010 (12:01 am)
I don't know for the offset.But mounting object as ShapeBaseImage, the offset is fully operational.
#4
Ok so now I am super confused because I used an StaticShape at "3.03675 6.92967 1" with rotation "1 0 0 0" and the Gideon model. I used -1 for the mount so it will use the origin and a matrix value of "0 0 100 0 0 0 0" and it worked as expected and I didn't get the error that I got before. I am not sure if I just had a bad matrix value or what but apparently it works you just need to use a bad node value for it to use it.
If I figure out why I was getting the error exactly I will post it here.
05/12/2010 (11:30 am)
So I looked at the code to see what is going on and it simply calls getMountTransform passing the index the mount transform and a matrix to store the transform. This method is found in ShapeBase and in its parent class SceneObject. The ShapeBase class simply looks if that node index exists and if so it multiplies the transform of the object that something is mounted to by the node transform and returns. If the node doesn't exist then the parent method is called which simply uses the matrix you pass in to mountObject. Ok so now I am super confused because I used an StaticShape at "3.03675 6.92967 1" with rotation "1 0 0 0" and the Gideon model. I used -1 for the mount so it will use the origin and a matrix value of "0 0 100 0 0 0 0" and it worked as expected and I didn't get the error that I got before. I am not sure if I just had a bad matrix value or what but apparently it works you just need to use a bad node value for it to use it.
If I figure out why I was getting the error exactly I will post it here.
#5
05/12/2010 (12:19 pm)
Looks like I had an extra value at the end on accident.
Torque 3D Owner Nicolas Buquet
I couldn't mount a TSStatic object on an object.
I had to make it a staticShape.
Just to confirm your observations, with T3D 1.0.1 on Mac.
Can't tell about the offset stuff or worldBox.
Nicolas Buquet
www.buquet-net.com/cv/