Main Content


Class: Aero.Camera
Namespace: Aero

Update camera position based on time and position of other Aero.Body objects




update(h,newtime,bodies) updates the position and aim point data of the camera object, h based on the new time, newtime, and the position of other Aero.Body objects specified by bodies. This function updates the camera object PrevTime property to newtime.

Input Arguments

expand all

Camera object, specified as an Aero.Camera object.

New time, specified as a scalar, in seconds.

Data Types: double

Aero.Body objects, specified as a MATLAB array.


expand all

Update the Aero.Camera object position based on the time newTime for the Aero.Body object h.

Create an Aero.Body object.

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

Create an Aero.Camera object.

y = 
  Camera with properties:

    CoordTransformFcn: @nullCoordTransform
          PositionFcn: @doFirstOrderChaseCameraDynamics
             Position: [-150 -50 0]
               Offset: [-150 -50 0]
             AimPoint: [0 0 0]
             UpVector: [0 0 -1]
            ViewAngle: 3
           ViewExtent: [-50 50]
                 xlim: [-50 50]
                 ylim: [-50 50]
                 zlim: [-50 50]
             PrevTime: 0
             UserData: []

Update the position of the camera object y for the body object h.


Version History

Introduced in R2007a

See Also