Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Aug 02, 2012 12:57 am 
Offline

Joined: Thu Aug 02, 2012 12:40 am
Posts: 4
When turning in the character demo, the ghost object seems to turn one way, while the camera turns the other. Instead, the ghost object should be "locked" to the camera, so that the same side is always visible. Also, if you press "W" to enable wireframe, you'll notice that the forward/backward movement direction does not correspond to the direction of the red/green/blue axis.

Negating the x component of forwardDir in CharacterDemo::clientMoveAndDisplay() and the x component of backward in CharacterDemo::updateCamera() appears to fix the issue. The ghost object will remain "locked" to the camera, and will properly move forward and backward along one of its axis.

Any ideas as to what the cause of this issue is (and a way to fix it that doesn't seem like a hack)?

Code:
forwardDir.normalize ();
upDir.normalize ();
strafeDir.normalize ();
forwardDir.setX(-forwardDir.x()); // <-- add this


Code:
//look at the vehicle
characterWorldTrans = m_ghostObject->getWorldTransform();
btVector3 up = characterWorldTrans.getBasis()[1];
btVector3 backward = -characterWorldTrans.getBasis()[2];
up.normalize ();
backward.normalize ();
backward.setX(-backward.x()); // <-- add this


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group