# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Posted: Fri Jun 16, 2017 5:08 pm

Joined: Sun Jan 22, 2017 5:41 pm
Posts: 4
I'm trying to use btRaycastVehicle in my opengl engine. Bullet world space coordinate system is the same as opengl world space coordinate system, i.e. -z axis goes forward (right handed). btTransform places rigid bodies as I expect.

When I add the engine force:
Code:
physicsEngine.getVehicle()->applyEngineForce(500, 2);
physicsEngine.getVehicle()->applyEngineForce(500, 3);
the vehicle moves in +z direction but wheels don't rotate.

A third parameter of addWheel function(wheelAxleCS) is defined as [-1, 0, 0]. I have noticed that by default a vehicle forward vector (vehicle->getForwardVector()) is defined as [0, 1, 0], so how it is possible that the car moves in +z direction at all?
How to achieve a movement in -z direction and wheels rotation?

I get transformations this way:
Code:
//vehicle body
vehicle->getRigidBody()->getMotionState()->getWorldTransform(transform);
transform.getOpenGLMatrix(mat);
//for each wheel
vehicle->updateWheelTransform(index, true);
transform = vehicle->getWheelInfo(index).m_worldTransform;
transform.getOpenGLMatrix(mat);

Top

 Posted: Sat Jun 17, 2017 4:11 pm

Joined: Sun Jan 22, 2017 5:41 pm
Posts: 4
When I set the vehicle coordinate system this way:
Code:
int rightIndex = 0;
int upIndex = 1;
int forwardIndex = 2;
physicsEngine.getVehicle()->setCoordinateSystem(rightIndex,upIndex,forwardIndex);

then the forward vector is [0,0,1] and the car moves in +z direction with correct wheels rotation but I have still following questions:
- Why the car move in +z direction without wheels rotation when forward vector is [0,1,0] ?
- How to achieve movement in -z direction ?

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 14 guests

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

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities