/// <summary> /// Create the collision cylinder. /// </summary> /// <param name="halfExtent">Half extent on X, Y and Z of the cylinder.</param> /// <param name="axis">Cylinder axis direction.</param> public CollisionCylinder(Vector3 halfExtent, CylinderDirectionAxis axis = CylinderDirectionAxis.Y) { _axisType = axis; switch (_axisType) { case CylinderDirectionAxis.X: _shape = new BulletSharp.CylinderShapeX(halfExtent.X, halfExtent.Y, halfExtent.Z); break; case CylinderDirectionAxis.Y: _shape = new BulletSharp.CylinderShape(halfExtent.X, halfExtent.Y, halfExtent.Z); break; case CylinderDirectionAxis.Z: _shape = new BulletSharp.CylinderShapeZ(halfExtent.X, halfExtent.Y, halfExtent.Z); break; } }
/// <summary> /// Create the info to create a cylinder body. /// </summary> /// <param name="radius">Cylinder radius.</param> /// <param name="height">Cylinder height.</param> /// <param name="axis">Cylinder direction axis (Y = standing up).</param> public CylinderInfo(float radius, float height, CylinderDirectionAxis axis = CylinderDirectionAxis.Y) : this(new Vector3(radius, height, radius), axis) { }
/// <summary> /// Create the info to create a cylinder body. /// </summary> /// <param name="halfExtent">Cylinder half extent.</param> /// <param name="axis">Cylinder direction axis (Y = standing up).</param> public CylinderInfo(Vector3 halfExtent, CylinderDirectionAxis axis = CylinderDirectionAxis.Y) { HalfExtent = halfExtent; Axis = axis; }