Esempio n. 1
0
        private Body(Body copy)
        {
            Initialize();
            this.ignoresCollisionResponce = copy.ignoresCollisionResponce;
            this.shape            = copy.shape;
            this.massInfo         = copy.massInfo;
            this.coefficients     = copy.coefficients;
            this.collisionIgnorer = copy.collisionIgnorer;
            this.matrices         = copy.matrices.Duplicate();
            this.state            = copy.state.Duplicate();
            this.lifetime         = copy.lifetime.Duplicate();

            this.transformation = copy.transformation;
            this.linearDamping  = copy.linearDamping;
            this.angularDamping = copy.angularDamping;

            this.ignoresCollisionResponce = copy.ignoresCollisionResponce;
            this.ignoresGravity           = copy.ignoresGravity;
            this.ignoresPhysicsLogics     = copy.ignoresPhysicsLogics;
            this.isTransformed            = copy.isTransformed;
            this.isCollidable             = copy.isCollidable;
            this.isEventable = copy.isEventable;

            this.tag = copy.tag;
        }
Esempio n. 2
0
        public BaseModelBody(PhysicsState state, IShape shape, MassInfo massInfo, Coefficients coefficients, Lifespan lifetime, Guid modelId)
            : base(state, shape, massInfo, coefficients, lifetime)
        {
            if (modelId == Guid.Empty)
            {
                throw new ArgumentException("'guid' cannot be empty!");
            }

            ModelId = modelId;
        }
Esempio n. 3
0
        /// <summary>
        /// Creates a new Body Instance.
        /// </summary>
        /// <param name="state">The State of the Body.</param>
        /// <param name="shape">The Shape of the Body.</param>
        /// <param name="massInfo">A object describing the mass and inertia of the Body.</param>
        /// <param name="coefficients">A object containing coefficients.</param>
        /// <param name="lifeTime">A object Describing how long the object will be in the engine.</param>
        public Body(
            PhysicsState state,
            IShape shape,
            MassInfo massInfo,
            Coefficients coefficients,
            Lifespan lifetime)
        {
            if (state == null)
            {
                throw new ArgumentNullException("state");
            }
            if (shape == null)
            {
                throw new ArgumentNullException("shape");
            }
            if (massInfo == null)
            {
                throw new ArgumentNullException("massInfo");
            }
            if (coefficients == null)
            {
                throw new ArgumentNullException("coefficients");
            }
            if (lifetime == null)
            {
                throw new ArgumentNullException("lifetime");
            }
            Initialize();
            this.matrices       = new Matrices();
            this.transformation = Matrix2x3.Identity;

            this.state          = new PhysicsState(state);
            this.Shape          = shape;
            this.massInfo       = massInfo;
            this.coefficients   = coefficients;
            this.lifetime       = lifetime;
            this.linearDamping  = 1;
            this.angularDamping = 1;
            this.isCollidable   = true;
            this.isEventable    = true;
            this.ApplyPosition();
        }
Esempio n. 4
0
        private Body(Body copy)
        {
            this.proxies = new LinkedList <BodyProxy>();
            this.ignoresCollisionResponce = copy.ignoresCollisionResponce;
            this.shape            = copy.shape;
            this.massInfo         = copy.massInfo;
            this.coefficients     = copy.coefficients;
            this.collisionIgnorer = copy.collisionIgnorer;
            this.matrices         = copy.matrices.Duplicate();
            this.state            = copy.state.Duplicate();
            this.lifetime         = copy.lifetime.Duplicate();

            this.transformation = copy.transformation;
            this.linearDamping  = copy.linearDamping;
            this.angularDamping = copy.angularDamping;

            this.ignoresCollisionResponce = copy.ignoresCollisionResponce;
            this.ignoresGravity           = copy.ignoresGravity;
            this.isCollidable             = copy.isCollidable;
            this.ignoresGravity           = copy.ignoresGravity;
            this.isTransformed            = copy.isTransformed;

            this.tag = (copy.tag is ICloneable) ? (((ICloneable)copy.tag).Clone()) : (copy.tag);
        }
Esempio n. 5
0
 public BoneBody(PhysicsState state, IShape shape, MassInfo massInfo, Coefficients coefficients, Lifespan lifetime, Guid modelId)
     : base(state, shape, massInfo, coefficients, lifetime, modelId)
 {
 }
Esempio n. 6
0
 public ChainMember(PhysicsState state, IShape shape, MassInfo mass, Coefficients coefficients, Lifespan lifetime, Guid modelId)
     : base(state, shape, mass, coefficients, lifetime, modelId)
 {
 }