DART  6.10.1
ShapeFrameAspect.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2021, The DART development contributors
3  * All rights reserved.
4  *
5  * The list of contributors can be found at:
6  * https://github.com/dartsim/dart/blob/master/LICENSE
7  *
8  * This file is provided under the following "BSD-style" License:
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef DART_DYNAMICS_DETAIL_SHAPEFRAMEASPECT_HPP_
34 #define DART_DYNAMICS_DETAIL_SHAPEFRAMEASPECT_HPP_
35 
36 #include <Eigen/Core>
37 
40 
41 namespace dart {
42 namespace dynamics {
43 
44 class VisualAspect;
45 class CollisionAspect;
46 class DynamicsAspect;
47 class ShapeFrame;
48 
49 namespace detail {
50 
52 {
54  Eigen::Vector4d mRGBA;
55 
57 
59  bool mHidden;
60 
62  bool mShadowed;
63 
66  const Eigen::Vector4d& color = Eigen::Vector4d(0.5, 0.5, 1.0, 1.0),
67  const bool hidden = false,
68  const bool shadowed = true);
69 
71  virtual ~VisualAspectProperties() = default;
72 
73  // To get byte-aligned Eigen vectors
74  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
75 };
76 
78 {
81 
83  CollisionAspectProperties(const bool collidable = true);
84 
86  virtual ~CollisionAspectProperties() = default;
87 };
88 
90 {
93 
96 
99 
102 
105 
107  Eigen::Vector3d mFirstFrictionDirection;
108 
112 
117  const double frictionCoeff = 1.0, const double restitutionCoeff = 0.0);
118 
134  const double primaryFrictionCoeff,
135  const double secondaryFrictionCoeff,
136  const double restitutionCoeff,
137  const double primarySlipCompliance = -1.0,
138  const double secondarySlipCompliance = -1.0,
139  const Eigen::Vector3d& firstFrictionDirection = Eigen::Vector3d::Zero(),
140  const Frame* firstFrictionDirectionFrame = nullptr);
141 
143  virtual ~DynamicsAspectProperties() = default;
144 };
145 
147 {
150 
152  ShapeFrameProperties(const ShapePtr& shape = nullptr);
153 
155  virtual ~ShapeFrameProperties() = default;
156 };
157 
159  ShapeFrame,
161  common::
162  SpecializedForAspect<VisualAspect, CollisionAspect, DynamicsAspect> >;
163 
164 } // namespace detail
165 } // namespace dynamics
166 } // namespace dart
167 
168 #endif // DART_DYNAMICS_DETAIL_SHAPEFRAMEASPECT_HPP_
This is an alternative to EmbedProperties which allows your class to also inherit other Composite obj...
Definition: EmbeddedAspect.hpp:240
The Frame class serves as the backbone of DART's kinematic tree structure.
Definition: Frame.hpp:58
Definition: ShapeFrame.hpp:192
std::shared_ptr< Shape > ShapePtr
Definition: SmartPointer.hpp:81
Definition: BulletCollisionDetector.cpp:65
Definition: ShapeFrameAspect.hpp:78
virtual ~CollisionAspectProperties()=default
Destructor.
bool mCollidable
This object is collidable if true.
Definition: ShapeFrameAspect.hpp:80
CollisionAspectProperties(const bool collidable=true)
Constructor.
Definition: ShapeFrame.cpp:49
Definition: ShapeFrameAspect.hpp:90
virtual ~DynamicsAspectProperties()=default
Destructor.
const Frame * mFirstFrictionDirectionFrame
First friction direction frame The first friction direction unit vector is expressed in this frame.
Definition: ShapeFrameAspect.hpp:111
double mSecondarySlipCompliance
Secondary slip compliance coefficient.
Definition: ShapeFrameAspect.hpp:104
double mSecondaryFrictionCoeff
Secondary coefficient of friction.
Definition: ShapeFrameAspect.hpp:98
double mRestitutionCoeff
Coefficient of restitution.
Definition: ShapeFrameAspect.hpp:95
double mPrimarySlipCompliance
Primary slip compliance coefficient.
Definition: ShapeFrameAspect.hpp:101
double mFrictionCoeff
Primary coefficient of friction.
Definition: ShapeFrameAspect.hpp:92
Eigen::Vector3d mFirstFrictionDirection
First friction direction unit vector.
Definition: ShapeFrameAspect.hpp:107
DynamicsAspectProperties(const double frictionCoeff=1.0, const double restitutionCoeff=0.0)
Constructors The frictionCoeff argument will be used for both primary and secondary friction.
Definition: ShapeFrame.cpp:56
Definition: ShapeFrameAspect.hpp:147
ShapePtr mShape
Pointer to a shape.
Definition: ShapeFrameAspect.hpp:149
ShapeFrameProperties(const ShapePtr &shape=nullptr)
Constructor.
Definition: ShapeFrame.cpp:90
virtual ~ShapeFrameProperties()=default
Virtual destructor.
Definition: ShapeFrameAspect.hpp:52
Eigen::Vector4d mRGBA
Color for the primitive shape.
Definition: ShapeFrameAspect.hpp:54
virtual ~VisualAspectProperties()=default
Destructor.
bool mShadowed
True if this shape node should be shadowed.
Definition: ShapeFrameAspect.hpp:62
VisualAspectProperties(const Eigen::Vector4d &color=Eigen::Vector4d(0.5, 0.5, 1.0, 1.0), const bool hidden=false, const bool shadowed=true)
Constructor.
Definition: ShapeFrame.cpp:41
bool mHidden
True if this shape node should be kept from rendering.
Definition: ShapeFrameAspect.hpp:59
bool mUseDefaultColor
Definition: ShapeFrameAspect.hpp:56