Skip to content

Commit cf92027

Browse files
committed
Adding cone primitives.
Squashing commits to make requested target of main with backports to harmonic. Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
1 parent ade7442 commit cf92027

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
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

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ namespace gz
4747
/// \brief Ellipsoid emitter.
4848
EM_ELLIPSOID = 3,
4949

50+
/// \brief Cone emitter.
51+
EM_CONE = 4,
52+
5053
/// \brief Total number of emitters (keep always at the end).
51-
EM_NUM_EMITTERS = 4,
54+
EM_NUM_EMITTERS = 5,
5255
};
5356

5457
/// \class ParticleEmitter ParticleEmitter.hh
@@ -86,8 +89,10 @@ namespace gz
8689
/// the emmiter type:
8790
/// - EM_POINT: The area is ignored.
8891
/// - EM_BOX: The area is interpreted as width X height X depth.
92+
/// - EM_CONE: The area is interpreted as the bounding box of the
93+
/// cone. The cone is oriented along the Z-axis.
8994
/// - EM_CYLINDER: The area is interpreted as the bounding box of the
90-
/// cilinder. The cylinder is oriented along the Z-axis.
95+
/// cylinder. The cylinder is oriented along the Z-axis.
9196
/// - EM_ELLIPSOID: The area is interpreted as the bounding box of an
9297
/// ellipsoid shaped area, i.e. a sphere or
9398
/// 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();

ogre2/src/Ogre2ParticleEmitter.cc

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ static const std::array<std::string, EmitterType::EM_NUM_EMITTERS>
7575
{
7676
"Point",
7777
"Box",
78+
"Cone",
7879
"Cylinder",
7980
"Ellipsoid",
8081
};
@@ -154,6 +155,7 @@ void Ogre2ParticleEmitter::SetEmitterSize(const gz::math::Vector3d &_size)
154155
break;
155156
}
156157
case EmitterType::EM_BOX:
158+
case EmitterType::EM_CONE:
157159
case EmitterType::EM_CYLINDER:
158160
case EmitterType::EM_ELLIPSOID:
159161
{

0 commit comments

Comments
 (0)