www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: clown611 on February 09, 2017, 12:21:44 am

Title: Directions detect?
Post by: clown611 on February 09, 2017, 12:21:44 am
Hi again. Im making a game with a spaceship that moves around in space. I controll my spaceship with translate, but when I rotate my ship towards another direction ofc the translate movement doesnt apply on my spaceship. How do you handle this? Is there a way to detect directions or should I make my own method depending on how much I have rotated?
Title: Re: Directions detect?
Post by: clown611 on February 09, 2017, 01:32:22 am
ok I kinda solved it using ship.translate(camera.getdirection().x,camera.getdirection.y,0.04f). no idea if that is a good solution
Title: Re: Directions detect?
Post by: EgonOlsen on February 09, 2017, 08:28:35 am
It depends. It should be fine as long as the camera and the ship are in sync. If not, it might be better to simply use getZAxis() on the ship for the translation.
Title: Re: Directions detect?
Post by: clown611 on February 09, 2017, 11:37:54 am
Ye it worked fine but i will try the getzaxis. Thanks