SetTransform
by Kevin Bamonte · in Torque Game Engine · 12/20/2007 (9:05 am) · 2 replies
Hello All,
I have followed the examples in this book and have tried the settransform command (with the code below)
I bound the "k" to run this function during the game.
The object shows on the screen. When the "k" button is pushed it shows the current position and then changes it to the new position BUT the object never moves !
any help would be appreciated, thanks !
Kevin
function MoveObject
{
// get object current position
%obj1 = 1527;
%loc1 = %obj1.getTransForm();
%x1 = getWord(%loc1,0);
%y1 = getWord(%loc1,1);
%z1 = getWord(%loc1,2);
%rx1 = getWord(%loc1,3);
%ry1 = getWord(%loc1,4);
%rz1 = getWord(%loc1,5);
%r1 = getWord(%loc1,6);
%msg1 = ": position: " SPC %x1 SPC %y1 SPC %z1 SPC %rx1 SPC %ry1 SPC %rz1 SPC %r1;
// move the object to another position
%obj1.setTransForm("100 100 -1.15 0 0 1 0");
// show the position of the object
MessageBoxYesNo(%msg1 , "Position of Object", "disconnect();", "");
}
I have followed the examples in this book and have tried the settransform command (with the code below)
I bound the "k" to run this function during the game.
The object shows on the screen. When the "k" button is pushed it shows the current position and then changes it to the new position BUT the object never moves !
any help would be appreciated, thanks !
Kevin
function MoveObject
{
// get object current position
%obj1 = 1527;
%loc1 = %obj1.getTransForm();
%x1 = getWord(%loc1,0);
%y1 = getWord(%loc1,1);
%z1 = getWord(%loc1,2);
%rx1 = getWord(%loc1,3);
%ry1 = getWord(%loc1,4);
%rz1 = getWord(%loc1,5);
%r1 = getWord(%loc1,6);
%msg1 = ": position: " SPC %x1 SPC %y1 SPC %z1 SPC %rx1 SPC %ry1 SPC %rz1 SPC %r1;
// move the object to another position
%obj1.setTransForm("100 100 -1.15 0 0 1 0");
// show the position of the object
MessageBoxYesNo(%msg1 , "Position of Object", "disconnect();", "");
}
#2
www.garagegames.com/mg/forums/result.thread.php?qt=18040
(Note: this is a Private SDK thread, but it seems like Kevin has a source license.)
After a discussion of the reason for this behavior, ways to code special objects that get around this restriction at the cost of some more network traffic are also described.
12/21/2007 (9:00 am)
Forum searching on "settransform" worked pretty good, finding as the second hit: www.garagegames.com/mg/forums/result.thread.php?qt=18040
(Note: this is a Private SDK thread, but it seems like Kevin has a source license.)
After a discussion of the reason for this behavior, ways to code special objects that get around this restriction at the cost of some more network traffic are also described.
Torque 3D Owner Kevin Bamonte
Boy it would REALLY be nice if Garage Games would take the time to document this product correctly. There effort in this regard is definately sub-par. Never purchased anythign where they expected the users to do all the work for them, very strange.
It's hard enough programming when you have a decent reference in front of you. To be honest, if it wouldn't have been for the quality of the products I've seen here, I would have gotten my money back and moved on to another engine.
Kevin