Skip to content

Commit

Permalink
Particle emitter enum and cone volume fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
bperseghetti committed May 18, 2024
1 parent 225a5f2 commit 6f94504
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Cone_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ TEST(DOMCone, Construction)
sdf::Cone cone;
EXPECT_EQ(nullptr, cone.Element());
// A default cone has a length of 1 meter and radius if 0.5 meters.
EXPECT_DOUBLE_EQ(GZ_PI * std::pow(0.5, 2) * 1.0, cone.Shape().Volume());
EXPECT_DOUBLE_EQ(GZ_PI * std::pow(0.5, 2) * 1.0 / 3.0,
cone.Shape().Volume());

EXPECT_DOUBLE_EQ(0.5, cone.Radius());
EXPECT_DOUBLE_EQ(1.0, cone.Length());
Expand All @@ -55,7 +56,8 @@ TEST(DOMCone, MoveConstructor)
EXPECT_DOUBLE_EQ(0.2, cone2.Radius());
EXPECT_DOUBLE_EQ(3.0, cone2.Length());

EXPECT_DOUBLE_EQ(GZ_PI * std::pow(0.2, 2) * 3.0, cone2.Shape().Volume());
EXPECT_DOUBLE_EQ(GZ_PI * std::pow(0.2, 2) * 3.0 / 3.0,
cone2.Shape().Volume());
EXPECT_DOUBLE_EQ(0.2, cone2.Shape().Radius());
EXPECT_DOUBLE_EQ(3.0, cone2.Shape().Length());
}
Expand Down
2 changes: 1 addition & 1 deletion src/ParticleEmitter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ constexpr std::array<const std::string_view, 5> kEmitterTypeStrs =
{
"point",
"box",
"cone",
"cylinder",
"ellipsoid",
"cone",
};

class sdf::ParticleEmitter::Implementation
Expand Down

0 comments on commit 6f94504

Please sign in to comment.