- update test data, add list size check to TerrainGrid
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8698 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
534ab2f737
commit
9e18ec6184
engine/src
terrain/com/jme3/terrain/geomipmap
test-data/TerrainGrid
testgrid_-1_0_-1.j3otestgrid_-1_0_0.j3otestgrid_-1_0_1.j3otestgrid_-1_0_2.j3otestgrid_0_0_-1.j3otestgrid_0_0_-2.j3otestgrid_0_0_-3.j3otestgrid_0_0_0.j3otestgrid_0_0_2.j3otestgrid_0_0_3.j3otestgrid_1_0_-1.j3otestgrid_1_0_-2.j3otestgrid_1_0_-3.j3otestgrid_1_0_0.j3otestgrid_1_0_1.j3otestgrid_1_0_2.j3otestgrid_2_0_-1.j3otestgrid_2_0_-2.j3otestgrid_2_0_-3.j3otestgrid_2_0_-4.j3otestgrid_2_0_0.j3otestgrid_2_0_1.j3otestgrid_2_0_2.j3otestgrid_3_0_-1.j3otestgrid_3_0_-2.j3otestgrid_3_0_-3.j3otestgrid_3_0_-4.j3otestgrid_3_0_0.j3otestgrid_3_0_1.j3otestgrid_3_0_2.j3otestgrid_4_0_-1.j3otestgrid_4_0_-2.j3otestgrid_4_0_-3.j3o
test/jme3test/terrain
@ -281,7 +281,7 @@ public class TerrainGrid extends TerrainQuad {
|
|||||||
// to accept more, there are two ways:
|
// to accept more, there are two ways:
|
||||||
// 1: every camera has an associated grid, then the location is not enough to identify which camera location has changed
|
// 1: every camera has an associated grid, then the location is not enough to identify which camera location has changed
|
||||||
// 2: grids are associated with locations, and no incremental update is done, we load new grids for new locations, and unload those that are not needed anymore
|
// 2: grids are associated with locations, and no incremental update is done, we load new grids for new locations, and unload those that are not needed anymore
|
||||||
Vector3f cam = locations.get(0);
|
Vector3f cam = locations.size() == 0 ? Vector3f.ZERO.clone() : locations.get(0);
|
||||||
Vector3f camCell = this.getCamCell(cam); // get the grid index value of where the camera is (ie. 2,1)
|
Vector3f camCell = this.getCamCell(cam); // get the grid index value of where the camera is (ie. 2,1)
|
||||||
if (cellsLoaded > 1) { // Check if cells are updated before updating gridoffset.
|
if (cellsLoaded > 1) { // Check if cells are updated before updating gridoffset.
|
||||||
gridOffset[0] = Math.round(camCell.x * (size / 2));
|
gridOffset[0] = Math.round(camCell.x * (size / 2));
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_0_0_-2.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_0_0_-2.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_0_0_-3.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_0_0_-3.j3o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_1_0_-2.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_1_0_-2.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_1_0_-3.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_1_0_-3.j3o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_2_0_-2.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_2_0_-2.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_2_0_-3.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_2_0_-3.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_2_0_-4.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_2_0_-4.j3o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_3_0_-2.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_3_0_-2.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_3_0_-3.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_3_0_-3.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_3_0_-4.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_3_0_-4.j3o
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_4_0_-2.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_4_0_-2.j3o
Normal file
Binary file not shown.
BIN
engine/src/test-data/TerrainGrid/testgrid_4_0_-3.j3o
Normal file
BIN
engine/src/test-data/TerrainGrid/testgrid_4_0_-3.j3o
Normal file
Binary file not shown.
@ -142,6 +142,9 @@ public class TerrainGridTest extends SimpleApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void tileAttached(Vector3f cell, TerrainQuad quad) {
|
public void tileAttached(Vector3f cell, TerrainQuad quad) {
|
||||||
|
while(quad.getControl(RigidBodyControl.class)!=null){
|
||||||
|
quad.removeControl(RigidBodyControl.class);
|
||||||
|
}
|
||||||
// try {
|
// try {
|
||||||
// BinaryExporter.getInstance().save(quad, new File("/Users/normenhansen/Documents/Code/jme3/engine/src/test-data/TerrainGrid/"
|
// BinaryExporter.getInstance().save(quad, new File("/Users/normenhansen/Documents/Code/jme3/engine/src/test-data/TerrainGrid/"
|
||||||
// + "testgrid_" + Math.round(cell.x) + "_" + Math.round(cell.y) + "_" + Math.round(cell.z) + ".j3o"));
|
// + "testgrid_" + Math.round(cell.x) + "_" + Math.round(cell.y) + "_" + Math.round(cell.z) + ".j3o"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user