45 lines
1.2 KiB
Java
45 lines
1.2 KiB
Java
package electrosphere.client.culling;
|
|
|
|
import java.util.List;
|
|
|
|
import org.joml.Vector3d;
|
|
|
|
import electrosphere.engine.Globals;
|
|
import electrosphere.entity.Entity;
|
|
import electrosphere.entity.EntityDataStrings;
|
|
import electrosphere.entity.EntityUtils;
|
|
import electrosphere.entity.Scene;
|
|
import electrosphere.entity.types.attach.AttachUtils;
|
|
|
|
@Deprecated
|
|
public class ClientEntityCullingManager {
|
|
|
|
Scene scene;
|
|
|
|
public ClientEntityCullingManager(Scene scene){
|
|
this.scene = scene;
|
|
}
|
|
|
|
|
|
public void recursiveHide(Entity target){
|
|
if(AttachUtils.hasChildren(target)){
|
|
List<Entity> childrenList = AttachUtils.getChildrenList(target);
|
|
for(Entity currentChild : childrenList){
|
|
recursiveHide(currentChild);
|
|
}
|
|
}
|
|
target.putData(EntityDataStrings.DATA_STRING_DRAW, false);
|
|
}
|
|
|
|
public void recursiveShow(Entity target){
|
|
if(AttachUtils.hasChildren(target)){
|
|
List<Entity> childrenList = AttachUtils.getChildrenList(target);
|
|
for(Entity currentChild : childrenList){
|
|
recursiveShow(currentChild);
|
|
}
|
|
}
|
|
target.putData(EntityDataStrings.DATA_STRING_DRAW, true);
|
|
}
|
|
|
|
}
|