21SShapeEllipsoid::SShapeEllipsoid(
const std::string& shapeName,
SNode* node,
const Ogre::Vector3& size) :
SShape(shapeName,
SShape::SO3_ELLIPSOID_COLLISION)
23 Ogre::Vector3 poffset = Ogre::Vector3::ZERO;
29 mSize = Ogre::Vector3(std::max(size.x, 0.0001f), std::max(size.y, 0.0001f), std::max(size.z, 0.0001f));
31#ifdef USE_COLLISION_NOSCALE
33 mSize = mSize * scale;
35 float radius = std::min(std::min(mSize.x, mSize.y), mSize.z);
36 mBaseScale = Ogre::Vector3(mSize.x / radius, mSize.y / radius, mSize.z / radius);
39 float radius = std::min(std::min(mSize.x, mSize.y), mSize.z);
40 mBaseScale = Ogre::Vector3(mSize.x / radius, mSize.y / radius, mSize.z / radius);
46SShapeEllipsoid::SShapeEllipsoid(
const std::string& shapeName,
SNode* node,
const Ogre::Vector3& size,
const Ogre::Vector3& offset,
const Ogre::Quaternion& quat) :
SShape(shapeName,
SShape::SO3_ELLIPSOID_COLLISION)
48 Ogre::Vector3 poffset = Ogre::Vector3::ZERO;
54 mSize = Ogre::Vector3(std::max(size.x, 0.0001f), std::max(size.y, 0.0001f), std::max(size.z, 0.0001f));
57#ifdef USE_COLLISION_NOSCALE
59 mSize = mSize * scale;
61 float radius = std::min(std::min(mSize.x, mSize.y), mSize.z);
62 mBaseScale = Ogre::Vector3(mSize.x / radius, mSize.y / radius, mSize.z / radius);
65 float radius = std::min(std::min(mSize.x, mSize.y), mSize.z);
66 mBaseScale = Ogre::Vector3(mSize.x / radius, mSize.y / radius, mSize.z / radius);