NvBlastTkJointImpl.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
27 
28 
29 #ifndef NVBLASTTKJOINTIMPL_H
30 #define NVBLASTTKJOINTIMPL_H
31 
32 
33 #include "NvBlastTkJoint.h"
34 #include "NvBlastTkCommon.h"
35 #include "NvBlastIndexFns.h"
36 
37 #include "NvBlastAssert.h"
38 #include "NvBlastDLink.h"
39 
40 #include <atomic>
41 
42 
43 namespace Nv
44 {
45 namespace Blast
46 {
47 
48 // Forward declarations
49 class TkActorImpl;
50 class TkJointImpl;
51 class TkFamilyImpl;
52 class TkEventQueue;
53 
54 
58 struct TkJointLink : public DLink
59 {
61 };
62 
63 
67 class TkJointImpl : public TkJoint
68 {
69 public:
71  TkJointImpl();
72 
79  TkJointImpl(const TkJointDesc& desc, TkFamilyImpl* owner);
80 
81  // Begin TkObject
82  virtual void release() override;
83  // End TkObject
84 
85  // Begin TkJoint
86  virtual const TkJointData getData() const override;
87  // End TkJoint
88 
89  // Public API
90 
96  const TkJointData& getDataInternal() const;
97 
103  TkJointData& getDataWritable();
104 
117  void setActors(TkActorImpl* actor0, TkActorImpl* actor1, TkEventQueue* alternateQueue = nullptr);
118 
122  void removeReferencesInActors();
123 
128  void removeReferencesInFamilies();
129 
130 private:
131  TkJointData m_data;
132  TkJointLink m_links[2];
133  TkFamilyImpl* m_owner;
134 
135  friend class TkFrameworkImpl;
136  friend class TkFamilyImpl;
137  friend class TkActorImpl;
138 };
139 
140 
142 
144 {
145  m_links[0].m_joint = m_links[1].m_joint = this;
146 }
147 
148 
150 {
151  return m_data;
152 }
153 
154 
156 {
157  return m_data;
158 }
159 
160 } // namespace Blast
161 } // namespace Nv
162 
163 
164 #endif // ifndef NVBLASTTKJOINTIMPL_H
const TkJointData & getDataInternal() const
Definition: NvBlastTkJointImpl.h:149
Definition: NvBlastTkActorImpl.h:75
Definition: NvBlastTkJoint.h:63
Definition: NvBlastTkFramework.h:130
TkJointData & getDataWritable()
Definition: NvBlastTkJointImpl.h:155
#define NV_INLINE
Definition: NvPreprocessor.h:350
Definition: NvBlastTkEventQueue.h:61
Definition: NvBlastTkFrameworkImpl.h:54
TkJointImpl()
Definition: NvBlastTkJointImpl.h:143
Definition: NvBlastTkJointImpl.h:67
Definition: NvBlastArray.h:37
Definition: NvBlastTkJoint.h:45