コード例 #1
0
        public FSBody Clone()
        {
            FSBody body = new FSBody();

            body.World                   = World;
            body.UserData                = UserData;
            body.LinearDamping           = LinearDamping;
            body.LinearVelocityInternal  = LinearVelocityInternal;
            body.AngularDamping          = AngularDamping;
            body.AngularVelocityInternal = AngularVelocityInternal;
            body.Position                = Position;
            body.Rotation                = Rotation;
            body._bodyType               = _bodyType;
            body.Flags                   = Flags;

            World.AddBody(body);

            return(body);
        }
コード例 #2
0
        public FSBody(FSWorld world, object userData)
        {
            FixtureList = new List <FSFixture>(32);
            BodyId      = _bodyIdCounter++;

            World    = world;
            UserData = userData;

            GravityScale    = 1.0f;
            FixedRotation   = false;
            IsBullet        = false;
            SleepingAllowed = true;
#if !USE_AWAKE_BODY_SET
            Awake = true;
#endif
            BodyType = BodyType.Static;
            Enabled  = true;

            Xf.q.Set(0);

            world.AddBody(this);
        }