www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: sushobhit on April 05, 2014, 12:17:14 pm

Title: RE: Camera Problem
Post by: sushobhit on April 05, 2014, 12:17:14 pm
Hi Egon ,
A week back I posted about the problem I was facing with translation of object along with the camera. Well tried everything
that I can but still now results. So I am attaching the whole program with this post plz help me solve the problem.
I have also attached a README to pinpoint the issue. You can find it in the attached RAR :

Download Link : http://www.sendspace.com/file/j769yr

ASAP
Title: Re: RE: Camera Problem
Post by: EgonOlsen on April 06, 2014, 03:33:20 pm
The readme alone would have cleared it all up...jPCT-AE isn't thread safe. You must not modify jPCT related instances from outside the rendering thread (at least not without proper synchronization, if you feel that you have to). The best advise i can give it put your game logic in the rendering thread. There's no point in executing movements that might never be displayed because they happen inbetween two rendered frames anyway. A little more detail can be found here: http://www.jpct.net/wiki/index.php/Thread_safety (http://www.jpct.net/wiki/index.php/Thread_safety)
Title: Re: RE: Camera Problem
Post by: sushobhit on April 07, 2014, 07:26:43 am
Hi Friend ,

Last night i figured it out myself
just when I called object.translate
&      camera.movecamera from OnDrawFrame()
things started working smoothly and everything got back to normal
It happened when I was going through AlienRunner source there in OnDrawFrame
updateGameState() was being called so i thought why not try updating from onDrawFrame
and the dices started rolling in my favor.....Thanks A Ton