Using the third argument "TransformF" of "MountObject", program crashed.
by Tom Giant · in Torque 3D Professional · 01/19/2011 (1:27 pm) · 3 replies
I searched some information from forums for building the Parent-Child relation between Objects.
http://www.torquepowered.com/community/forums/viewthread/60323/
http://www.torquepowered.com/community/forums/viewthread/91265/
I had a great development according to that method(I found it seemed to need to build firstly the node named "mount0", is it necessary, not any node?). But when I used the third argument "TransformF" of the function mountObject, my program crashed. The following is part of my codes.
Quote:
%obj = new StaticShape() // TSStatic
{
datablock=TestHouseData;
position = getWords(%scanTarg, 1, 3);
//shapeName = "art/shapes/house/house01/house01.DAE";
//collisionType = "Visible Mesh";
scale = "0.5 0.5 0.5";
};
%obj2 = new StaticShape() // TSStatic()
{
datablock=TestHouseData2;
position = getWords(%scanTarg, 1, 3);
//shapeName = "art/shapes/house/house02/house02.DAE";
//collisionType = "Visible Mesh";
scale = "0.5 0.5 0.5";
};
%transform = MatrixCreate( "50, 0, 0", "0, 0, 1, 0" );
%mount = 0;
%obj.mountObject(%obj2, %mount, %transform);
MissionCleanup.add(%obj);
MissionCleanup.add(%obj2);
By the way, should I add the code "MissionCleanup.add(%obj2);"?
Does anybody know what?
Thanks for any help in advance.
http://www.torquepowered.com/community/forums/viewthread/60323/
http://www.torquepowered.com/community/forums/viewthread/91265/
I had a great development according to that method(I found it seemed to need to build firstly the node named "mount0", is it necessary, not any node?). But when I used the third argument "TransformF" of the function mountObject, my program crashed. The following is part of my codes.
Quote:
%obj = new StaticShape() // TSStatic
{
datablock=TestHouseData;
position = getWords(%scanTarg, 1, 3);
//shapeName = "art/shapes/house/house01/house01.DAE";
//collisionType = "Visible Mesh";
scale = "0.5 0.5 0.5";
};
%obj2 = new StaticShape() // TSStatic()
{
datablock=TestHouseData2;
position = getWords(%scanTarg, 1, 3);
//shapeName = "art/shapes/house/house02/house02.DAE";
//collisionType = "Visible Mesh";
scale = "0.5 0.5 0.5";
};
%transform = MatrixCreate( "50, 0, 0", "0, 0, 1, 0" );
%mount = 0;
%obj.mountObject(%obj2, %mount, %transform);
MissionCleanup.add(%obj);
MissionCleanup.add(%obj2);
By the way, should I add the code "MissionCleanup.add(%obj2);"?
Does anybody know what?
Thanks for any help in advance.
About the author
#2
I finally knew the reason of crash.
The following code is incorrect.
Corrected:
I was so careless.
01/23/2011 (6:47 pm)
Got it. Thanks for your reply.I finally knew the reason of crash.
The following code is incorrect.
Quote:
%transform = MatrixCreate( "50, 0, 0", "0, 0, 1, 0" )
Corrected:
Quote:
%transform = MatrixCreate( "50 0 0", "0 0 1 0" )
I was so careless.
#3
Does anybody know what? Thanks for any help in advance.
01/23/2011 (6:51 pm)
But I still don't know the following question.Quote:
should I add the code "MissionCleanup.add(%obj2);"?
Does anybody know what? Thanks for any help in advance.
Torque 3D Owner Bloodknight
Bloodknight Studios
edit :- the vehicle class has mount nodes too.
edit2 :- and yes you have to use specific mount nodes that exist in the shape, you could test i guess by trying to mount to "root"