Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tpelib::Shape::GetSize() and tpelib::Model::GetCanonicalLink() #45

Merged
merged 2 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tpe/lib/src/Model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ Entity &Model::AddLink()
return *it->second.get();
}

//////////////////////////////////////////////////
Entity &Model::GetCanonicalLink()
{
// return first link as canonical link
return *this->GetChildren().begin()->second;
}


//////////////////////////////////////////////////
void Model::SetLinearVelocity(const math::Vector3d _velocity)
{
Expand Down
2 changes: 2 additions & 0 deletions tpe/lib/src/Model.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE Model : public Entity
/// \return Newly created Link
public: Entity &AddLink();

public: Entity &GetCanonicalLink();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add doxygen comment for this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/// \brief Set the linear velocity of model
/// \param[in] _velocity linear velocity
public: void SetLinearVelocity(const math::Vector3d _velocity);
Expand Down
6 changes: 6 additions & 0 deletions tpe/lib/src/Shape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ void BoxShape::SetSize(const math::Vector3d &_size)
this->dirty = true;
}

//////////////////////////////////////////////////
math::Vector3d BoxShape::GetSize()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a simple check here in Shape_TEST.cc to test this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
return this->size;
}

//////////////////////////////////////////////////
void BoxShape::UpdateBoundingBox()
{
Expand Down