Box2D.Common.Vec2.SetZero C# (CSharp) Method

SetZero() public method

Zero out this vector.
public SetZero ( ) : void
return void
        public void SetZero()
        {
            X = 0.0f;
            Y = 0.0f;
        }

Usage Example

Beispiel #1
0
            public void GetSearchDirection(Vec2 result)
            {
                switch (Count)
                {

                    case 1:
                        result.Set(m_v1.W).NegateLocal();
                        return;

                    case 2:
                        e12.Set(m_v2.W).SubLocal(m_v1.W);
                        // use out for a temp variable real quick
                        result.Set(m_v1.W).NegateLocal();
                        float sgn = Vec2.Cross(e12, result);

                        if (sgn > 0f)
                        {
                            // Origin is left of e12.
                            Vec2.CrossToOutUnsafe(1f, e12, result);
                            return;
                        }
                        else
                        {
                            // Origin is right of e12.
                            Vec2.CrossToOutUnsafe(e12, 1f, result);
                            return;
                        }
                    default:
                        Debug.Assert(false);
                        result.SetZero();
                        return;
                }
            }
All Usage Examples Of Box2D.Common.Vec2::SetZero