int getCylinderData(Cylinder* c) { int inputOK = 1; if (!c) { return 0; } c->radius = getCylinderRadius(); c->height = getCylinderHeight(); if (c->radius <= 0 || c->height <= 0) { inputOK = 0; } return inputOK; }
std::string CollisionCapsuleObject::toString() const { std::stringstream ss; ss.precision(std::numeric_limits<float>::max_digits10); ss << "Collision capsule:" << std::endl; ss << std::setw(20) << std::left << " - Outer margin: " << getOuterMargin() << std::endl; ss << std::setw(20) << std::left << " - Radius: " << capsuleObject.getRadius() << std::endl; ss << std::setw(20) << std::left << " - Cylinder height: " << getCylinderHeight() << std::endl; ss << std::setw(20) << std::left << " - Orientation type: " << getCapsuleOrientation() << std::endl; ss << std::setw(20) << std::left << " - Center position: " << getCenterPosition() << std::endl; ss << std::setw(20) << std::left << " - Orientation: " << getOrientation() << std::endl; return ss.str(); }
const Capsule<float> CollisionCapsuleObject::retrieveCapsule() const { return Capsule<float>(getRadius(), getCylinderHeight(), getCapsuleOrientation(), getCenterPosition(), getOrientation()); }