I pass throught the physical ground!

Hello guys, for train my, I devellop a cubic game like minecraft, so all are right, but when I walk a little I pass trought the cube, as they are physic it is strange !

I have write the in game part on a AppState.

edit : problem solved, I have modified the dir.y and camLeft.y value to 0.5f

[java]public void update(float tpf)


Vector3f dir = cam.getDirection().mult(0.15f);

Vector3f camLeft = cam.getLeft().clone().multLocal(0.1f);

dir.y = 0.5f;

camLeft.y = 0.5f;

walkDirection.set(0, 0, 0);

if (left)




if (right)




if (up)




if (down)







For create the terrain I use a method makeCube(Vector3f position, int typeOfCube)

[java]public void makeCube(Vector3f position, int typeOfCube)


//Create a cube Geometry and attach it to the scene graph

Geometry cube = new Geometry(“cubeNumber” + numberOfModel, box);

RigidBodyControl rbc = new RigidBodyControl(boxShape, 0);



if(typeOfCube == 1)




else if(typeOfCube == 2)





rbc.setPhysicsLocation(position);//set physical location



My player is physical too, I init his physic on the initPhysic() method :

[java]public void initPhysic()


CapsuleCollisionShape capsule = new CapsuleCollisionShape(0.5f, 2f, 1);

player = new CharacterControl(capsule, 1f);




player.setPhysicsLocation(new Vector3f(5, 10, 5));



In images with debug mode (sorry if images are too big) :

normal comportment

When I pass trought the pysical ground :

Have you an idea, of the problem ?

For box worlds don’t use cubes! Look at custom meshes and voxels

1 Like

ok, I know now for what the game lag ^^


sorry If I am stupid, but have you a documentation for voxel ?

because I have try too read the boxel engine’s source, but I don’t understand anything

There is plenty of information on the forums, you are not the first one to ask about voxel engines. just use the search. Really, the topic comes up nearly every week.

1 Like

sorry, I have search, and I have dowload the voxel devellopment kit, bloxel source, and bloxel engine source, but I don’t know how to use of it,

I think I will try custom meshe, that is more easy than read the source code of a project ^^

You should not simply download any source and think it will magically solve all your problems.

Try reading about what a voxel engine is (big hint: A Box world is, in fact, NOT composed of boxes). Try to understand what a ‘voxel world’ really is. And then, how you can make it appear on the screen (hint: create custom mesh programatically from voxel data).

And maybe you go and search the forums again, as i said, there is plenty of information here. Not only some source code and some more or less ready-to-use voxel engines, but plenty of descriptions what a boc world really is and how to manage it.

I wouldn’t have told you, that the information is there, if it weren’t. The question comes nearly every week.


thank you I do that, sorry for disturbance