Renderer/src/main/java/electrosphere/entity/DrawableUtils.java
austin 8c1607d34b
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
Provide way to usurp frustum culling on actor
2024-03-21 19:01:51 -04:00

31 lines
808 B
Java

package electrosphere.entity;
import electrosphere.renderer.actor.Actor;
/**
* Utilities to manipulating drawable entities (eg making an entity transparent)
*/
public class DrawableUtils {
/**
* Edits entity data to make the entity transparent
* @param entity The entity to edit
*/
public static void makeEntityTransparent(Entity entity){
entity.putData(EntityDataStrings.DRAW_TRANSPARENT_PASS, true);
entity.removeData(EntityDataStrings.DRAW_SOLID_PASS);
}
/**
* Disables culling for the actor on a given entity
* @param entity The entity
*/
public static void disableCulling(Entity entity){
Actor actor = EntityUtils.getActor(entity);
if(actor != null){
actor.setFrustumCull(false);
}
}
}