开发者

Splitting this into a x and y point?

开发者 https://www.devze.com 2023-01-28 07:36 出处:网络
Alright, so I\'m still trying to make my 开发者_开发百科players movements relative to the camera. I got a good answer here

Alright, so I'm still trying to make my 开发者_开发百科players movements relative to the camera. I got a good answer here But he ends it with: s(Jx x̂ + Jy ŷ)

So how can I turn that equation into a x and y?


s (Jx + Jy ŷ)

is the equation to get a new point. Jx and Jy are the values from the joystick (x-value and y-value), s your speed (the higher, the faster) and , ŷ are the x- and y-vectors from your coordinate system set by the camera (you have to compute those every time you compute a new movement)

So take these values, use the formula and you'll get a new player coordinate in the normal x/y plane. (iaw, the result is a point with an x and a y component, which are you x and y values)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号