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 Cone as a primitive parametric shape. #1001

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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