aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/source/Cylinder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dep/g3dlite/source/Cylinder.cpp')
-rw-r--r--dep/g3dlite/source/Cylinder.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/dep/g3dlite/source/Cylinder.cpp b/dep/g3dlite/source/Cylinder.cpp
index 7a7b9f9440d..32d14e96bb8 100644
--- a/dep/g3dlite/source/Cylinder.cpp
+++ b/dep/g3dlite/source/Cylinder.cpp
@@ -22,7 +22,7 @@
namespace G3D {
Cylinder::Cylinder(class BinaryInput& b) {
- deserialize(b);
+ deserialize(b);
}
@@ -31,48 +31,48 @@ Cylinder::Cylinder() {
Cylinder::Cylinder(const Vector3& _p1, const Vector3& _p2, float _r)
- : p1(_p1), p2(_p2), mRadius(_r) {
+ : p1(_p1), p2(_p2), mRadius(_r) {
}
void Cylinder::serialize(class BinaryOutput& b) const {
- p1.serialize(b);
- p2.serialize(b);
- b.writeFloat64(mRadius);
+ p1.serialize(b);
+ p2.serialize(b);
+ b.writeFloat64(mRadius);
}
void Cylinder::deserialize(class BinaryInput& b) {
- p1.deserialize(b);
- p2.deserialize(b);
- mRadius = b.readFloat64();
+ p1.deserialize(b);
+ p2.deserialize(b);
+ mRadius = (float)b.readFloat64();
}
Line Cylinder::axis() const {
- return Line::fromTwoPoints(p1, p2);
+ return Line::fromTwoPoints(p1, p2);
}
float Cylinder::radius() const {
- return mRadius;
+ return mRadius;
}
float Cylinder::volume() const {
- return
- (float)pi() * square(mRadius) * (p1 - p2).magnitude();
+ return
+ (float)pi() * square(mRadius) * (p1 - p2).magnitude();
}
float Cylinder::area() const {
- return
+ return
// Sides
- (twoPi() * mRadius) * height() +
+ ((float)twoPi() * mRadius) * height() +
// Caps
- twoPi() * square(mRadius);
+ (float)twoPi() * square(mRadius);
}
void Cylinder::getBounds(AABox& out) const {