I want to make an ice floor which the player could slip on it. The floor code is as follow:
control = new RigidBodyControl(new BoxCollisionShape(new Vector3f(.5f, .5f, .5f)), 0);
control.setFriction(0);
The player has a capsule collision shape and its mass is 70. There is no slipping effect when moving on the ice but when I tried to put a -1 friction for the ice (I know that this is an illegal value) there is a little wrong slipping effect. I tried to change the mass of the floor with zero friction and it was slipping and colliding with the player like an ice block. So how could I make an ice floor that has a zero mass and the player could slip on it?
I have another question:
How could I remove any z-axis physical movement from the BetterCharacterControl and from RigidBodyControl? I want a 2D like physics.
Regarding your first question: Perhaps you’re not seeing slippage because (a) the RigidBodyControl is in kinematic mode or (b) the rigid body is damped. Please check those settings.
It’s not kinematic I think. It’s a BetterCharacterControl with its default settings, but I have no idea about dumping. Could you give me a resource .
Thanks very much for your response
For purely 2D physics, my guess is that it won’t take you much time to integrate dyn4j with JME. What you will gain is an exponential reduction in complexity and also never having to worry about constantly reclamping your Z, making sure your stuff doesn’t rotate wrong, etc…
If you have no experience with such things then maybe bullet is better “out of the box”.
Actually the BCC has all that physicsTick shebang built in with easy to override methods handling all the damping and force applying for the character. I think I put all that info in the javadoc
I found an easier solution to this problem.
Bullet offers a vector factor for linear and angular movements that the velocity will be multiplied with it. We can put Z as zero for linear velocity and zero as an angular factor for producing a 2D like movements for characters.
It seems a better solution than bullet. However, I found a plugin for it to JME but it doesn’t have a doc. I wonder if dyn4j could be added to the engine in the future so it could have formal documentation and support .
dyn4j is super simple to use and has a decent documentation as well or at least not a too bad one. You only need to link it to jme, that’s all, no big deal. I did it with the entity component system.
In case you have as well zay-es in place I probably could share that… maybe I will do this on my fprintf.logdown.com blog (and if I find time I will also make a short documentation on the zay-es wiki).
Well… personally, I’m not on the same page regarding too many things in the engine (although I’m not one of the folks maintaining it, so I arguably haven’t much to say on that front), but since dyn4j is 2D I don’t see it being a good fit in jME core.