Class EntityUtils
java.lang.Object
gaiasky.scene.entity.EntityUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidPrepares the blending OpenGL state given aVertscomponent.static voidPrepares the depth test OpenGL state given anVertscomponent.static Vector3DgetAbsolutePosition(com.badlogic.ashley.core.Entity entity, Vector3D out) This is a faster version ofgetAbsolutePosition(Entity, Vector3Q)that uses double-precision vectors instead of arbitrary precision.static Vector3QgetAbsolutePosition(com.badlogic.ashley.core.Entity entity, Vector3Q out) Returns the absolute position of this entity in the internal reference system and internal units.static Vector3DgetAbsolutePosition(com.badlogic.ashley.core.Entity entity, String name, Vector3D out) This is a faster version ofgetAbsolutePosition(Entity, String, Vector3Q)that uses double-precision vectors instead of arbitrary precision.static Vector3QgetAbsolutePosition(com.badlogic.ashley.core.Entity entity, String name, Vector3Q out) Returns the absolute position of the entity identified by the given name within this entity in the native coordinates (equatorial system) and internal units.static doublegetModelSpan(com.badlogic.ashley.core.Entity entity) Gets the total span of the entity model after transformation, taking into account the original model span (length of the furthest vertex from the origin) plus the scaling in its local transform (size and sizeScaleFactor).static doublegetRadius(com.badlogic.ashley.core.Entity entity) Re-implementation ofFocusView.getRadius()in a static context.static booleanisCoordinatesTimeOverflow(com.badlogic.ashley.core.Entity entity) Checks whether the given entity has aCoordinatescomponent, and the current time is out of range.static booleanisVisibilityOn(com.badlogic.ashley.core.Entity entity)
-
Constructor Details
-
EntityUtils
public EntityUtils()
-
-
Method Details
-
getAbsolutePosition
Returns the absolute position of this entity in the internal reference system and internal units.- Parameters:
entity- The entity.out- Auxiliary vector to put the result in.- Returns:
- The vector with the position.
-
getAbsolutePosition
This is a faster version ofgetAbsolutePosition(Entity, Vector3Q)that uses double-precision vectors instead of arbitrary precision.- Parameters:
entity- The entity.out- Auxiliary vector to put the result in.- Returns:
- The vector with the position.
-
getAbsolutePosition
public static Vector3Q getAbsolutePosition(com.badlogic.ashley.core.Entity entity, String name, Vector3Q out) Returns the absolute position of the entity identified by the given name within this entity in the native coordinates (equatorial system) and internal units.- Parameters:
entity- The entity.name- The name.out- Auxiliary vector to put the result in.- Returns:
- The vector with the position.
-
getAbsolutePosition
public static Vector3D getAbsolutePosition(com.badlogic.ashley.core.Entity entity, String name, Vector3D out) This is a faster version ofgetAbsolutePosition(Entity, String, Vector3Q)that uses double-precision vectors instead of arbitrary precision.- Parameters:
entity- The entity.name- The name.out- Auxiliary vector to put the result in.- Returns:
- The vector with the position.
-
isCoordinatesTimeOverflow
public static boolean isCoordinatesTimeOverflow(com.badlogic.ashley.core.Entity entity) Checks whether the given entity has aCoordinatescomponent, and the current time is out of range.- Returns:
- Whether the entity is in time overflow.
-
blend
-
depth
-
isVisibilityOn
public static boolean isVisibilityOn(com.badlogic.ashley.core.Entity entity) -
getRadius
public static double getRadius(com.badlogic.ashley.core.Entity entity) Re-implementation ofFocusView.getRadius()in a static context.- Parameters:
entity- The entity.- Returns:
- The radius of the entity.
-
getModelSpan
public static double getModelSpan(com.badlogic.ashley.core.Entity entity) Gets the total span of the entity model after transformation, taking into account the original model span (length of the furthest vertex from the origin) plus the scaling in its local transform (size and sizeScaleFactor).- Parameters:
entity- The entity.- Returns:
- The total span of the entity, in internal units.
-