FB_OBBSetCenterHalfExtentsOrientation (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

This chapter provides information on:

Task

Sets the center, half extents and orientation.

Description

This method is used to initialize an OBB object by setting its center, half extents and orientation. The resulting list of vertices is evaluated accordingly.

This method can be called multiple times to reconfigure the object.

NOTE: The function GEM.FC_OrientationToRotationMatrix can be used for the conversion of the orientation from a roll, pitch and yaw representation to a 3D rotation matrix representation required by i_stOrientation.

Interface

The function block implements the interface IF_OBB.

Access: PUBLIC

Input

Data type

Description

i_stCenter

SE_Math.ST_Vector3D

The center of the OBB bounding volume.

i_stHalfExtents

SE_Math.ST_Vector3D

Each element of this 3D vector represents the half extents of the OBB object along the X-, Y- and Z-axes of the OBB frame.

i_stOrientation

SE_Math.ST_Matrix3D

Orientation of the OBB described as a rotation matrix.

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.

i_stCenter

Describes the position of the center of the OBB with reference to a global coordinate system.

The following figure shows the position of the center of an OBB object.

i_stOrientation

Describes the orientation of the OBB with reference to a global coordinate system.

The following figure shows the orientation of an OBB object:

The following figure is a representation of the i_stHalfExtents parameters (XZ-plane view):

The following figure is a representation of the i_stHalfExtents parameters (XY-plane view):

Diagnostic Messages

q_xError

q_etResult

Enumeration value

Description

FALSE

OK

0

Success

TRUE

HalfExtentsRange

3

The provided value for the half extents is outside the admissible range.

OK

Enumeration name:

Ok

Enumeration value:

0

Description:

Success

HalfExtentsRange

Enumeration name:

HalfExtentsRange

Enumeration value:

3

Description:

The provided value for the half extents is outside the admissible range.

Issue

Cause

Solution

Could not set center and half extents.

At least one of the values of i_stHalfExtents is either negative or zero.

Make sure that:

  • i_stHalfExtents.lrX > 0.0

  • i_stHalfExtents.lrY > 0.0

  • i_stHalfExtents.lrZ > 0.0