Type: |
Function |
Available as of: |
V1.0.0.0 |
Versions: |
Current version |
This chapter provides information on:
This function requires any combination of collision objects, collision groups or collision entities as inputs.
As a result, it returns:
The minimum distance between the inputs
If i_xEvaluateClosestPoints is set to TRUE, the function will evaluate the closest points between the two inputs
Input |
Data type |
Description |
---|---|---|
i_ifQueryInterface1 |
A first object implementing IF_CollisionQueryInterface. This can be a collision object, a collision group or a collision entity. |
|
i_ifQueryInterface2 |
A second object implementing IF_CollisionQueryInterface. This can be a collision object, a collision group or a collision entity. |
|
i_xEvaluateClosestPoints |
BOOL |
If TRUE, the closest points between the two inputs are evaluated. |
Output |
Data type |
Description |
---|---|---|
q_xError |
BOOL |
The output is set to TRUE if an error has been detected during the execution. |
q_etResult |
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_xCollision |
BOOL |
TRUE if there is a collision detected between the two inputs. |
q_lrDistance |
LREAL |
The minimum distance between the two inputs. This is zero if q_xCollision = TRUE. |
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. |
q_udiCollisionObjectIndex1 |
UDINT |
Index of the closest object in the group with index q_udiCollisionGroupIndex1 of i_ifQueryInterface1. This has a zero value if i_ifQueryInterface1 is referring to a collision object. |
q_udiCollisionGroupIndex2 |
UDINT |
Index of the closest group of i_ifQueryInterface2. This has a zero value if i_ifQueryInterface2 is referring to a collision object or a collision group. |
q_udiCollisionObjectIndex2 |
UDINT |
Index of the closest object in the group with index q_udiCollisionGroupIndex2 of i_ifQueryInterface2. This has a zero value if i_ifQueryInterface2 is referring to a collision object. |
q_stClosestPoint1 |
SE_Math.ST_Vector3D |
Closest point for i_ifQueryInterface1. This is only evaluated if i_xEvaluateClosestPoint = TRUE; otherwise, it will return a null vector. |
q_xError |
q_etResult |
Enumeration value |
Description |
---|---|---|---|
FALSE |
0 |
Success |
|
TRUE |
36 |
No collision groups enabled. |
|
TRUE |
11 |
The provided interface is invalid (null). |
|
TRUE |
34 |
The collision entity has not been updated. |
|
TRUE |
21 |
A collision group is not updated. |
|
TRUE |
16 |
The provided collision object type is invalid. |
|
TRUE |
12 |
The object is not configured. |
|
TRUE |
52 |
The provided collision query interface is referring to an invalid type. |
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. |
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. |
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. |
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. |
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:
|
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:
|
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. |
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 |
Example of distance query between i_ifQueryInterface1 (object) and i_ifQueryInterface2 (group). In this case, q_udiCollisionObjectIndex2 = 4 that is the index of the closest object within the group:
Example of distance query between i_ifQueryInterface1 (entity) and i_ifQueryInterface2 (object). In this case, q_udiCollisionGroupIndex1 = 1 and q_udiCollisionObjectIndex1 = 1 since the closest object inside the entity is in group 1 and has index 1:
Example of distance query between i_ifQueryInterface1 (entity) and i_ifQueryInterface2 (entity). In this case, q_udiCollisionGroupIndex1 = 2 and q_udiCollisionObjectIndex1 = 3 for the first entity and q_udiCollisionGroupIndex2 = 1 and q_udiCollisionObjectIndex2 = 2 for the second entity.