Chunk physics more reliable with sharp inclines
This commit is contained in:
parent
39ba611af4
commit
863fd4b665
@ -624,8 +624,8 @@ public class LoadingThread extends Thread {
|
||||
|
||||
// StructureUtils.spawnBasicStructure("building1", new Vector3f(5,2.4f,5), new Quaternionf());
|
||||
|
||||
Entity bow = ItemUtils.spawnBasicItem("Bow");
|
||||
EntityUtils.getPosition(bow).set(1, 1, 2);
|
||||
// Entity bow = ItemUtils.spawnBasicItem("Bow");
|
||||
// EntityUtils.getPosition(bow).set(1, 1, 2);
|
||||
|
||||
// NavMeshPathfinder.navigatePointToPointInMesh(G*lobals.navMeshManager.getMeshes().get(0), new Vector3d(10,0,5), new Vector3d(5,0,10));
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ public class GravityTree {
|
||||
if(hadGroundCollision()){
|
||||
state = GravityTreeState.NOT_ACTIVE;
|
||||
if(!hadStructureCollision()){
|
||||
position.set(new Vector3d(position.x,Globals.commonWorldData.getElevationAtPoint(position) + 0.0001f,position.z));
|
||||
// position.set(new Vector3d(position.x,Globals.commonWorldData.getElevationAtPoint(position) + 0.0001f,position.z));
|
||||
}
|
||||
gravityVelocity = 0;
|
||||
} else {
|
||||
|
||||
@ -123,7 +123,11 @@ public class CollisionEngine {
|
||||
// System.out.println(EntityUtils.getPosition(impactor.getParent()) + " " + EntityUtils.getPosition(receiver.getParent()));
|
||||
// System.out.println();
|
||||
// System.out.println("Terrain-creature collision: " + normal + " mag:" + magnitude);
|
||||
receiver.addImpulse(new Impulse(new Vector3d(0,normal.y,0), magnitude*2, Collidable.TYPE_TERRAIN));
|
||||
if(normal.y > normal.x + normal.z){
|
||||
normal.x = 0;
|
||||
normal.z = 0;
|
||||
}
|
||||
receiver.addImpulse(new Impulse(normal, magnitude * 2, Collidable.TYPE_TERRAIN));
|
||||
break;
|
||||
case Collidable.TYPE_CREATURE:
|
||||
receiver.addImpulse(new Impulse(normal, magnitude, Collidable.TYPE_CREATURE));
|
||||
@ -145,7 +149,11 @@ public class CollisionEngine {
|
||||
// System.out.println(EntityUtils.getPosition(impactor.getParent()) + " " + EntityUtils.getPosition(receiver.getParent()));
|
||||
// System.out.println();
|
||||
// System.out.println("Terrain-item collision: " + normal + " mag:" + magnitude);
|
||||
receiver.addImpulse(new Impulse(new Vector3d(0,normal.y,0), magnitude*2, Collidable.TYPE_TERRAIN));
|
||||
if(normal.y > normal.x + normal.z){
|
||||
normal.x = 0;
|
||||
normal.z = 0;
|
||||
}
|
||||
receiver.addImpulse(new Impulse(normal, magnitude * 2, Collidable.TYPE_TERRAIN));
|
||||
break;
|
||||
case Collidable.TYPE_CREATURE:
|
||||
receiver.addImpulse(new Impulse(normal, Math.min(magnitude * 0.5,0.5), Collidable.TYPE_CREATURE));
|
||||
|
||||
@ -29,6 +29,7 @@ public class ServerTerrainChunk {
|
||||
long[][] randomizer = new long[5][5];
|
||||
float[][] heightmap = new float[width + 1][width + 1];
|
||||
ServerTerrainChunk rVal = new ServerTerrainChunk(x, y, heightmap, macroValues, randomizer);
|
||||
rVal.addModification(new TerrainModification(x, y, 3, 3, 5));
|
||||
return rVal;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user