Esempio n. 1
0
        public override void DrawGizmos()
        {
            PxVec4 drawRot = this.rotation;

            if (this.ColliderData.direction == 0)
            {
                //X-Axis
                PxVec4 rotationDelta = PxVec4.AngleAxis(90f, PxVec3.forward);
                drawRot *= rotationDelta;
            }
            else if (this.ColliderData.direction == 2)
            {
                //Z-Axis
                PxVec4 rotationDelta = PxVec4.AngleAxis(90f, PxVec3.right);
                drawRot *= rotationDelta;
            }

            GizmosUtil.DrawCapsule(this.position, drawRot,
                                   this.ColliderData.halfHeight * 2 + this.ColliderData.radius * 2,
                                   this.ColliderData.radius, Color.green, new Color());
        }
Esempio n. 2
0
    void OnDrawGizmos()
    {
        float width  = m_width * Mathf.Abs(transform.localScale.x);
        float height = m_height * Mathf.Abs(transform.localScale.y);
        float depth  = m_depth * Mathf.Abs(transform.localScale.z);
        float radius = m_radius * 0.5f * Mathf.Abs(transform.localScale.x + transform.localScale.z);

        switch (m_primitive)
        {
        case Primitive.Arrow:
            Vector3 axisY     = transform.rotation * Vector3.up;
            Vector3 endOffset = 0.5f * height * axisY;
            GizmosUtil.DrawArrow(transform.position - endOffset, transform.position + endOffset, m_arrowTipSize, 2.0f * m_arrowTipSize, m_latSegments, 0.0f, m_color, m_style);
            break;

        case Primitive.Box:
            GizmosUtil.DrawBox(transform.position, transform.rotation, new Vector3(width, height, depth), m_color, m_style);
            break;

        case Primitive.Capsule:
            GizmosUtil.DrawCapsule(transform.position, transform.rotation, height, radius, m_latSegments, m_longSegments, m_color, m_style);
            break;

        case Primitive.Cone:
            GizmosUtil.DrawCone(transform.position, transform.rotation, height, radius, m_longSegments, m_color, m_style);
            break;

        case Primitive.Cylinder:
            GizmosUtil.DrawCylinder(transform.position, transform.rotation, height, radius, m_longSegments, m_color, m_style);
            break;

        case Primitive.Sphere:
            GizmosUtil.DrawSphere(transform.position, transform.rotation, radius, m_latSegments, m_longSegments, m_color, m_style);
            break;
        }
    }
Esempio n. 3
0
 public override void DrawGizmos()
 {
     GizmosUtil.DrawCapsule(this.Position, this.rotation,
                            this.ControllerData.height + this.ControllerData.radius * 2 + this.ControllerData.skinWidth * 2,
                            this.ControllerData.radius + this.ControllerData.skinWidth, Color.green, new Color());
 }