// Find entities where floatVar equals 3.14f
Query.where { has(TestComponent.id) }
.filter { by(TestComponent.floatVarData).isEqualTo(3.14f) }
// Find entities where floatVar is between 0.0f and 1.0f
Query.where { has(TestComponent.id) }
.filter { by(TestComponent.floatVarData).greaterThanOrEqualTo(0.0f) and
by(TestComponent.floatVarData).lessThanOrEqualTo(1.0f) }
// Find entities where floatVar is not equal to 0.0f
Query.where { has(TestComponent.id) }
.filter { not(by(TestComponent.floatVarData).isEqualTo(0.0f)) }
class ByFloatFilterOperation(val attrId: Int, val filterBuilder: FilterBuilder)
ByFloatFilterOperation
(
attrId
, filterBuilder
)
|
Signature
constructor(attrId: Int, filterBuilder: FilterBuilder) Parameters attrId: IntÂ
The attribute id of the float attribtues for the filter operation.
Returns ByFloatFilterOperation |
attrId
: Int
[Get] |
Signature
val attrId: Int |
filterBuilder
: FilterBuilder
[Get] |
Signature
val filterBuilder: FilterBuilder |
greaterThan
(
value
)
|
Creates a filter node representing a greater than condition with the given value.
Signature
fun greaterThan(value: Float): ByFloatFilterNode Parameters value: FloatÂ
The float value to compare against.
|
greaterThanOrEqualTo
(
value
, epsilon
)
|
Creates a filter node representing a greater than or equal to condition with the given value.
The epsilon parameter allows for approximate equality comparison with floating point values when checking the equality part of the condition.
Signature
fun greaterThanOrEqualTo(value: Float, epsilon: Float = 1.0E-5f): ByFloatFilterNode Parameters value: FloatÂ
The float value to compare against.
epsilon: FloatÂ
The maximum allowed difference between values for them to be considered equal.
|
isEqualTo
(
value
, epsilon
)
|
Creates a filter node representing an equality condition with the given value.
The epsilon parameter allows for approximate equality comparison with floating point values. Two float values are considered equal if their absolute difference is less than epsilon.
Example:
// Find entities where floatVar equals 3.14f (with default epsilon of 1e-5f)
Query.where { has(TestComponent.id) }
.filter { by(TestComponent.floatVarData).isEqualTo(3.14f) }
Signature
fun isEqualTo(value: Float, epsilon: Float = 1.0E-5f): ByFloatFilterNode Parameters value: FloatÂ
The float value to compare against.
epsilon: FloatÂ
The maximum allowed difference between values for them to be considered equal.
|
lessThan
(
value
)
|
Creates a filter node representing a less than condition with the given value.
Signature
fun lessThan(value: Float): ByFloatFilterNode Parameters value: FloatÂ
The float value to compare against.
|
lessThanOrEqualTo
(
value
, epsilon
)
|
Creates a filter node representing a less than or equal to condition with the given value.
The epsilon parameter allows for approximate equality comparison with floating point values when checking the equality part of the condition.
Signature
fun lessThanOrEqualTo(value: Float, epsilon: Float = 1.0E-5f): ByFloatFilterNode Parameters value: FloatÂ
The float value to compare against.
epsilon: FloatÂ
The maximum allowed difference between values for them to be considered equal.
|