API reference
API reference
Select your platform
No SDKs available
No versions available

ByVector3FilterOperation

ByVector3FilterOperation

class ByVector3FilterOperation(val attrId: Int, var propId: Int = 0, val filterBuilder: FilterBuilder)
A class representing a filter operation for Vector3 attributes. It is used to build a filter expression by specifying comparison operations on Vector3 attribute values.
This class provides methods for creating filter nodes that represent various comparison operations on Vector3 attributes. It supports both:
  • Comparing entire Vector3 values (all X, Y, and Z components together)
  • Component-wise comparisons (filtering on just the X, Y, or Z component)
The component-wise filtering is enabled through the byX(), byY(), and byZ() methods, which configure the filter to operate on a specific component of the Vector3.
Example:
// Find entities where vector3Var equals Vector3(1.0f, 2.0f, 3.0f)
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.vector3VarData).isEqualTo(Vector3(1.0f, 2.0f, 3.0f)) }

// Find entities where vector3Var.x is greater than 0.5f
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.vector3VarData).byX().greaterThan(0.5f) }

// Find entities where vector3Var.z is between 0.0f and 1.0f
Query.where { has(TestComponent.id) }
     .filter { by(TestComponent.vector3VarData).byZ().greaterThanOrEqualTo(0.0f) and
             by(TestComponent.vector3VarData).byZ().lessThanOrEqualTo(1.0f) }

Constructors

NameSummary
ByVector3FilterOperation
constructor(attrId: Int, propId: Int = 0, filterBuilder: FilterBuilder)

Properties

NameSummary
attrId
val attrId: Int
filterBuilder
val filterBuilder: FilterBuilder
propId
var propId: Int

Functions

NameSummary
byX
fun byX(): ByVector3FilterOperation

Sets the filter to operate on the X component of the Vector3.
byY
fun byY(): ByVector3FilterOperation

Sets the filter to operate on the Y component of the Vector3.
byZ
fun byZ(): ByVector3FilterOperation

Sets the filter to operate on the Z component of the Vector3.
greaterThan
fun greaterThan(value: Float): ByVector3FilterNode

Creates a filter node representing a greater than condition with the given float value. This compares only the component specified by propId (X, Y, or Z). By default, the filter operates on the X component.
greaterThanOrEqualTo
fun greaterThanOrEqualTo(value: Float): ByVector3FilterNode

Creates a filter node representing a greater than or equal to condition with the given float value. This compares only the component specified by propId (X, Y, or Z). By default, the filter operates on the X component.
isEqualTo
fun isEqualTo(value: Vector3): ByVector3FilterNode

Creates a filter node representing an equality condition with the given Vector3 value. This compares all x, y, and z components of the vector.



fun isEqualTo(value: Float): ByVector3FilterNode

Creates a filter node representing an equality condition with the given float value. This compares only the component specified by propId (X, Y, or Z). By default, the filter operates on the X component.
lessThan
fun lessThan(value: Float): ByVector3FilterNode

Creates a filter node representing a less than condition with the given float value. This compares only the component specified by propId (X, Y, or Z). By default, the filter operates on the X component.
lessThanOrEqualTo
fun lessThanOrEqualTo(value: Float): ByVector3FilterNode

Creates a filter node representing a less than or equal to condition with the given float value. This compares only the component specified by propId (X, Y, or Z). By default, the filter operates on the X component.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon