17#ifndef GAZEBO_PHYSICS_ODE_ODEPLANESHAPE_HH_
18#define GAZEBO_PHYSICS_ODE_ODEPLANESHAPE_HH_
45 PlaneShape::CreatePlane();
48 boost::dynamic_pointer_cast<ODECollision>(this->collisionParent);
49 ignition::math::Pose3d pose = oParent->WorldPose();
50 double altitude = pose.Pos().Z();
51 ignition::math::Vector3d n = this->Normal();
52 if (oParent->GetCollisionId() ==
nullptr)
53 oParent->SetCollision(dCreatePlane(oParent->GetSpaceId(),
54 n.X(), n.Y(), n.Z(), altitude),
false);
56 dGeomPlaneSetParams(oParent->GetCollisionId(),
57 n.X(), n.Y(), n.Z(), altitude);
61 public:
virtual void SetAltitude(
const ignition::math::Vector3d &_pos)
63 PlaneShape::SetAltitude(_pos);
66 boost::dynamic_pointer_cast<ODECollision>(this->collisionParent);
70 dGeomPlaneGetParams(odeParent->GetCollisionId(), vec4);
73 vec4[3] = vec4[0] * _pos.X() + vec4[1] * _pos.Y() + vec4[2] * _pos.Z();
75 dGeomPlaneSetParams(odeParent->GetCollisionId(), vec4[0], vec4[1],
An ODE Plane shape.
Definition ODEPlaneShape.hh:33
virtual void SetAltitude(const ignition::math::Vector3d &_pos)
Set the altitude of the plane.
Definition ODEPlaneShape.hh:61
virtual ~ODEPlaneShape()
Destructor.
Definition ODEPlaneShape.hh:40
ODEPlaneShape(CollisionPtr _parent)
Constructor.
Definition ODEPlaneShape.hh:36
virtual void CreatePlane()
Create the plane.
Definition ODEPlaneShape.hh:43
Collision for an infinite plane.
Definition PlaneShape.hh:38
virtual void SetAltitude(const ignition::math::Vector3d &_pos)
Set the altitude of the plane.
ignition::math::Vector3d Normal() const
Get the plane normal.
virtual void CreatePlane()
Create the plane.
CollisionPtr collisionParent
This shape's collision parent.
Definition Shape.hh:73
boost::shared_ptr< ODECollision > ODECollisionPtr
Definition ODETypes.hh:39
boost::shared_ptr< Collision > CollisionPtr
Definition PhysicsTypes.hh:113
Forward declarations for the common classes.
Definition Animation.hh:27