Ejemplo n.º 1
0
 public Body(Shape shape = null, Node parent = null)
 {
     if (parent != null) this.parent = parent;
     this.shape = shape ?? new Circle(Node.defaultNodeSize);
     this.shape.body = this;
     this.shape.Initialize();
     DrawPolygonCenter = true;
     AfterCloning();
 }
Ejemplo n.º 2
0
 public Collider(Shape shape = null, Node parent = null)
 {
     float rad = 25;
     if (parent != null)
     {
         this.parent = parent;
         rad = parent.body.radius;
     }
     if (shape != null)
     {
         this.shape = shape;
     }
     else
     {
         this.shape = new Circle(rad);
     }
 }
Ejemplo n.º 3
0
 public void SetShape(Shape shape)
 {
     shape.body = this;
     this.shape = shape;
 }