FarseerPhysics.Dynamics.World.addBody C# (CSharp) 메소드

addBody() 개인적인 메소드

Add a rigid body.
private addBody ( Body body ) : void
body Body
리턴 void
		internal void addBody( Body body )
		{
			Debug.Assert( !_bodyAddList.Contains( body ), "You are adding the same body more than once." );

			if( !_bodyAddList.Contains( body ) )
				_bodyAddList.Add( body );
		}

Usage Example

예제 #1
0
파일: Body.cs 프로젝트: bicheichane/Nez
        public Body(World world, Vector2 position = new Vector2(), float rotation = 0, BodyType bodyType = BodyType.Static, object userdata = null)
        {
            fixtureList = new List <Fixture>();
            bodyId      = _bodyIdCounter++;

            _world           = world;
            _enabled         = true;
            _awake           = true;
            _sleepingAllowed = true;

            userData      = userdata;
            gravityScale  = 1.0f;
            this.bodyType = bodyType;

            _xf.q.Set(rotation);

            //FPE: optimization
            if (position != Vector2.Zero)
            {
                _xf.p     = position;
                _sweep.C0 = _xf.p;
                _sweep.C  = _xf.p;
            }

            //FPE: optimization
            if (rotation != 0)
            {
                _sweep.A0 = rotation;
                _sweep.A  = rotation;
            }

            world.addBody(this);               //FPE note: bodies can't live without a World
        }
All Usage Examples Of FarseerPhysics.Dynamics.World::addBody