FB_CollisionGroupAddCollisionObject (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

This chapter provides information on:

Task

Add a collision object to the group.

Description

This method is used to add one collision object to the collision group.

Interface

The function block implements the interface IF_CollisionGroup.

Access: PUBLIC

Return type: UDINT

Input

Data type

Description

i_ifCollisionObject

IF_CollisionObject

Collision object to add to the group.

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(80)

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

Return Value

The returned value is the index of the collision object added to the list. It can be used to refer to the object through the property raifCollisionObjects.

Diagnostic Messages

q_xError

q_etResult

Enumeration value

Description

FALSE

OK

0

Success

TRUE

MaxNumberOfCollisionGroupObjectsReached

31

The maximum number of collision group objects has been reached.

TRUE

InterfaceInvalid

11

The provided interface is invalid (null).

TRUE

CollisionObjectTypeInvalid

16

The provided collision object type is invalid.

OK

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

MaxNumberOfCollisionGroupObjectsReached

Enumeration name:

MaxNumberOfCollisionGroupObjectsReached

Enumeration value:

31

Description:

The maximum number of collision group objects has been reached.

Issue

Cause

Solution

Could not add a collision object to the group.

The number of stored collision objects udiNumberOfCollisionObject is equal to Gc_udiMaxNumberOfCollisionGroupObjects.

Verify if udiNumberOfCollisionObject < Gc_udiMaxNumberOfCollisionGroupObjects before trying to add a collision object to the group.

InterfaceInvalid

Enumeration name:

InterfaceInvalid

Enumeration value:

11

Description:

The provided interface is invalid (null).

Issue

Cause

Solution

Could not add a collision object to the group.

i_ifCollisionObject contains an invalid interface

Make sure that i_ifCollisionObject is not null.

CollisionObjectTypeInvalid

Enumeration name:

CollisionObjectTypeInvalid

Enumeration value:

16

Description:

The provided collision object type is invalid.

Issue

Cause

Solution

Could not add a collision object to the group.

i_ifCollisionObject.etType contains a not supported object type.

Make sure that i_ifCollisionObject.etType has one of the following types:

  • ET_CollisionObjectType.AABB

  • ET_CollisionObjectType.OBB

  • ET_CollisionObjectType.Sphere

  • ET_CollisionObjectType.Capsule