Only Y fall and physic on collision

Hi all!!



I’m building a game like tetris in that some objects fall vertical and, when reach to other objects or the bottom, stop falling and stay quiet.



My problem is that using RigidBodyControl, in some cases, the object rotate by z axis or x axis. In some cases, some objects can disappear and, the object on top, needs to down be placed in there position.

Also, I can make some invisible walls to disable objects to rotate in z axis, and so much lines (like walls) to disable objects to rotate in x axis but I don’t like do that lol



I have to use RigidBodyControl or I need to make the objects falls manually? (updating the position)



Also, I have to check collisions to interact with objects. Using RigidBodyControl I can implement PhysicsCollisionListener to manage that. Updating the positions can manage collisions? (I mean without build my own grid/position control)



Thanks in advance

Regards Juan Pablo from Argentina

Sorry about my English

No you should not move the physics objects manually but use forces on them if you want proper results, you have to use forces. If you want physics collision detection with manually moved nodes use the kinematic mode of the RigidBodies.

@normen said:
No you should not move the physics objects manually but use forces on them if you want proper results, you have to use forces. If you want physics collision detection with manually moved nodes use the kinematic mode of the RigidBodies.


Wow, that was faster!!!! Thanks for the answer

I should use mass 0, kinematic=true and update position using setLocalTranslation?

I put mass on 1000f and setFriction on 100f and get a result with 70% of success lol

If I can make something to do it without use force, tell me please...

Again, thanks for the faaaast answer

Regards Juan Pablo

I don’t know what the exact question is now, I told you how to do it, the javadoc and documentation tells you the details.

@normen said:
I don't know what the exact question is now, I told you how to do it, the javadoc and documentation tells you the details.


I just want a confirmation for:

I should use mass 0, kinematic=true and update position using setLocalTranslation?

But I will test it.

That's all!!
Thanks
Regards Juan Pablo

This bit isn’t quite defined. Actually jbullet always uses 0 mass and bullet will use the mass in the future. Right now it doesn’t really matter so I guess going with a mass for future-proofness is best.

If your game is a lot like tetris or other grid based puzzle games you should go with your own movement and collision system. I can’t imagine getting the physics system locked down enough to reliably get pieces to fall into place.

1 Like

I agree with @aaronperkins. For a simple falling blocks game a full physics simulation is massively overkill and will give you a lot of undesirable behaviour.

If you need collision, the bullet collision system is faster and more memory effective than the geometry-based one.

@normen

is checking the bounding volumes - intersectwith(BoundingVolume) the geometry-based one?

yes

I see

thank you