Пример #1
0
 internal Body(ShapeAbstract shape)
 {
     _Shape      = shape;
     _StaticBody = true;
     _Friction   = 0;
     _Elasticity = 0;
 }
Пример #2
0
 //Constructors
 //First constructor for non static Body
 internal Body(ShapeAbstract shape, float mass, float elasticity)
 {
     _Shape       = shape;
     _Velocity    = new Vector2();
     _VelocityCap = new Vector2(400);
     _Friction    = 1f;
     _Mass        = mass;
     _StaticBody  = false;
     _Elasticity  = elasticity; //1 for bouce, 0 for no bounce.
 }
Пример #3
0
        //Second constructor for static Body
        internal Body(ShapeAbstract shape, bool staticBody, float elasticity)
        {
            _Shape       = shape;
            _Velocity    = new Vector2();
            _VelocityCap = new Vector2(400);
            _Friction    = 1f;
            _StaticBody  = staticBody;
            _Elasticity  = elasticity; //1 for bouce, 0 for no bounce.

            _Mass = staticBody ? 0 : 1;
        }