pinocchio  3.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
 
Loading...
Searching...
No Matches
broadphase-manager-base.hpp
1//
2// Copyright (c) 2022 INRIA
3//
4
5#ifndef __pinocchio_collision_broadphase_manager_base_hpp__
6#define __pinocchio_collision_broadphase_manager_base_hpp__
7
8#include "pinocchio/multibody/geometry.hpp"
9#include "pinocchio/collision/broadphase-callbacks.hpp"
10
11namespace pinocchio
12{
13
14 template<typename Derived>
16 {
24
35
43
45 operator=(const BroadPhaseManagerBase & other) // Copy assignment operator
46 {
47 model_ptr = other.model_ptr;
48 geometry_model_ptr = other.geometry_model_ptr;
49 geometry_data_ptr = other.geometry_data_ptr;
50 return *this;
51 }
52
53 Derived & derived()
54 {
55 return static_cast<Derived &>(*this);
56 }
57 const Derived & derived() const
58 {
59 return static_cast<const Derived &>(*this);
60 }
61
64 bool check() const
65 {
66 return derived().check();
67 }
68
70 bool check(CollisionCallBackBase * callback) const
71 {
72 return derived().check(callback);
73 }
74
82 void update(bool compute_local_aabb = false)
83 {
84 derived().update(compute_local_aabb);
85 }
86
93 {
94 derived().update(geom_data_ptr_new);
95 }
96
100 {
101 return derived().collide(obj, callback);
102 }
103
105 bool collide(CollisionCallBackBase * callback) const
106 {
107 return derived().collide(callback);
108 }
109
112 {
113 return derived().collide(other_manager.derived(), callback);
114 }
115
116 // /// @brief Performs distance computation between one object and all the objects belonging to
117 // the manager void distance(CollisionObject* obj, DistanceCallBackBase * callback) const;
118
119 // /// @brief Performs distance test for the objects belonging to the manager (i.e., N^2 self
120 // distance) void distance(DistanceCallBackBase * callback) const;
121
122 // /// @brief Performs distance test with objects belonging to another manager
123 // void distance(BroadPhaseCollisionManager* other_manager, DistanceCallBackBase * callback)
124 // const;
125
127 const Model & getModel() const
128 {
129 return *model_ptr;
130 }
131
134 {
135 return *geometry_model_ptr;
136 }
137
140 {
141 return *geometry_data_ptr;
142 }
143
146 {
147 return *geometry_data_ptr;
148 }
149
150 protected:
153
156
159
160 }; // struct BroadPhaseManagerBase<Derived>
161
162} // namespace pinocchio
163
164#endif // ifndef __pinocchio_collision_broadphase_manager_base_hpp__
Main pinocchio namespace.
Definition treeview.dox:11
void update(GeometryData *geom_data_ptr_new)
Update the manager with a new geometry data.
const GeometryData & getGeometryData() const
Returns the geometry data associated to the manager.
bool collide(CollisionObject &obj, CollisionCallBackBase *callback) const
Performs collision test between one object and all the objects belonging to the manager.
BroadPhaseManagerBase(const Model *model_ptr, const GeometryModel *geometry_model_ptr, GeometryData *geometry_data_ptr)
Constructor from a given geometry model and geometry data.
BroadPhaseManagerBase(const BroadPhaseManagerBase &other)
Copy constructor.
const GeometryModel * geometry_model_ptr
Pointer to the geometry model.
const Model & getModel() const
Returns the model associated to the manager.
const Model * model_ptr
Pointer to the model.
GeometryData * geometry_data_ptr
Pointer to the geometry data.
bool check() const
Check whether the base broad phase manager is aligned with the current collision_objects.
bool check(CollisionCallBackBase *callback) const
Check whether the callback is inline with *this.
bool collide(BroadPhaseManagerBase &other_manager, CollisionCallBackBase *callback) const
Performs collision test with objects belonging to another manager.
GeometryData & getGeometryData()
Returns the geometry data associated to the manager.
const GeometryModel & getGeometryModel() const
Returns the geometry model associated to the manager.
void update(bool compute_local_aabb=false)
Update the manager from the current geometry positions and update the underlying FCL broad phase mana...
bool collide(CollisionCallBackBase *callback) const
Performs collision test for the objects belonging to the manager.
Interface for Pinocchio collision callback functors.