For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Math releated question..

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
.:..:
OldUnreal Member
Posts: 1637
Joined: Tue Aug 16, 2005 4:35 am

Math releated question..

Post by .:..: »

Whats the best way to transform a velocity to a new velocity releated to some ground normal change...
lets say you have a ball spinning on the ground, then it hits a slope and I want it start spinning up the slope with same velocity but without any bounches or something like that.
I know its possible to do it with vectors only using Cross and/or Dot, but I'm not very good with them.
Everyone I've asked so far have no idea with this one.
1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD :P
(ಠ_ಠ)
User avatar
Cheese
OldUnreal Member
Posts: 24
Joined: Tue May 22, 2007 11:38 pm

Re: Math releated question..

Post by Cheese »

I pretty much fail at math.

Code: Select all

Velocity -= 2 * ( Velocity dot HitNormal) * HitNormal;  
Should work for the velocity. (Code from RazorBlade.uc ;))
I'll have to think up something for the spinning part.
Currently lurking...
User avatar
.:..:
OldUnreal Member
Posts: 1637
Joined: Tue Aug 16, 2005 4:35 am

Re: Math releated question..

Post by .:..: »

Ugh... but I didnt want it to bounch, just keep rolling on the ground.
1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD :P
(ಠ_ಠ)
User avatar
.:..:
OldUnreal Member
Posts: 1637
Joined: Tue Aug 16, 2005 4:35 am

Re: Math releated question..

Post by .:..: »

Oh Jeesus... who could have tought it was something so simple as

Code: Select all

Velocity -= ( Velocity dot HitNormal) * HitNormal;
That X2 there made it bounch off wall smilar to "MirrorVectorByNormal( vector Vect, vector Normal );" function, but everything between 1-2 gives the bounching angle.
1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD :P
(ಠ_ಠ)

Return to “UScript Board”