Search found 6 matches

by paokakis
Thu Jan 07, 2021 7:30 pm
Forum: General Bullet Physics Support and Feedback
Topic: Get rotation on Y axis from btRigidBody
Replies: 4
Views: 335

Re: Get rotation on Y axis from btRigidBody

Thank you for the reply and the code. I will try your code. In the meantime this is how the camera works if you think you can make it work with bullet : This is for the position behind the spaceship calculation: float CalculateHorizontalDistance() { if (!mpPlayer) return 0.f; return distanceFromPlay...
by paokakis
Thu Jan 07, 2021 8:57 am
Forum: General Bullet Physics Support and Feedback
Topic: Get rotation on Y axis from btRigidBody
Replies: 4
Views: 335

Re: Get rotation on Y axis from btRigidBody

My problem is that I have a Camera that follows a spaceship and I need to feed to the Camera X,Y,Z rotations of the object to make it rotate and follow the body in every movement. So I need to retrieve the separate rotations of the body to feed them into the Camera...
by paokakis
Wed Jan 06, 2021 8:20 pm
Forum: General Bullet Physics Support and Feedback
Topic: Get rotation on Y axis from btRigidBody
Replies: 4
Views: 335

Get rotation on Y axis from btRigidBody

Hello to the group, Is it possible to get the rotation on Y axis of a btRigidBody? I've tried the following without success: btScalar yaw; btScalar pitch; btScalar roll; body->getCenterOfMassTransform().getBasis().getEulerZYX(yaw, pitch, roll, 1); and glm::vec4 getRotation(btRigidBody* body) { glm::...
by paokakis
Tue Jan 05, 2021 8:19 am
Forum: General Bullet Physics Support and Feedback
Topic: Best way to rotate a btRigidBody
Replies: 3
Views: 160

Re: Best way to rotate a btRigidBody

Thanks man, I tested your code and the rotation is object relative as I wanted. Once more thanks!
by paokakis
Mon Jan 04, 2021 8:08 pm
Forum: General Bullet Physics Support and Feedback
Topic: Best way to rotate a btRigidBody
Replies: 3
Views: 160

Re: Best way to rotate a btRigidBody

Hello, Thanks for the reply. I'll try to implement your suggestion. In the meantime you can take a look here : https://youtu.be/dFPNO_yQNZs . You can see in the first part I roll to the right and at 90 degrees I pitch down expecting the point of the spaceship to come up but instead it is rotating th...
by paokakis
Mon Jan 04, 2021 4:59 pm
Forum: General Bullet Physics Support and Feedback
Topic: Best way to rotate a btRigidBody
Replies: 3
Views: 160

Best way to rotate a btRigidBody

Hello to the group, I am creating a 3D space shooter game using OpenGL and Bullet Physics. I have stumbled upon a problem that might be easy for some but is a real challenge for me. So any help is deeply appreciated. I have a callback function that is passing in the mouse position on the screen as a...