Record Class VolumeTexture
java.lang.Object
java.lang.Record
gaiasky.render.gdx.graphics.VolumeTexture
- Record Components:
texture- The volume's voxels.width- The grid's extent on the texture's first axis.height- The grid's extent on the texture's second axis.depth- The grid's extent on the texture's third axis.type- The storage format, which fixes where the density channel is.boundsMin- The box, in texture order. SeeVolumeTextureLoader.glBounds.boundsMax- The other corner of the box.occupancy- The brick occupancy grid of the same box, or null when there is none.
public record VolumeTexture(com.badlogic.gdx.graphics.Texture3D texture, int width, int height, int depth, VolumeType type, com.badlogic.gdx.math.Vector3 boundsMin, com.badlogic.gdx.math.Vector3 boundsMax, com.badlogic.gdx.graphics.Texture3D occupancy)
extends Record
A loaded 3D volume: the voxels, the box they live in, and the occupancy grid that says where in
that box there is anything at all.
-
Constructor Summary
ConstructorsConstructorDescriptionVolumeTexture(com.badlogic.gdx.graphics.Texture3D texture, int width, int height, int depth, VolumeType type, com.badlogic.gdx.math.Vector3 boundsMin, com.badlogic.gdx.math.Vector3 boundsMax, com.badlogic.gdx.graphics.Texture3D occupancy) Creates an instance of aVolumeTexturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.math.Vector3Returns the value of theboundsMaxrecord component.com.badlogic.gdx.math.Vector3Returns the value of theboundsMinrecord component.intdepth()Returns the value of thedepthrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.com.badlogic.gdx.graphics.Texture3DReturns the value of theoccupancyrecord component.com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> The volume's own occupancy grid, or the fallback, ready to hand to the texture binder.static com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancyDescriptor(com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancy) The occupancy texture to bind to a volume slot: the volume's own, or a 1x1x1 volume of ones when it has none.com.badlogic.gdx.graphics.Texture3Dtexture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.intwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
VolumeTexture
public VolumeTexture(com.badlogic.gdx.graphics.Texture3D texture, int width, int height, int depth, VolumeType type, com.badlogic.gdx.math.Vector3 boundsMin, com.badlogic.gdx.math.Vector3 boundsMax, com.badlogic.gdx.graphics.Texture3D occupancy) Creates an instance of aVolumeTexturerecord class.- Parameters:
texture- the value for thetexturerecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentdepth- the value for thedepthrecord componenttype- the value for thetyperecord componentboundsMin- the value for theboundsMinrecord componentboundsMax- the value for theboundsMaxrecord componentoccupancy- the value for theoccupancyrecord component
-
-
Method Details
-
occupancyDescriptor
public static com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancyDescriptor(com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancy) The occupancy texture to bind to a volume slot: the volume's own, or a 1x1x1 volume of ones when it has none.A slot has no occupancy grid when its volume carries no density to measure (a colour-only volume) or was loaded before the grid existed. The shader's uniform is unconditional - it has no per-slot flag to switch it off - so the fallback has to be something the empty-brick test can read and be told "not empty" by. A single texel of 1, clamped to the whole box, is exactly that, and says the do-nothing thing for one R8 fetch per step.
-
occupancyDescriptor
public com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor<com.badlogic.gdx.graphics.Texture3D> occupancyDescriptor()The volume's own occupancy grid, or the fallback, ready to hand to the texture binder. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
texture
-
width
-
height
-
depth
-
type
-
boundsMin
-
boundsMax
-
occupancy
-