Skip to content

Commit

Permalink
Improve template
Browse files Browse the repository at this point in the history
Signed-off-by: Diego Ferigo <diego.ferigo@iit.it>
  • Loading branch information
diegoferigo committed May 18, 2020
1 parent 3c8c68b commit 21edcba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/ignition/physics/GetContacts.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ namespace physics
class IGNITION_PHYSICS_VISIBLE GetContactsFromLastStepFeature
: public virtual FeatureWithRequirements<ForwardStep>
{
public: template <typename VectorType, typename Scalar>
public: template <typename PolicyT>
struct ExtraContactDataT
{
using Scalar = typename PolicyT::Scalar;
using VectorType = typename FromPolicy<PolicyT>::template Use<Vector>;

/// \brief The contact force from body acting on the first body
/// expressed in the world frame
VectorType force;
Expand All @@ -53,7 +56,7 @@ class IGNITION_PHYSICS_VISIBLE GetContactsFromLastStepFeature
public: using ShapePtrType = ShapePtr<PolicyT, FeaturesT>;
public: using VectorType =
typename FromPolicy<PolicyT>::template Use<Vector>;
public: using ExtraContactData = ExtraContactDataT<VectorType, Scalar>;
public: using ExtraContactData = ExtraContactDataT<PolicyT>;

public: struct ContactPoint
{
Expand All @@ -79,7 +82,7 @@ class IGNITION_PHYSICS_VISIBLE GetContactsFromLastStepFeature
public: using Scalar = typename PolicyT::Scalar;
public: using VectorType =
typename FromPolicy<PolicyT>::template Use<Vector>;
public: using ExtraContactData = ExtraContactDataT<VectorType, Scalar>;
public: using ExtraContactData = ExtraContactDataT<PolicyT>;

public: struct ContactInternal
{
Expand Down

0 comments on commit 21edcba

Please sign in to comment.