moving platforms ? (irrbullet)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
dark chazz
Posts: 26
Joined: Tue Nov 11, 2008 5:20 pm

moving platforms ? (irrbullet)

Post by dark chazz »

As the title says, I'm trying to create moving platforms that the player must jump on top of.
I'm using irrbullet for my game and I'm having difficulty...

I tried setting the platform mesh as a BvhTriangleMeshShape, but it cannot be moved with "setLinearVelocity"

I tried setting it as a BoxShape and setting its gravity to zero, which worked, but as soon as I jump on it, it rotates and falls...

any advice on how to properly do it ?

thanks
Gnasty Gnork
Posts: 18
Joined: Fri Jun 20, 2014 12:12 pm

Re: moving platforms ? (irrbullet)

Post by Gnasty Gnork »

Hm what happens if you parent the pg to the platform only when the pg is standing on it?

What is that falls? The pg or the platform?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: moving platforms ? (irrbullet)

Post by Nadro »

BvhTriangleMeshShape supports only static rigid bodies. For rigid body with btBoxShape you must set angular factor to 0.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
dark chazz
Posts: 26
Joined: Tue Nov 11, 2008 5:20 pm

Re: moving platforms ? (irrbullet)

Post by dark chazz »

Nadro wrote:BvhTriangleMeshShape supports only static rigid bodies. For rigid body with btBoxShape you must set angular factor to 0.
Thank you.
I'm on vacation currently away from my development PC, but I will try this as soon as I can.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: moving platforms ? (irrbullet)

Post by Granyte »

Maybe you should use a kinematic body for what you wanna do
andmov it manualy
dark chazz
Posts: 26
Joined: Tue Nov 11, 2008 5:20 pm

Re: moving platforms ? (irrbullet)

Post by dark chazz »

Nadro wrote:BvhTriangleMeshShape supports only static rigid bodies. For rigid body with btBoxShape you must set angular factor to 0.
Alright.
I have set the angular factor to 0 and also adjusted the linear factor depending on which axis the platform is moving on, and now everything works correctly.

Thanks
Post Reply