##

MeshShape.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_PHYSICS_MESHSHAPE_HH_
#define GAZEBO_PHYSICS_MESHSHAPE_HH_
#include <string>
#include "gazebo/common/CommonTypes.hh"
#include "gazebo/physics/PhysicsTypes.hh"
#include "gazebo/physics/Shape.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class GZ_PHYSICS_VISIBLE MeshShape : public Shape
{
public: explicit MeshShape(CollisionPtr _parent);
public: virtual ~MeshShape();
public: virtual void Update() {}
public: virtual void Init();
public: virtual ignition::math::Vector3d Size() const;
public: std::string GetMeshURI() const;
public: void SetMesh(const std::string &_uri,
const std::string &_submesh = "",
bool _center = false);
public: void SetScale(const ignition::math::Vector3d &_scale);
public: void FillMsg(msgs::Geometry &_msg);
public: virtual void ProcessMsg(const msgs::Geometry &_msg);
protected: const common::Mesh *mesh;
protected: common::SubMesh *submesh;
};
}
}
#endif
gazebo::physics::MeshShape::MeshShape
MeshShape(CollisionPtr _parent)
Constructor.
gazebo::physics::MeshShape::mesh
const common::Mesh * mesh
Pointer to the mesh data.
Definition: MeshShape.hh:82
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::MeshShape::SetScale
void SetScale(const ignition::math::Vector3d &_scale)
Set the scaling factor.
system.hh
CommonTypes.hh
gazebo::common::SubMesh
A child mesh.
Definition: Mesh.hh:214
PhysicsTypes.hh
default namespace for gazebo
gazebo::physics::MeshShape::~MeshShape
virtual ~MeshShape()
Destructor.
gazebo::physics::MeshShape::SetMesh
void SetMesh(const std::string &_uri, const std::string &_submesh="", bool _center=false)
Set the mesh uri and submesh name.
gazebo::physics::MeshShape::Update
virtual void Update()
Update the tri mesh.
Definition: MeshShape.hh:46
gazebo::physics::MeshShape::FillMsg
void FillMsg(msgs::Geometry &_msg)
Populate a msgs::Geometry message with data from this shape.
Shape.hh
gazebo::physics::MeshShape::ProcessMsg
virtual void ProcessMsg(const msgs::Geometry &_msg)
Update this shape from a message.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::MeshShape
Triangle mesh collision shape.
Definition: MeshShape.hh:36
gazebo::physics::MeshShape::Size
virtual ignition::math::Vector3d Size() const
Get the size of the triangle mesh.
gazebo::common::Mesh
A 3D mesh.
Definition: Mesh.hh:42
gazebo::physics::CollisionPtr
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
gazebo::physics::MeshShape::GetMeshURI
std::string GetMeshURI() const
Get the URI of the mesh data.
gazebo::physics::Shape
Base class for all shapes.
Definition: Shape.hh:39
gazebo::physics::MeshShape::submesh
common::SubMesh * submesh
The submesh to use from within the parent mesh.
Definition: MeshShape.hh:85
gazebo::physics::MeshShape::Init
virtual void Init()
Initialize the shape.