Hihi~! I first off wanted to say that JPCT is an unbelieveably kick-ass 3D engine. I am still at awe at how simple the classes seem to be and how the first person shooter example is done in so few lines... After being inspired from watching a couple of JPCT's demos, I decided to try and see if I can make some sort of third person view game. I started by looking though the first person shooter source and I tried to understand it. I even played around with it by adding a couple of lines of code, as well as modifying some values and see what happens.
Currently, I am having problems trying to understand why I cannot get the model to land properly on the ground.
First off, I initialized the player's model and textures using this code... I also placed the model 100 units above the normal starting point so that I can see the model falling down and hopefully land properly...
texMan.addTexture("ctf_r",new Texture("3ds"+c+"ctf_r.png"));
player = new Object3D(Loader.loadMD2("3ds"+c+"tris.md2", 1f));
player.setTexture("ctf_r");
theWorld.addObject(player);
player.translate(STARTING_POS.x,STARTING_POS.y-100,STARTING_POS.z);
And then at the doMovement(), I decided to take out all the camera "landing" features and changed that to this...
SimpleVector playerPos=player.getTranslation();
SimpleVector dir=new SimpleVector(0, GRAVITY, 0);
dir=theWorld.checkCollisionEllipsoid(playerPos, dir, ELLIPSOID_RADIUS, 1);
player.translate(dir);
I noticed that if the scale of the model is 0.5 and less, the model will land on the ground properly like so...
If the model is scaled to anything higher than 0.5, then the model kinda goes though the floor like this...
Thank you in advance to anyone that can help me figure out the problem and also a HUGE THANK YOU to JPCT and its author~~! I really hope to get comfortable with the engine and eventually make something really nice with it~!