Game Development Community

direction and angle speed

by rennie moffat · in Torque Game Builder · 11/23/2009 (1:04 pm) · 5 replies

these two variables are elements used in the getLinearVelocityPolar() returned as a list, in float value. What I am wondering is the actual physics of this, as the direction could be the angle or angle speed. If angle speed is a velocity, how can it be an angle too? Would that not be the direction?


About the author

My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.


#1
11/23/2009 (1:34 pm)
I think you misread the function:

getLinearVelocityPolar()

Purpose
Gets the speed and direction at which the object is moving.

Return Value - List
The speed of the object as a float and the direction of the object as an angle in the form "angle speed".

#2
11/23/2009 (2:35 pm)
Oh Your right I do,
I just went over it and it is not speed angle, it is speed which is a float and direction which is an angle.



Sorry, my bad.
#3
11/23/2009 (2:44 pm)
So how would it relate to this tho.. a continued thought.

%force = t2dVectorScale(%normal,-(%speed*2));


this is the force applied the the object on contact.


the vetor scale is a direction and a speed? if that is true, does that mean the object can only bounce at 90 degrees to the impact direction?



full source code
%speed = getword($thebase.getlinearVelocitypolar(),1);
			if (%speed > 150) { 
				  %force = t2dVectorScale(%normal,-(%speed*2));
				  %srcObject.setImpulseForce(%force, false);
			}
#4
11/26/2009 (4:29 pm)
rennie,
the GG forums are a great resource and it's tempting to simply post on them every time you bump into something you don't understand, but in my [extensive] experience, you will almost always learn more and understand things better if you put a bit of serious effort into figuring them out for yourself.

in this case (as with many of your other posts), you've asked a somewhat bizarre question: "does this mean the object can only bounce at 90 degrees?" - no, it definitely doesn't mean that, but more importantly you should try to figure the answer out yourself. ie, experiment with t2dVectorScale(). try passing in some values and see what you get out. learn how to expect what the function is going to do. you might even consider actually reading the documentation for the function. i would also highly recommend getting a copy of The Game Programmer's Guide To Torque and spending a day or two working through the early chapters about torqueScript.
#5
11/26/2009 (5:15 pm)
Thanks,
No problem Orion.




PS. nice name,
you sound like you should be in the Matrix!