Get SpatialOS

Sites

Menu

Constraint Class

Namespace: Improbable.Gdk.QueryBasedInterest
GDK package: QueryBasedInterest
Source

Utility class to help define QueryConstraint objects for Interest queries.


Static Methods

Sphere Source
Constraint Sphere(double radius, Coordinates center)

Creates a Constraint object with a Sphere QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double radius : Radius of the Sphere QueryConstraint.
  • Coordinates center : Center of the Sphere QueryConstraint.
Sphere Source
Constraint Sphere(double radius, double centerX, double centerY, double centerZ)

Creates a Constraint object with a Sphere QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double radius : Radius of the Sphere QueryConstraint.
  • double centerX : X coordinate of the center of the Sphere QueryConstraint.
  • double centerY : Y coordinate of the center of the Sphere QueryConstraint.
  • double centerZ : Z coordinate of the center of the Sphere QueryConstraint.
Cylinder Source
Constraint Cylinder(double radius, Coordinates center)

Creates a Constraint object with a Cylinder QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double radius : Radius of the Cylinder QueryConstraint.
  • Coordinates center : Center of the Cylinder QueryConstraint.
Cylinder Source
Constraint Cylinder(double radius, double centerX, double centerY, double centerZ)

Creates a Constraint object with a Cylinder QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double radius : Radius of the Cylinder QueryConstraint.
  • double centerX : X coordinate of the center of the Cylinder QueryConstraint.
  • double centerY : Y coordinate of the center of the Cylinder QueryConstraint.
  • double centerZ : Z coordinate of the center of the Cylinder QueryConstraint.
Box Source
Constraint Box(double xWidth, double yHeight, double zDepth, Coordinates center)

Creates a Constraint object with a Box queryConstraint.

Returns:
A Constraint object.

Parameters
  • double xWidth : Width of Box QueryConstraint in the X-axis.
  • double yHeight : Height of Box QueryConstraint in the Y-axis.
  • double zDepth : Depth of Box QueryConstraint in the Z-axis.
  • Coordinates center : Center of the Box QueryConstraint.
Box Source
Constraint Box(double xWidth, double yHeight, double zDepth, double centerX, double centerY, double centerZ)

Creates a Constraint object with a Box QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double xWidth : Width of Box QueryConstraint in the X-axis.
  • double yHeight : Height of Box QueryConstraint in the Y-axis.
  • double zDepth : Depth of Box QueryConstraint in the Z-axis.
  • double centerX : X coordinate of the center of the Box QueryConstraint.
  • double centerY : Y coordinate of the center of the Box QueryConstraint.
  • double centerZ : Z coordinate of the center of the Box QueryConstraint.
RelativeSphere Source
Constraint RelativeSphere(double radius)

Creates a Constraint object with a RelativeSphere QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double radius : Radius of the RelativeSphere QueryConstraint.

Notes:
  • This Constraint defines a sphere relative to the position of the entity.
RelativeCylinder Source
Constraint RelativeCylinder(double radius)

Creates a Constraint object with a RelativeCylinder QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double radius : Radius of the cylinder QueryConstraint.

Notes:
  • This Constraint defines a cylinder relative to the position of the entity.
RelativeBox Source
Constraint RelativeBox(double xWidth, double yHeight, double zDepth)

Creates a Constraint object with a RelativeBox QueryConstraint.

Returns:
A Constraint object.

Parameters
  • double xWidth : Width of box QueryConstraint in the X-axis.
  • double yHeight : Height of box QueryConstraint in the Y-axis.
  • double zDepth : Depth of box QueryConstraint in the Z-axis.

Notes:
  • This Constraint defines a box relative to the position of the entity.
EntityId Source
Constraint EntityId(EntityId entityId)

Creates a Constraint object with an EntityId QueryConstraint.

Returns:
A Constraint object.

Parameters
  • EntityId entityId : EntityId of an entity to interested in.
Component<T> Source
Constraint Component<T>()

Creates a Constraint object with an Component QueryConstraint.

Returns:
A Constraint object.

Type parameters:
  • T : Type of the component to constrain.
Component Source
Constraint Component(uint componentId)

Creates a Constraint object with a Component QueryConstraint.

Returns:
A Constraint object.

Parameters
  • uint componentId : Component ID of the component to constrain.
All Source
Constraint All(Constraint constraint, params Constraint [] constraints)

Creates a Constraint object with an And QueryConstraint.

Returns:
A Constraint object.

Parameters
  • Constraint constraint : First Constraint in the list of conjunctions.
  • params Constraint [] constraints : Further Constraints for the list of conjunctions.

Notes:
  • At least one Constraint must be provided to create a valid "All" QueryConstraint.
All Source
Constraint All(IEnumerable<Constraint> constraints)

Creates a Constraint object with an And QueryConstraint.

Returns:
A Constraint object.

Parameters
  • IEnumerable<Constraint> constraints : Constraints for the list of conjunctions.

Notes:
  • At least one Constraint must be provided to create a valid "All" QueryConstraint.
Any Source
Constraint Any(Constraint constraint, params Constraint [] constraints)

Creates a Constraint object with an Or QueryConstraint.

Returns:
A Constraint object.

Parameters
  • Constraint constraint : First Constraint in the list of disjunctions.
  • params Constraint [] constraints : Further Constraints for the list of disjunctions.

Notes:
  • At least one Constraint must be provided to create a valid "Any" QueryConstraint.
Any Source
Constraint Any(IEnumerable<Constraint> constraints)

Creates a Constraint object with an Or queryConstraint.

Returns:
A Constraint object.

Parameters
  • IEnumerable<Constraint> constraints : Set of Constraints for the list of disjunctions.

Notes:
  • At least one Constraint must be provided to create a valid "Any" QueryConstraint.


Methods

AsQueryConstraint Source
ComponentInterest.QueryConstraint AsQueryConstraint()

Returns a QueryConstraint object from a Constraint.

Returns:
A QueryConstraint object.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums