33 #ifndef DART_COLLISION_DETAIL_COLLISIONGROUP_HPP_
34 #define DART_COLLISION_DETAIL_COLLISIONGROUP_HPP_
45 template <
typename... Others>
55 template <
typename... Others>
57 const std::vector<const dynamics::ShapeFrame*>& shapeFrames,
58 const Others*... others)
66 template <
typename... Others>
72 if (otherGroup &&
this != otherGroup)
82 template <
typename... Others>
88 auto collisionShapeNodes
91 for (
auto& shapeNode : collisionShapeNodes)
98 template <
typename... Others>
105 for (
auto i = 0u; i < numBodyNodes; ++i)
112 template <
typename... Others>
115 const Others&... others)
118 BodyNodeSources::value_type(
127 const auto collisionShapeNodes =
130 for (
const auto& shapeNode : collisionShapeNodes)
132 entry->second.mObjects.insert(
141 template <
typename... Others>
144 const Others&... others)
147 SkeletonSources::value_type(
156 const std::size_t numBodies = skeleton->getNumBodyNodes();
157 for (std::size_t i = 0u ; i < numBodies; ++i)
161 const auto& collisionShapeNodes =
164 auto& childInfo = entry.
mChildren.insert(
168 for (
const auto& shapeNode : collisionShapeNodes)
172 childInfo.mFrames.insert(shapeNode);
181 template <
typename... Others>
191 template <
typename... Others>
193 const std::vector<const dynamics::ShapeFrame*>& shapeFrames,
194 const Others*... others)
202 template <
typename... Others>
210 if (
this == otherGroup)
224 template <
typename... Others>
230 auto collisionShapeNodes
233 for (
auto& shapeNode : collisionShapeNodes)
240 template <
typename... Others>
247 for (
auto i = 0u; i < numBodyNodes; ++i)
254 template <
typename... Others>
257 const Others*... others)
262 for(
const auto& entry : it->second.mObjects)
272 template <
typename... Others>
275 const Others*... others)
280 for(
const auto& entry : it->second.mObjects)
Definition: CollisionGroup.hpp:51
void addShapeFramesOf()
Do nothing.
Definition: CollisionGroup.cpp:80
void subscribeTo()
Do nothing.
Definition: CollisionGroup.cpp:86
void removeShapeFrames(const std::vector< const dynamics::ShapeFrame * > &shapeFrames)
Remove ShapeFrames from this CollisionGroup.
Definition: CollisionGroup.cpp:130
void addShapeFrames(const std::vector< const dynamics::ShapeFrame * > &shapeFrames)
Add ShapeFrames to this CollisionGroup.
Definition: CollisionGroup.cpp:72
SkeletonSources mSkeletonSources
Skeleton sources that this group is subscribed to.
Definition: CollisionGroup.hpp:512
void unsubscribeFrom(const dynamics::BodyNode *bodyNode, const Others *... others)
Unsubscribe from bodyNode.
Definition: CollisionGroup.hpp:255
ObjectInfo * addShapeFrameImpl(const dynamics::ShapeFrame *shapeFrame, const void *source)
Implementation of addShapeFrame.
Definition: CollisionGroup.cpp:329
void removeAllShapeFrames()
Remove all the ShapeFrames in this CollisionGroup.
Definition: CollisionGroup.cpp:144
void addShapeFrame(const dynamics::ShapeFrame *shapeFrame)
Add a ShapeFrame to this CollisionGroup.
Definition: CollisionGroup.cpp:66
void removeShapeFrame(const dynamics::ShapeFrame *shapeFrame)
Remove a ShapeFrame from this CollisionGroup.
Definition: CollisionGroup.cpp:92
void removeShapeFramesOf()
Do nothing.
Definition: CollisionGroup.cpp:138
void addShapeFramesOf(const dynamics::MetaSkeleton *skeleton, const Others *... others)
Add ShapeFrames of MetaSkeleton, and also add another ShapeFrames of other various objects.
Definition: CollisionGroup.hpp:99
void removeShapeFrameInternal(const dynamics::ShapeFrame *shapeFrame, const void *source)
Internal version of removeShapeFrame.
Definition: CollisionGroup.cpp:368
ObjectInfoList mObjectInfoList
Information about ShapeFrames and CollisionObjects that have been added to this CollisionGroup.
Definition: CollisionGroup.hpp:364
BodyNodeSources mBodyNodeSources
BodyNode sources that this group is susbscribed to.
Definition: CollisionGroup.hpp:515
virtual std::size_t getVersion() const
Get the version number of this object.
Definition: VersionCounter.cpp:61
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:78
const std::vector< ShapeNode * > getShapeNodesWith()
Return the list of ShapeNodes containing given Aspect.
Definition: BodyNode.hpp:217
Definition: ShapeFrame.hpp:119
Definition: ShapeFrame.hpp:164
class Skeleton
Definition: Skeleton.hpp:59
TemplateBodyNodePtr is a templated class that enables users to create a reference-counting BodyNodePt...
Definition: BodyNodePtr.hpp:111
BodyNodeT * get() const
Get the raw BodyNode pointer.
Definition: BodyNodePtr.hpp:164
std::shared_ptr< const Skeleton > ConstSkeletonPtr
Definition: SmartPointer.hpp:60
std::multimap< dart::dynamics::Shape *, SimpleFrameShapeDnD * >::iterator iterator
Definition: Viewer.cpp:622
Definition: BulletCollisionDetector.cpp:63
This is information pertaining to a child of the source.
Definition: CollisionGroup.hpp:459
This struct is used to store sources of ShapeFrames that the CollisionGroup is subscribed to,...
Definition: CollisionGroup.hpp:446
std::unordered_map< const Child *, ChildInfo > mChildren
The last known versions of the children related to this source.
Definition: CollisionGroup.hpp:477
std::unordered_map< const dynamics::ShapeFrame *, ObjectInfo * > mObjects
The set of objects that pertain to this source.
Definition: CollisionGroup.hpp:454