Skip to content

Commit 228522a

Browse files
bperseghettiazeey
authored andcommitted
Backport: Adding cone primitives. (#1003)
Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
1 parent 649f7f0 commit 228522a

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

include/gz/rendering/Marker.hh

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ namespace gz
6868

6969
/// \brief Capsule geometry
7070
MT_CAPSULE = 11,
71+
72+
/// \brief Cone geometry
73+
MT_CONE = 12,
7174
};
7275

7376
/// \class Marker Marker.hh gz/rendering/Marker

include/gz/rendering/ParticleEmitter.hh

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace gz
8787
/// - EM_POINT: The area is ignored.
8888
/// - EM_BOX: The area is interpreted as width X height X depth.
8989
/// - EM_CYLINDER: The area is interpreted as the bounding box of the
90-
/// cilinder. The cylinder is oriented along the Z-axis.
90+
/// cylinder. The cylinder is oriented along the Z-axis.
9191
/// - EM_ELLIPSOID: The area is interpreted as the bounding box of an
9292
/// ellipsoid shaped area, i.e. a sphere or
9393
/// squashed-sphere area. The parameters are again

ogre/src/OgreMarker.cc

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Ogre::MovableObject *OgreMarker::OgreObject() const
107107
return nullptr;
108108
case MT_BOX:
109109
case MT_CAPSULE:
110+
case MT_CONE:
110111
case MT_CYLINDER:
111112
case MT_SPHERE:
112113
{
@@ -184,6 +185,7 @@ void OgreMarker::SetMaterial(MaterialPtr _material, bool _unique)
184185
break;
185186
case MT_BOX:
186187
case MT_CAPSULE:
188+
case MT_CONE:
187189
case MT_CYLINDER:
188190
case MT_SPHERE:
189191
{
@@ -257,6 +259,10 @@ void OgreMarker::SetType(MarkerType _markerType)
257259
this->dataPtr->geom =
258260
std::dynamic_pointer_cast<OgreGeometry>(this->scene->CreateCapsule());
259261
break;
262+
case MT_CONE:
263+
this->dataPtr->geom =
264+
std::dynamic_pointer_cast<OgreGeometry>(this->scene->CreateCone());
265+
break;
260266
case MT_CYLINDER:
261267
this->dataPtr->geom =
262268
std::dynamic_pointer_cast<OgreGeometry>(this->scene->CreateCylinder());

ogre2/src/Ogre2Marker.cc

+6
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Ogre::MovableObject *Ogre2Marker::OgreObject() const
155155
return nullptr;
156156
case MT_BOX:
157157
case MT_CAPSULE:
158+
case MT_CONE:
158159
case MT_CYLINDER:
159160
case MT_SPHERE:
160161
{
@@ -236,6 +237,7 @@ void Ogre2Marker::SetMaterial(MaterialPtr _material, bool _unique)
236237
break;
237238
case MT_BOX:
238239
case MT_CAPSULE:
240+
case MT_CONE:
239241
case MT_CYLINDER:
240242
case MT_SPHERE:
241243
{
@@ -342,6 +344,10 @@ void Ogre2Marker::SetType(MarkerType _markerType)
342344
isGeom = true;
343345
newGeom = this->scene->CreateCapsule();
344346
break;
347+
case MT_CONE:
348+
isGeom = true;
349+
newGeom = this->scene->CreateCone();
350+
break;
345351
case MT_CYLINDER:
346352
isGeom = true;
347353
newGeom = this->scene->CreateCylinder();

0 commit comments

Comments
 (0)