diff --git a/include/gz/rendering/Marker.hh b/include/gz/rendering/Marker.hh index 4342072d8..e7e0f38b6 100644 --- a/include/gz/rendering/Marker.hh +++ b/include/gz/rendering/Marker.hh @@ -68,6 +68,9 @@ namespace gz /// \brief Capsule geometry MT_CAPSULE = 11, + + /// \brief Cone geometry + MT_CONE = 12, }; /// \class Marker Marker.hh gz/rendering/Marker diff --git a/include/gz/rendering/ParticleEmitter.hh b/include/gz/rendering/ParticleEmitter.hh index 2698a3fc2..cd7e78ee7 100644 --- a/include/gz/rendering/ParticleEmitter.hh +++ b/include/gz/rendering/ParticleEmitter.hh @@ -47,8 +47,11 @@ namespace gz /// \brief Ellipsoid emitter. EM_ELLIPSOID = 3, + /// \brief Cone emitter. + EM_CONE = 4, + /// \brief Total number of emitters (keep always at the end). - EM_NUM_EMITTERS = 4, + EM_NUM_EMITTERS = 5, }; /// \class ParticleEmitter ParticleEmitter.hh @@ -86,8 +89,10 @@ namespace gz /// the emmiter type: /// - EM_POINT: The area is ignored. /// - EM_BOX: The area is interpreted as width X height X depth. + /// - EM_CONE: The area is interpreted as the bounding box of the + /// cone. The cone is oriented along the Z-axis. /// - EM_CYLINDER: The area is interpreted as the bounding box of the - /// cilinder. The cylinder is oriented along the Z-axis. + /// cylinder. The cylinder is oriented along the Z-axis. /// - EM_ELLIPSOID: The area is interpreted as the bounding box of an /// ellipsoid shaped area, i.e. a sphere or /// squashed-sphere area. The parameters are again diff --git a/ogre/src/OgreMarker.cc b/ogre/src/OgreMarker.cc index 0375b2dbb..8cb3e22bf 100644 --- a/ogre/src/OgreMarker.cc +++ b/ogre/src/OgreMarker.cc @@ -107,6 +107,7 @@ Ogre::MovableObject *OgreMarker::OgreObject() const return nullptr; case MT_BOX: case MT_CAPSULE: + case MT_CONE: case MT_CYLINDER: case MT_SPHERE: { @@ -184,6 +185,7 @@ void OgreMarker::SetMaterial(MaterialPtr _material, bool _unique) break; case MT_BOX: case MT_CAPSULE: + case MT_CONE: case MT_CYLINDER: case MT_SPHERE: { @@ -257,6 +259,10 @@ void OgreMarker::SetType(MarkerType _markerType) this->dataPtr->geom = std::dynamic_pointer_cast(this->scene->CreateCapsule()); break; + case MT_CONE: + this->dataPtr->geom = + std::dynamic_pointer_cast(this->scene->CreateCone()); + break; case MT_CYLINDER: this->dataPtr->geom = std::dynamic_pointer_cast(this->scene->CreateCylinder()); diff --git a/ogre2/src/Ogre2Marker.cc b/ogre2/src/Ogre2Marker.cc index f63b79225..6c379205b 100644 --- a/ogre2/src/Ogre2Marker.cc +++ b/ogre2/src/Ogre2Marker.cc @@ -155,6 +155,7 @@ Ogre::MovableObject *Ogre2Marker::OgreObject() const return nullptr; case MT_BOX: case MT_CAPSULE: + case MT_CONE: case MT_CYLINDER: case MT_SPHERE: { @@ -236,6 +237,7 @@ void Ogre2Marker::SetMaterial(MaterialPtr _material, bool _unique) break; case MT_BOX: case MT_CAPSULE: + case MT_CONE: case MT_CYLINDER: case MT_SPHERE: { @@ -342,6 +344,10 @@ void Ogre2Marker::SetType(MarkerType _markerType) isGeom = true; newGeom = this->scene->CreateCapsule(); break; + case MT_CONE: + isGeom = true; + newGeom = this->scene->CreateCone(); + break; case MT_CYLINDER: isGeom = true; newGeom = this->scene->CreateCylinder(); diff --git a/ogre2/src/Ogre2ParticleEmitter.cc b/ogre2/src/Ogre2ParticleEmitter.cc index 1a0fc7b2f..a8a10b95f 100644 --- a/ogre2/src/Ogre2ParticleEmitter.cc +++ b/ogre2/src/Ogre2ParticleEmitter.cc @@ -75,6 +75,7 @@ static const std::array { "Point", "Box", + "Cone", "Cylinder", "Ellipsoid", }; @@ -154,6 +155,7 @@ void Ogre2ParticleEmitter::SetEmitterSize(const gz::math::Vector3d &_size) break; } case EmitterType::EM_BOX: + case EmitterType::EM_CONE: case EmitterType::EM_CYLINDER: case EmitterType::EM_ELLIPSOID: {