WSF
WsfKinematicOffsetTargetPoint.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFPOSITIONOFFSETTARGETPOINT_HPP
13#define WSFPOSITIONOFFSETTARGETPOINT_HPP
14
15#include "wsf_space_export.h"
16
17#include <memory>
18
19#include "UtCloneablePtr.hpp"
20#include "UtOrbitalState.hpp"
22
23namespace wsf
24{
25namespace space
26{
28class WSF_SPACE_EXPORT KinematicOffsetTargetPoint : public OrbitalTargetPoint
29{
30public:
31 explicit KinematicOffsetTargetPoint(std::unique_ptr<OrbitalTargetPoint> aPointPtr);
34 ~KinematicOffsetTargetPoint() override = default;
35
36 void Update(const UtCalendar& aEpoch) override;
37 ut::OrbitalStateVector GetOrbitalStateVectorInertial() const override;
38 UtCalendar GetEpoch() const override;
39 double GetCharacteristicTime() const override;
40
42 void SetPositionOffset(const UtVec3d& aPositionOffset) { mPositionOffset = aPositionOffset; }
43
45 const UtVec3d& GetPositionOffset() const { return mPositionOffset; }
46
48 void SetVelocityOffset(const UtVec3d& aVelocityOffset) { mVelocityOffset = aVelocityOffset; }
49
51 const UtVec3d& GetVelocityOffset() const { return mVelocityOffset; }
52
54 const OrbitalTargetPoint& GetParentPoint() const { return *mParentPtr; }
55
57 const OrbitalTargetPoint& GetBasePoint() const { return *mBasePtr; }
58
59private:
60 void UpdateBase();
61
62 // The parent pointer is OrbitalTargetPoint that provides the position and velocity
63 // off of which this kinematic offset is computed, but the mBasePtr provides the
64 // kinematics of the object for computing the frame. This split allows for multiple
65 // kinematic offsets to be added onto a single target that use frames consistent with
66 // the original target.
67
68 ut::CloneablePtr<OrbitalTargetPoint> mParentPtr{nullptr};
69 const OrbitalTargetPoint* mBasePtr{nullptr};
70 UtVec3d mPositionOffset{};
71 UtVec3d mVelocityOffset{};
72};
73
74} // namespace space
75} // namespace wsf
76
77#endif // WSFPOSITIONOFFSETTARGETPOINT_HPP
aObjectPtr Update(simTime)
~KinematicOffsetTargetPoint() override=default
const UtVec3d & GetPositionOffset() const
Get the position offset in meters.
Definition WsfKinematicOffsetTargetPoint.hpp:45
double GetCharacteristicTime() const override
Definition WsfKinematicOffsetTargetPoint.cpp:54
ut::OrbitalStateVector GetOrbitalStateVectorInertial() const override
Return the combined inertial position and velocity of this point at this object's current epoch.
Definition WsfKinematicOffsetTargetPoint.cpp:44
void SetPositionOffset(const UtVec3d &aPositionOffset)
Set the position offset in meters.
Definition WsfKinematicOffsetTargetPoint.hpp:42
KinematicOffsetTargetPoint & operator=(const KinematicOffsetTargetPoint &aOther)=delete
const OrbitalTargetPoint & GetBasePoint() const
Get the point from which the reference frame is computed.
Definition WsfKinematicOffsetTargetPoint.hpp:57
UtCalendar GetEpoch() const override
Return the current epoch of this point.
Definition WsfKinematicOffsetTargetPoint.cpp:49
const OrbitalTargetPoint & GetParentPoint() const
Get the point from to which the offset is added.
Definition WsfKinematicOffsetTargetPoint.hpp:54
KinematicOffsetTargetPoint(std::unique_ptr< OrbitalTargetPoint > aPointPtr)
Definition WsfKinematicOffsetTargetPoint.cpp:20
const UtVec3d & GetVelocityOffset() const
Get the velocity offset in meters per second.
Definition WsfKinematicOffsetTargetPoint.hpp:51
void SetVelocityOffset(const UtVec3d &aVelocityOffset)
Set the velocity offset in meters per second.
Definition WsfKinematicOffsetTargetPoint.hpp:48
Definition WsfAtmosphere.cpp:23
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved