Game Development Community

Cannot set td2vector X or Y values separately

by Luis E Pabon · in iTorque 2D · 10/24/2011 (7:23 pm) · 1 replies

I've found a bug in which I cannot make modifications to Vector values by only using X or Y. I have tested it on iTorque 2D 1.4 and 1.5, both on PSK and non-PSK projects.

echo(%this.Direction.X);
      %this.Direction.X = -1;
      echo(%this.Direction.X);
      
      echo(%this.LinearVelocity.X);
      %this.LinearVelocity.X = -1;
      echo(%this.LinearVelocity.X);
      
      echo(%this.Position.X);
      %this.Position.X = -1;
      echo(%this.Position.X);
      
      echo(%this.Jump);
      %this.Jump = true;
      echo(%this.Jump);

The code above returns different values in 1.4 and 1.5. In 1.5, it returns:
0.000
0.000
0.000
0.000
-0.131
-0.131
0
1

In 1.4, it returns:
0.000
-1.000
0.000
-1.000
-0.131
-1.131
0
1
in 1.4

Normally this is not a problem. However, I have PSK projects, and this has made it impossible for me to upgrade PSK projects. I ran a CodeCompare check on t2dSceneObject.ccp and t2dVector.cpp but I found no differences that could be causing the problem.

Any help would be appreciated.

#1
10/24/2011 (11:03 pm)
I have been using:

%this.setLinearVelocityX(%myXVar);
%this.setLinearVelocityY(%myYVar);

Hope that helps!