Documentation ¶
Index ¶
- Constants
- Variables
- type Coordinates
- type Object
- func (o *Object) GetAngle(property string) (unit.Angle, error)
- func (o *Object) GetCoordinates(referenceLongitude, referenceLatitude float64) (*Coordinates, error)
- func (o *Object) GetLength(property string) (unit.Length, error)
- func (o *Object) GetProperty(p string) (string, bool)
- func (o *Object) GetSpeed(property string) (unit.Speed, error)
- func (o *Object) GetTypes() ([]string, error)
- func (o *Object) SetProperty(p, v string)
- func (o *Object) String() string
- func (o *Object) Update(update *Update, referenceLongitude, referenceLatitude float64) error
- type Update
Constants ¶
const GlobalObjectID = 0
Variables ¶
var ErrNotFound = errors.New("property not found")
ErrNotFound indicates that a property is missing.
var ErrParseFailure = errors.New("error parsing object")
ErrParseFailure indicates that a property is present but failed to parse.
Functions ¶
This section is empty.
Types ¶
type Coordinates ¶
type Coordinates struct { // Longitude. This is the object's actual longitude, after applying any reference longitude. Longitude *float64 // Latitude. This is the object's actual latitude, after applying any reference latitude. Latitude *float64 // Altitude above sea level Altitude *unit.Length // X is the object's native coordinate within the sim X *float64 // Y is the object's native coordiante within the sim Y *float64 // Roll angle Roll *unit.Angle // Pitch angle Pitch *unit.Angle // Yaw angle (this may be different from heading) Yaw *unit.Angle // Heading is the object's flat earth heading Heading *unit.Angle }
Coordinates models the position and orientation of an object within ACMI data.
func NewCoordinates ¶
func NewCoordinates( longitude, latitude *float64, altitude *unit.Length, x, y *float64, roll, pitch, yaw, heading *unit.Angle, ) *Coordinates
NewCoordinates instantiates Coordinates with the given values.
func (*Coordinates) Parse ¶
func (c *Coordinates) Parse(transform string, referenceLongitude float64, referenceLatitude float64) error
Parse reads the value of a Transform property and updates the coordinates accordingly. The referenceLongitude and referenceLatitude parameters must be the reference point from the global properties.
func (*Coordinates) Transform ¶
func (c *Coordinates) Transform(referenceLongitude float64, referenceLatitude float64) string
Transform serializes the coordinates into a coordinate transformation suitable for use in the Transform property in an ACMI object update. The referenceLongitude and referenceLatitude parameters must be the reference point in the global properties.
func (*Coordinates) Update ¶
func (c *Coordinates) Update(next *Coordinates)
Update updates the coordinates with the values from the next coordinates.
type Object ¶
Object models the ID and properties of an object within ACMI data.
func (*Object) GetCoordinates ¶
func (o *Object) GetCoordinates(referenceLongitude, referenceLatitude float64) (*Coordinates, error)
GetCoordinates returns the coordinates of the object, if possible. Objects may have insufficient information to determine their coordinates. In such a case, the function returns nil and no error. The referenceLongitude and referenceLatitude are the reference point from the global properties.
func (*Object) GetLength ¶
GetLength is a helper to read the given property as a length or distance.
func (*Object) SetProperty ¶
func (*Object) Update ¶
Update applies the given update to the object. If the update contains a coordinate transformation, the object's coordinates are updated. Other properties in the update are merged into the object's properties. The referenceLongitude and referenceLatitude are the reference point from the global properties.