FC_CollisionQuery - General Information

Overview

Type:

Method

Available as of:

V1.0.0.0

Versions:

Current version

This chapter provides information on:

Description

This function requires a combination of collision objects, collision groups or collision entities as inputs. As a result, it returns TRUE if the inputs are colliding and FALSE otherwise.

In case of a collision, additional information on the specific colliding objects are returned, depending on the input types.

Interface

Input

Data type

Description

i_ifQueryInterface1

IF_CollisionQueryInterface

A first object implementing IF_CollisionQueryInterface. This can be a collision object, a collision group or a collision entity.

i_ifQueryInterface2

IF_CollisionQueryInterface

A second object implementing IF_CollisionQueryInterface. This can be a collision object, a collision group or a collision entity.

Output

Data type

Description

q_xError

BOOL

The output is set to TRUE if an error has been detected during the execution.

q_etResult

ET_Result

POU-specific output on the diagnostic; q_xError = FALSE -> Status message; q_xError = TRUE -> Diagnostic message.

q_sResultMsg

String

Event-triggered message that gives additional information on the diagnostic state.

q_udiCollisionGroupIndex1

UDINT

Index of the colliding group of i_ifQueryInterface1.

This has a zero value if:

  • i_ifQueryInterface1 is referring to a collision object or a collision group

  • There is no collision detected

q_udiCollisionObjectIndex1

UDINT

Index of the colliding object within the collision group of i_ifQueryInterface1.

This has a zero value if:
  • i_ifQueryInterface1 is referring to a collision object

  • There is no collision detected

q_udiCollisionGroupIndex2

UDINT

Index of the colliding group of i_ifQueryInterface2.

This has a zero value if:

  • i_ifQueryInterface2 is referring to a collision object or a collision group

  • There is no collision detected

q_udiCollisionObjectIndex2

UDINT

Index of the colliding object within the collision group of i_ifQueryInterface2.

This has a zero value if:
  • i_ifQueryInterface2 is referring to a collision object

  • There is no collision detected

Return Value

Data type

Description

BOOL

The value is TRUE if the inputs are colliding, and FALSE otherwise.

Diagnostic Messages

q_xError

q_etResult

Enumeration value

Description

FALSE

Ok

0

Success

TRUE

NoCollisionGroupsEnabled

36

No collision groups enabled.

TRUE

InterfaceInvalid

11

The provided interface is invalid (null).

TRUE

CollisionEntityNotUpdated

34

The collision entity has not been updated.

TRUE

CollisionGroupNotUpdated

21

A collision group is not updated.

TRUE

CollisionObjectTypeInvalid

16

The provided collision object type is invalid.

TRUE

CollisionObjectNotConfigured

12

The object is not configured.

TRUE

CollisionQueryInterfaceTypeInvalid

52

The provided collision query interface is referring to an invalid type.

OK

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

NoCollisionGroupsEnabled

Enumeration name:

NoCollisionGroupsEnabled

Enumeration value:

36

Description:

No collision groups enabled.

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 refers to a collision entity. All the configured collision groups of that entity are disabled, meaning that the relative elements of raxEnableCollisionGroups are set to FALSE.

Make sure to enable the groups of the entity that you want to query for collision.

i_ifQueryInterface2 refers to a collision entity. All the configured collision groups of that entity are disabled, meaning that the relative elements of raxEnableCollisionGroups are set to FALSE.

Make sure to enable the groups of the entity that you want to query for collision.

InterfaceInvalid

Enumeration name:

InterfaceInvalid

Enumeration value:

11

Description:

The provided interface is invalid (null).

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 contains an invalid interface.

Make sure that i_ifQueryInterface1 is not null.

i_ifQueryInterface2 contains an invalid interface.

Make sure that i_ifQueryInterface2 is not null.

CollisionEntityNotUpdated

Enumeration name:

CollisionEntityNotUpdated

Enumeration value:

34

Description:

The collision entity has not been updated.

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 refers to a collision entity that is not updated, meaning that its property xUpdated = FALSE.

Make sure that an entity is updated before providing it as input of this function.

i_ifQueryInterface2 refers to a collision entity that is not updated, meaning that its property xUpdated = FALSE.

Make sure that an entity is updated before providing it as input of this function.

CollisionGroupNotUpdated

Enumeration name:

CollisionGroupNotUpdated

Enumeration value:

21

Description:

A collision group is not updated.

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 refers to a collision group that is not updated, meaning that its property xUpdated = FALSE.

Make sure that a group is updated before providing it as input of this function.

i_ifQueryInterface2 refers to a collision group that is not updated, meaning that its property xUpdated = FALSE.

Make sure that a group is updated before providing it as input of this function.

CollisionObjectTypeInvalid

Enumeration name:

CollisionObjectTypeInvalid

Enumeration value:

16

Description:

The provided collision object type is invalid.

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 refers to a collision object with an invalid collision object type.

Make sure that i_ifQueryInterface1 refers to a collision object with a valid collision object type.

The valid types are:

  • ET_CollisionObjectType.AABB

  • ET_CollisionObjectType.OBB

  • ET_CollisionObjectType.Sphere

  • ET_CollisionObjectType.Capsule

i_ifQueryInterface2 refers to a collision object with an invalid collision object type.

Make sure that i_ifQueryInterface2 refers to a collision object with a valid collision object type.

The valid types are:

  • ET_CollisionObjectType.AABB

  • ET_CollisionObjectType.OBB

  • ET_CollisionObjectType.Sphere

  • ET_CollisionObjectType.Capsule

CollisionObjectNotConfigured

Enumeration name:

CollisionObjectNotConfigured

Enumeration value:

12

Description:

The object is not configured.

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 refers to a collision object that is not configured, meaning that its property xConfigured = FALSE.

Make sure that an object is configured before providing it as input of this function.

i_ifQueryInterface2 refers to a collision object that is not configured, meaning that its property xConfigured = FALSE

Make sure that an object is configured before providing it as input of this function.

CollisionQueryInterfaceTypeInvalid

Enumeration name:

CollisionQueryInterfaceTypeInvalid

Enumeration value:

52

Description:

The provided collision query interface is referring to an invalid type.

Issue

Cause

Solution

Not possible to make a collision query.

i_ifQueryInterface1 is referring to an invalid object type.

Make sure that i_ifQueryInterface1 is referring to a collision object, group or entity.

i_ifQueryInterface2 is referring to an invalid object type.

Make sure that i_ifQueryInterface2 is referring to a collision object, group or entity