@javagame said: Y si cada casa esta sobre el terreno, no necesitas añadir un "suelo" cada vez.
This is what the wireframe shows with your code:
Also: the character falls into the void again without a plane shape
@javagame said: Y si cada casa esta sobre el terreno, no necesitas añadir un "suelo" cada vez.
This is what the wireframe shows with your code:
Also: the character falls into the void again without a plane shape
refer to the helloCollision tutorial And if that works, it should, then you should be able ot go back to BetterCharacterControl if you want
I tried:
[java]
CollisionShape sceneShape =
CollisionShapeFactory.createMeshShape((Node) sceneModel);
landscape = new RigidBodyControl(sceneShape, 0);
sceneModel.addControl(landscape);
[/java]
But still falls into void
@DualHunter said: This is what the wireframe shows with your code:Also: the character falls into the void again without a plane shape
I have pasted in your code and made several small adjustments, it works for me:
If you are still having issues after that then I doubt it is related to your code, and I cannot help you.
[java]private void initJugador() {
jugadorNodo = new Node();
CapsuleCollisionShape personajeShape = new CapsuleCollisionShape(0.6f, 1.8f);
jugador = new CharacterControl(personajeShape, speed);
jugadorNodo.addControl(jugador);
bulletAppState.getPhysicsSpace().add(jugador);
bulletAppState.getPhysicsSpace().addAll(jugadorNodo);
rootNode.attachChild(jugadorNodo);
jugador.warp(new Vector3f(0.0f, 60f, 0.0f));
jugador.setGravity(10f);
// jugador.setGravity(new Vector3f(0f, -80f, 0f));
}[/java]
[java] private void initTerrain() {
Spatial terreno = assetManager.loadModel(“Scenes/newScene.j3o”);
RigidBodyControl terrenoControl = new RigidBodyControl(0f);
terreno.addControl(terrenoControl);
bulletAppState.getPhysicsSpace().add(terrenoControl);
bulletAppState.setDebugEnabled(true);
rootNode.attachChild(terreno);
} [/java]
Still not working for me. Could it be because of my terrain somehow?
@DualHunter said: Still not working for me. Could it be because of my terrain somehow?
Maybe… What is your framerate? did you change the radius? Try increasing the radius even further, what happens when you change it to 3?
@javagame said: Maybe... What is your framerate? did you change the radius? Try increasing the radius even further, what happens when you change it to 3?
Uhmmm… How do I do that? :-?
[java]CapsuleCollisionShape personajeShape = new CapsuleCollisionShape(0.6f, 1.8f);[/java]
The first parameter to the CapsuleCollisionShape constructor is the radius of the capsule, here I have it to 0.6f… try changing yours to 3 see if it still falls through.
@javagame said: [java]CapsuleCollisionShape personajeShape = new CapsuleCollisionShape(0.6f, 1.8f);[/java]The first parameter to the CapsuleCollisionShape constructor is the radius of the capsule, here I have it to 0.6f… try changing yours to 3 see if it still falls through.
Still falling through. Damn, what could it be?
@DualHunter said: Still falling through. Damn, what could it be?
How many frames per second are you getting?
@DualHunter said: Around 100fps
Idk what your problem is, The code above with the adjustments suggested above works perfectly for me. Sorry.