Vector Methods?
by Brian Kelly · in Torque Game Builder · 08/29/2006 (5:20 pm) · 3 replies
What are the methods I can call on a vector?
Specifically, I want to access the X and Y values of a %normal passed in to a collission callback.
Specifically, I want to access the X and Y values of a %normal passed in to a collission callback.
#3
Here is a list of all the vector functions.
Edit: Forgot this was the public forums. That link won't work without a TGB license.. so here's a quick list:
t2dVectorAdd(%vector1, %vector2)
t2dVectorSub(%vector1, %vector2)
t2dVectorMult(%vector1, %vector2)
t2dVectorDot(%vector1, %vector2)
t2dVectorCompare(%vector1, %vector2, [%epsilon = 0.0001])
t2dVectorDistance(%vector1, %vector2)
t2dAngleBetween(%vector1, %vector2)
t2dVectorNormalise(%vector)
t2dVectorScale(%vector, %scale)
t2dVectorLength(%vector)
08/29/2006 (10:06 pm)
Just to clarify a little bit, TorqueScript is typeless - everything is stored as a string. But there is a vector format, that is: the X and Y values delimited by a single space. That is what most of the vector manipulation functions take as input, and is also the format that most of them return.Here is a list of all the vector functions.
Edit: Forgot this was the public forums. That link won't work without a TGB license.. so here's a quick list:
t2dVectorAdd(%vector1, %vector2)
t2dVectorSub(%vector1, %vector2)
t2dVectorMult(%vector1, %vector2)
t2dVectorDot(%vector1, %vector2)
t2dVectorCompare(%vector1, %vector2, [%epsilon = 0.0001])
t2dVectorDistance(%vector1, %vector2)
t2dAngleBetween(%vector1, %vector2)
t2dVectorNormalise(%vector)
t2dVectorScale(%vector, %scale)
t2dVectorLength(%vector)
Torque Owner Paul /*Wedge*/ DElia