예제 #1
0
 public override void OnDrawGizmosSelected()
 {
     for (int i = 0; i < spheres.Length; i++)
     {
         BUtility.DebugDrawSphere(transform.TransformPoint(spheres[i].position), Quaternion.identity, Vector3.one, Vector3.one * spheres[i].radius, Gizmos.color);
     }
 }
예제 #2
0
 public override void OnDrawGizmosSelected()
 {
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     UnityEngine.Vector3    scale    = m_localScaling;
     BUtility.DebugDrawCylinder(position, rotation, scale, halfExtent.x, halfExtent.y, 1, Color.yellow);
 }
예제 #3
0
 public override void OnDrawGizmosSelected()
 {
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     UnityEngine.Vector3    scale    = Vector3.one;
     BUtility.DebugDrawCapsule(position, rotation, scale, radius, height / 2f, 1, Gizmos.color);
 }
예제 #4
0
 public override void OnDrawGizmosSelected()
 {
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     UnityEngine.Vector3    scale    = Vector3.one;
     BUtility.DebugDrawSphere(position, rotation, scale, Vector3.one * radius, Color.yellow);
 }
        public override void DrawArc(ref BM.Vector3 center, ref BM.Vector3 normal, ref BM.Vector3 axis, float radiusA, float radiusB, float minAngle, float maxAngle,
                                     ref BM.Vector3 color, bool drawSect, float stepDegrees)
        {
            Color col = new Color(color.X, color.Y, color.Z);

            BUtility.DebugDrawArc(center.ToUnity(), normal.ToUnity(), axis.ToUnity(), radiusA, radiusB, minAngle, maxAngle, col, drawSect, stepDegrees);
        }
예제 #6
0
 public override void OnDrawGizmosSelected()
 {
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     UnityEngine.Vector3    scale    = m_localScaling;
     BUtility.DebugDrawCone(position, rotation, scale, radius, height, 1, Color.yellow);
 }
예제 #7
0
 public override void DrawSphere(float radius, ref Matrix trans, ref Vector3 color)
 {
     UnityEngine.Vector3    pos   = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans);
     UnityEngine.Quaternion rot   = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans);
     UnityEngine.Vector3    scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans);
     UnityEngine.Color      c     = new UnityEngine.Color(color.X, color.Y, color.Z);
     BUtility.DebugDrawSphere(pos, rot, scale, UnityEngine.Vector3.one * radius, c);
 }
예제 #8
0
        public override void OnDrawGizmosSelected()
        {
            Vector3    position = transform.position;
            Quaternion rotation = transform.rotation;
            Vector3    scale    = Vector3.one;

            BUtility.DebugDrawBox(position, rotation, scale, extents, Color.yellow);
        }
예제 #9
0
 public override void DrawCylinder(float radius, float halfHeight, int upAxis, ref Matrix trans, ref Vector3 color)
 {
     UnityEngine.Vector3    pos   = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans);
     UnityEngine.Quaternion rot   = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans);
     UnityEngine.Vector3    scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans);
     UnityEngine.Color      c     = new UnityEngine.Color(color.X, color.Y, color.Z);
     BUtility.DebugDrawCylinder(pos, rot, scale, radius, halfHeight, upAxis, c);
 }
예제 #10
0
 public override void DrawPlane(ref Vector3 planeNormal, float planeConst, ref Matrix trans, ref Vector3 color)
 {
     UnityEngine.Vector3    pos   = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans);
     UnityEngine.Quaternion rot   = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans);
     UnityEngine.Vector3    scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans);
     UnityEngine.Color      c     = new UnityEngine.Color(color.X, color.Y, color.Z);
     BUtility.DebugDrawPlane(pos, rot, scale, planeNormal.ToUnity(), planeConst, c);
 }
예제 #11
0
 public override void DrawBox(ref Vector3 bbMin, ref Vector3 bbMax, ref Matrix trans, ref Vector3 color)
 {
     UnityEngine.Vector3    pos   = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans);
     UnityEngine.Quaternion rot   = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans);
     UnityEngine.Vector3    scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans);
     UnityEngine.Vector3    size  = (bbMax - bbMin).ToUnity();
     UnityEngine.Color      c     = new UnityEngine.Color(color.X, color.Y, color.Z);
     BUtility.DebugDrawBox(pos, rot, scale, size, c);
 }
        public override void DrawSphere(float radius, ref BM.Matrix trans, ref BM.Vector3 color)
        {
            Vector3    pos   = BSExtensionMethods2.ExtractTranslationFromMatrix(ref trans);
            Quaternion rot   = BSExtensionMethods2.ExtractRotationFromMatrix(ref trans);
            Vector3    scale = BSExtensionMethods2.ExtractScaleFromMatrix(ref trans);
            Color      c     = new Color(color.X, color.Y, color.Z);

            BUtility.DebugDrawSphere(pos, rot, scale, radius, c);
        }
 public override void OnDrawGizmosSelected()
 {
     for (int i = 0; i < spheres.Length; i++)
     {
         Vector3 v = spheres[i].position;
         v.x *= m_localScaling.x; v.y *= m_localScaling.y; v.z *= m_localScaling.z;
         BUtility.DebugDrawSphere(transform.TransformPoint(v), Quaternion.identity, Vector3.one, Vector3.one * spheres[i].radius, Gizmos.color);
     }
 }
예제 #14
0
 public override void OnDrawGizmosSelected()
 {
     if (drawGizmo == false)
     {
         return;
     }
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     BUtility.DebugDrawCylinder(position, rotation, LocalScaling, halfExtent.x, halfExtent.y, 1, Color.yellow);
 }
예제 #15
0
 public override void OnDrawGizmosSelected()
 {
     if (drawGizmo == false)
     {
         return;
     }
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     BUtility.DebugDrawCone(position, rotation, LocalScaling, radius, height, 1, Color.yellow);
 }
예제 #16
0
 public override void OnDrawGizmosSelected()
 {
     if (drawGizmo == false)
     {
         return;
     }
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     UnityEngine.Vector3    scale    = m_localScaling;
     BUtility.DebugDrawSphere(position, rotation, scale, Vector3.one * radius, Color.yellow);
 }
예제 #17
0
        public override void OnDrawGizmosSelected()
        {
            if (drawGizmo == false)
            {
                return;
            }
            Vector3    position = transform.position;
            Quaternion rotation = transform.rotation;

            BUtility.DebugDrawSphere(position, rotation, LocalScaling, Vector3.one * radius, Color.yellow);
        }
예제 #18
0
        public override void OnDrawGizmosSelected()
        {
            if (drawGizmo == false)
            {
                return;
            }
            Vector3    position = transform.position;
            Quaternion rotation = transform.rotation;
            Vector3    scale    = m_localScaling;

            BUtility.DebugDrawBox(position, rotation, scale, extents, Color.yellow);
        }
 private void OnDrawGizmosSelected()
 {
     BUtility.DebugDrawRope
     (
         transform.position,
         transform.rotation,
         SoftBodySettings.scale,
         meshSettings.startPoint,
         meshSettings.endPoint,
         meshSettings.numPointsInRope,
         Color.green
     );
 }
예제 #20
0
 public override void OnDrawGizmosSelected()
 {
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     UnityEngine.Vector3    scale    = m_localScaling;
     if (upAxis == CapsuleAxis.x)
     {
         rotation = Quaternion.AngleAxis(90, Vector3.forward) * rotation;
     }
     else if (upAxis == CapsuleAxis.z)
     {
         rotation = Quaternion.AngleAxis(90, Vector3.right) * rotation;
     }
     BUtility.DebugDrawCapsule(position, rotation, scale, radius, height / 2f, 1, Gizmos.color);
 }
예제 #21
0
        private void OnDrawGizmosSelected()
        {
            if (!m_doDrawGizmos)
            {
                return;
            }

            Vector3 rperp   = Vector3.up;
            Vector3 forward = rotationAxis;

            if (jointType == FeatherstoneJointType.Planar ||
                jointType == FeatherstoneJointType.Prismatic ||
                jointType == FeatherstoneJointType.Revolute)
            {
                //uses axis of rotation
                if (rotationAxis != Vector3.zero)
                {
                    BUtility.GetPerpendicularVector(forward, out rperp);

                    Vector3 axisOfRotation;
                    if (axesAreFrozen)
                    {
                        axisOfRotation = transform.parent.TransformDirection(rotationAxisInParentFrame);
                        rperp          = transform.parent.TransformDirection(jointToThisCOMInParentFrame);
                    }
                    else
                    {
                        axisOfRotation = transform.TransformDirection(rotationAxis);
                        rperp          = transform.TransformDirection(-localPivotPosition);
                        if (rperp.magnitude < 10E-7f)
                        {
                            rperp = transform.parent.position - transform.TransformPoint(localPivotPosition);
                        }

                        rperp = Vector3.ProjectOnPlane(rperp, axisOfRotation);
                    }

                    rperp.Normalize();
                }
            }
            else
            {
                rotationAxis = transform.forward;
                rperp        = transform.up;
            }
            BUtility.DebugDrawTransform(transform, localPivotPosition, rotationAxis, rperp, gizmoScale);
        }
예제 #22
0
 public override void OnDrawGizmosSelected()
 {
     if (drawGizmo == false)
     {
         return;
     }
     UnityEngine.Vector3    position = transform.position;
     UnityEngine.Quaternion rotation = transform.rotation;
     if (upAxis == Axis.x)
     {
         rotation = Quaternion.AngleAxis(90, transform.forward) * rotation;
     }
     else if (upAxis == Axis.z)
     {
         rotation = Quaternion.AngleAxis(90, transform.right) * rotation;
     }
     BUtility.DebugDrawCapsule(position, rotation, LocalScaling, radius, height / 2f, 1, Gizmos.color);
 }
예제 #23
0
 public override void OnDrawGizmosSelected()
 {
     BUtility.DebugDrawBox(transform.position, transform.rotation, m_localScaling, extents, Color.green);
 }
예제 #24
0
 public override void OnDrawGizmosSelected()
 {
     BUtility.DebugDrawCapsule(transform.position, transform.rotation, m_localScaling, radius, height / 2f, (int)upAxis, Color.green);
 }
예제 #25
0
 public override void OnDrawGizmosSelected()
 {
     BUtility.DebugDrawCone(transform.position, transform.rotation, m_localScaling, radius, height, 1, Color.green);
 }
        public override void DrawSphere(ref BM.Vector3 p, float radius, ref BM.Vector3 color)
        {
            Color c = new Color(color.X, color.Y, color.Z);

            BUtility.DebugDrawSphere(p.ToUnity(), Quaternion.identity, Vector3.one, radius, c);
        }
 public override void OnDrawGizmosSelected()
 {
     BUtility.DebugDrawCylinder(transform.position, transform.rotation, m_localScaling, halfExtent.x, halfExtent.y, 1, Color.green);
 }
예제 #28
0
 public override void DrawSphere(ref Vector3 p, float radius, ref Vector3 color)
 {
     UnityEngine.Color c = new UnityEngine.Color(color.X, color.Y, color.Z);
     BUtility.DebugDrawSphere(p.ToUnity(), UnityEngine.Quaternion.identity, UnityEngine.Vector3.one, UnityEngine.Vector3.one * radius, c);
 }