Main Content

Aero.Body Class

Namespace: Aero

Create body object for use with animation object

Description

Use the Aero.Body class to create a body object for use with an Aero.Animation object. To use the Aero.Body object, you typically:

  1. Create the animation body.

  2. Configure or customize the body object.

  3. Load the body.

  4. Generate patches for the body. This step requires an axes from a figure.

  5. Set the timeseries data source.

  6. Move or update the body.

By default, an Aero.Body object natively uses aircraft x-y-z coordinates for the body geometry and the timeseries data. It expects the rotation order z-y-x (psi, theta, phi).

Convert timeseries data from other coordinate systems by registering a different CoordTransformFcn function.

The Aero.Body class is a handle class.

Creation

h = Aero.Body constructs a body for an animation object. The animation object is returned in h.

Properties

expand all

Name of body, specified as a character vector or string scalar.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

Function that controls coordinate transformation, specified as a function handle, character vector, or string scalar.

Attributes:

GetAccess
public
SetAccess
public

Position of body, specified as a MATLAB array.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Rotation of body, specified as a MATLAB array.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Geometry of body, specified as a handle.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Patch generation function, specified as a function handle, character vector, or string scalar.

Attributes:

GetAccess
public
SetAccess
public

Patch handles, specified as a MATLAB array.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Viewing transform, specified as a scalar.

Attributes:

GetAccess
public
SetAccess
public

Time series source, specified as a time series source.

The time series data property stored in and interpreted according to the 'TimeSeriesSourceType' property.

Attributes:

GetAccess
public
SetAccess
public

Type of timeseries data stored in 'TimeSeriesSource' property, specified as one of these values:

timeseries TypeDescription

'Array6DoF'

A double-precision array in n rows and seven columns for 6-DoF data: time x y z phi theta psi. If a double-precision array of eight or more columns is in 'TimeSeriesSource', the first seven columns are used as 6-DoF data.

'Timeseries'

MATLAB timeseries data with six values per time:

x y z phi theta psi

The values are resampled.

'Timetable'

MATLAB timetable data with six values per time:

x y z phi theta psi

The values are resampled.

'StructureWithTime'

Simulink struct with time, for example, Simulink root outport logging 'Structure with time':

  • signals(1).values: x y z

  • signals(2).values: phi theta psi

Signals are linearly interpolated versus time using interp1.

'Array3DoF'

A double-precision array in n rows and four columns for 3-DoF data: time x z theta. If a double-precision array of five or more columns is in 'TimeSeriesSource', the first four columns are used as 3-DoF data.

'Custom'

Position and angle data are retrieved from 'TimeSeriesSource' by the currently registered 'TimeseriesReadFcn'.

Attributes:

GetAccess
public
SetAccess
public

Data Types: string | char

timeseries read function, specified as a function handle, character vector, or string.

Attributes:

GetAccess
public
SetAccess
public

Methods

expand all

Examples

collapse all

h = Aero.Body
h = 
  Body with properties:

                    Name: ''
       CoordTransformFcn: @nullCoordTransform
                Position: [0 0 0]
                Rotation: [0 0 0]
                Geometry: [1x1 Aero.Geometry]
      PatchGenerationFcn: @generatePatchesFromFvcData
            PatchHandles: []
        ViewingTransform: []
        TimeSeriesSource: []
    TimeSeriesSourceType: 'Array6DoF'
       TimeSeriesReadFcn: @interp6DoFArrayWithTime

This example shows how to update the body, b, with time in seconds of 5.

b = Aero.Body;
b.load('pa24-250_orange.ac','Ac3d'); 
tsdata = [ ...
    0,  1,1,1, 0,0,0; ...
    10  2,2,2, 1,1,1; ];
b.TimeSeriesSource = tsdata;
b.update(5);

Version History

Introduced in R2007a