Skip to content

Commit

Permalink
Remove Cone shape from particle emitters (#1434)
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Jun 18, 2024
1 parent e2e72ae commit e2c81f2
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 18 deletions.
5 changes: 1 addition & 4 deletions include/sdf/ParticleEmitter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ namespace sdf
CYLINDER = 2,

/// \brief An ellipsoid emitter.
ELLIPSOID = 3,

/// \brief An cone emitter.
CONE = 4,
ELLIPSOID = 3
};

/// \brief A description of a particle emitter, which can be attached
Expand Down
1 change: 0 additions & 1 deletion python/src/sdf/pyParticleEmitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ void defineParticleEmitter(pybind11::object module)
pybind11::enum_<sdf::ParticleEmitterType>(particleEmitterModule, "ParticleEmitterType")
.value("POINT", sdf::ParticleEmitterType::POINT)
.value("BOX", sdf::ParticleEmitterType::BOX)
.value("CONE", sdf::ParticleEmitterType::CONE)
.value("CYLINDER", sdf::ParticleEmitterType::CYLINDER)
.value("ELLIPSOID", sdf::ParticleEmitterType::ELLIPSOID);
}
Expand Down
2 changes: 0 additions & 2 deletions python/test/pyParticleEmitter_TEST.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ def test_default_construction(self):
self.assertTrue(emitter.set_type("box"))
self.assertEqual("box", emitter.type_str())
self.assertEqual(ParticleEmitter.ParticleEmitterType.BOX, emitter.type())
emitter.set_type(ParticleEmitter.ParticleEmitterType.CONE)
self.assertEqual("cone", emitter.type_str())
emitter.set_type(ParticleEmitter.ParticleEmitterType.CYLINDER)
self.assertEqual("cylinder", emitter.type_str())

Expand Down
4 changes: 1 addition & 3 deletions sdf/1.11/particle_emitter.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</attribute>

<attribute name="type" type="string" default="point" required="1">
<description>The type of a particle emitter. One of "box", "cylinder", "cone", "ellipsoid", or "point".</description>
<description>The type of a particle emitter. One of "box", "cylinder", "ellipsoid", or "point".</description>
</attribute>

<element name="emitting" type="bool" default="true" required="0">
Expand All @@ -26,8 +26,6 @@
depending on the emmiter type:
- point: The area is ignored.
- box: The area is interpreted as width X height X depth.
- cone: The area is interpreted as the bounding box of the
cone. The cone is oriented along the Z-axis.
- cylinder: The area is interpreted as the bounding box of the
cylinder. The cylinder is oriented along the Z-axis.
- ellipsoid: The area is interpreted as the bounding box of an
Expand Down
4 changes: 1 addition & 3 deletions sdf/1.12/particle_emitter.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</attribute>

<attribute name="type" type="string" default="point" required="1">
<description>The type of a particle emitter. One of "box", "cone", "cylinder", "ellipsoid", or "point".</description>
<description>The type of a particle emitter. One of "box", "cylinder", "ellipsoid", or "point".</description>
</attribute>

<element name="emitting" type="bool" default="true" required="0">
Expand All @@ -26,8 +26,6 @@
depending on the emmiter type:
- point: The area is ignored.
- box: The area is interpreted as width X height X depth.
- cone: The area is interpreted as the bounding box of the
cone. The cone is oriented along the Z-axis.
- cylinder: The area is interpreted as the bounding box of the
cylinder. The cylinder is oriented along the Z-axis.
- ellipsoid: The area is interpreted as the bounding box of an
Expand Down
5 changes: 2 additions & 3 deletions src/ParticleEmitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ using namespace sdf;
/// Particle emitter type strings. These should match the data in
/// `enum class ParticleEmitterType` located in ParticleEmitter.hh, and the size
/// template parameter should match the number of elements as well.
constexpr std::array<const std::string_view, 5> kEmitterTypeStrs =
constexpr std::array<const std::string_view, 4> kEmitterTypeStrs =
{
"point",
"box",
"cylinder",
"ellipsoid",
"cone",
"ellipsoid"
};

class sdf::ParticleEmitter::Implementation
Expand Down
2 changes: 0 additions & 2 deletions src/ParticleEmitter_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ TEST(DOMParticleEmitter, Construction)
EXPECT_TRUE(emitter.SetType("box"));
EXPECT_EQ("box", emitter.TypeStr());
EXPECT_EQ(sdf::ParticleEmitterType::BOX, emitter.Type());
emitter.SetType(sdf::ParticleEmitterType::CONE);
EXPECT_EQ("cone", emitter.TypeStr());
emitter.SetType(sdf::ParticleEmitterType::CYLINDER);
EXPECT_EQ("cylinder", emitter.TypeStr());

Expand Down

0 comments on commit e2c81f2

Please sign in to comment.