Esempio n. 1
0
void Physics2DServerSW::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) {

	Body2DSW *body = body_owner.get(p_body);
	ERR_FAIL_COND(!body);

	Shape2DSW *shape = shape_owner.get(p_shape);
	ERR_FAIL_COND(!shape);
	ERR_FAIL_COND(!shape->is_configured());

	body->set_shape(p_shape_idx, shape);
}
Esempio n. 2
0
void Physics2DServerSW::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) {

	Area2DSW *area = area_owner.get(p_area);
	ERR_FAIL_COND(!area);

	Shape2DSW *shape = shape_owner.get(p_shape);
	ERR_FAIL_COND(!shape);
	ERR_FAIL_COND(!shape->is_configured());

	area->set_shape(p_shape_idx, shape);
}