Skip to content

Commit

Permalink
Adding cone primitives. (#1003)
Browse files Browse the repository at this point in the history
---------

Signed-off-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
bperseghetti authored Jun 13, 2024
1 parent ec1225b commit 97ada56
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/gz/rendering/Marker.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/gz/rendering/ParticleEmitter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace gz
/// - EM_POINT: The area is ignored.
/// - EM_BOX: The area is interpreted as width X height X depth.
/// - 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
Expand Down
6 changes: 6 additions & 0 deletions ogre/src/OgreMarker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
{
Expand Down Expand Up @@ -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:
{
Expand Down Expand Up @@ -257,6 +259,10 @@ void OgreMarker::SetType(MarkerType _markerType)
this->dataPtr->geom =
std::dynamic_pointer_cast<OgreGeometry>(this->scene->CreateCapsule());
break;
case MT_CONE:
this->dataPtr->geom =
std::dynamic_pointer_cast<OgreGeometry>(this->scene->CreateCone());
break;
case MT_CYLINDER:
this->dataPtr->geom =
std::dynamic_pointer_cast<OgreGeometry>(this->scene->CreateCylinder());
Expand Down
6 changes: 6 additions & 0 deletions ogre2/src/Ogre2Marker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
{
Expand Down Expand Up @@ -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:
{
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 97ada56

Please sign in to comment.