Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class InstancedGeometry extends Geometry {

private int firstUnusedIndex = 0;
private int numVisibleInstances = 0;
private Camera cam;

public InstancedGeometry() {
super();
Expand Down Expand Up @@ -275,6 +276,13 @@ private void swap(int idx1, int idx2) {
}
}

/**
* @Deprecated use {@link #updateInstances(com.jme3.renderer.Camera)
*/
public void updateInstances() {
updateInstances(cam);
}

public void updateInstances(Camera cam) {
FloatBuffer fb = (FloatBuffer) transformInstanceData.getData();
fb.limit(fb.capacity());
Expand Down Expand Up @@ -415,6 +423,12 @@ private void updateAllInstanceData() {
allInstanceData = allData.toArray(new VertexBuffer[allData.size()]);
}

@Override
public boolean checkCulling(Camera cam) {
this.cam = cam;
return super.checkCulling(cam);
}

@Override
public int collideWith(Collidable other, CollisionResults results) {
return 0; // Ignore collision
Expand Down