CharacterControl - Feet sticking through the floor

Hello jME3 Community,

I am using a CharacterControl to use gravity in my game. My game has a Minecraft-like block terrain, so for the CharacterControl, I used a BoxCollisionShape. The blocks are generated in chunks of 16x256x16 and are a single geometry per chunk. I use a MeshCollisionShape in the RigidBodyControl for each chunk. When I spawn, I set my physics location to 0,256,0. Everything works good and fast, but when I try to move past one block, it is like my feet are stuck under the block. Am I doing something wrong? Is there any way to get past this? If I hold down W, I can just glitch right through the block, which is another issue. If I run straight against a wall in the terrain, I can glitch through and go inside the chunk. How do I fix this? Should I use another approach other than jBullet for physics?



On an unrelated note, when I get really close to a block, I can see through it. I think this is due to the FrustumNear being too big. Can I set a distance that my player can be from each block? I already tried changing the Frustum perspective and just the near value and I always screw it up (lol it looks very distorted after I change it).

I think a CapsuleCollisionShape would still be recommended for this, to stop you getting stuck

i think the character tries to roll, and a box can’t roll. Something like that.



A sphere is too small, so you use a capsule, that is a cylinder with two spheres on the feet and head.



The feet can roll, and the head… can roll.



also, since it’s a capsule, you won’t get stuck on wall corners, what would happen with boxes, or something like that





Here you can see the frustum error. What is the best way to fix this?



My textures swirl and look wierd since there are so many of the same ones repeated. How do I fix that? Does it have something to do with mipmapping?

Anyone have any ideas?

If you completely ignore the answers in your thread, do you think more people will feel like answering you?

Sorry, I forgot to acknowledge that the CapsuleCollisionShape fixed my first question (Thanks wezrule and Guedez). However, you refused to acknowledge that there are different questions than what was answered, and immediately proceed to flame me. I’m not ignoring the thread’s answers; you’re ignoring the questions. You have helped create a great little community here; why don’t you treat the people supporting it with a little respect.



There are two more questions in this thread (should the texture question belong in graphics or import assets?) that have not been answered yet. I’m sure you don’t want me to create two more threads (If you do, let me know).

In a 4:3 resolution, I can fix the frustum problem with this:

[java]cam.setFrustumPerspective(75, settings.getWidth()/settings.getHeight(), 0.01f, 1000f);[/java]



I can’t seem to find the right FOV for 16:9 though…



EDIT:

I just found the answer in this thread.

http://hub.jmonkeyengine.org/groups/general-2/forum/topic/near-objects-disappearing-near-camera-frustum-culling-fov/



It appears the right FOV is always 45, and the aspect ratio was wrong. Cast the width and height to floats before dividing and it should work.



I have also fixed my texture problem by setting the min and mag filters on the textures after loading them.

[java]

t.setMinFilter(Texture.MinFilter.NearestNoMipMaps);

t.setMagFilter(Texture.MagFilter.Nearest);

[/java]

Follow the “Please Read This” link to the right, point 8 applies.



As to your questions, I’m a newbie myself so I can’t really help :slight_smile:

2 Likes
@zarch said:
Follow the "Please Read This" link to the right, point 8 applies.

As to your questions, I'm a newbie myself so I can't really help :)


Thank You! This is very helpful.
@joey-watts-96 said:
However, you refused to acknowledge that there are different questions than what was answered, and immediately proceed to flame me.

Read up on the definition of flaming. I only told you what I thought was the reason for you not getting any answers.
@normen said:
Read up on the definition of flaming. I only told you what I thought was the reason for you not getting any answers.


Flaming, also known as bashing, is hostile and insulting interaction between Internet users.


Your tone is easily taken offensively.
@joey-watts-96 said:
Your tone is easily taken offensively.

Life's a bitch. Anyway YOU insulted ME.

This is what you said:
@joey-watts-96 said:
you refused to acknowledge that there are different questions than what was answered, and immediately proceed to flame me. [...] you're ignoring the questions. [...] why don't you treat the people supporting it with a little respect.

This is almost the definition of insulting. I never planned on helping you with your issues, I only wanted to tell you why people don't answer and that YOU should treat them with a little respect. This isn't google where you take your answers and go away.

I said this:
After
@normen said:
If you completely ignore the answers in your thread, do you think more people will feel like answering you?

This is not an insult, it even leaves it up to you to find the answer. You did in fact ignore the people who answered your thread.

http://www.mikeash.com/getting_answers.html