本文整理汇总了C++中Area2DSW::remove_shape方法的典型用法代码示例。如果您正苦于以下问题:C++ Area2DSW::remove_shape方法的具体用法?C++ Area2DSW::remove_shape怎么用?C++ Area2DSW::remove_shape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area2DSW
的用法示例。
在下文中一共展示了Area2DSW::remove_shape方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Physics2DServerSW::area_remove_shape(RID p_area, int p_shape_idx) {
Area2DSW *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
area->remove_shape(p_shape_idx);
}
示例2: if
void Physics2DServerSW::free(RID p_rid) {
if (shape_owner.owns(p_rid)) {
Shape2DSW *shape = shape_owner.get(p_rid);
while (shape->get_owners().size()) {
ShapeOwner2DSW *so = shape->get_owners().front()->key();
so->remove_shape(shape);
}
shape_owner.free(p_rid);
memdelete(shape);
} else if (body_owner.owns(p_rid)) {
Body2DSW *body = body_owner.get(p_rid);
/*
if (body->get_state_query())
_clear_query(body->get_state_query());
if (body->get_direct_state_query())
_clear_query(body->get_direct_state_query());
*/
body->set_space(NULL);
while (body->get_shape_count()) {
body->remove_shape(0);
}
while (body->get_constraint_map().size()) {
RID self = body->get_constraint_map().front()->key()->get_self();
ERR_FAIL_COND(!self.is_valid());
free(self);
}
body_owner.free(p_rid);
memdelete(body);
} else if (area_owner.owns(p_rid)) {
Area2DSW *area = area_owner.get(p_rid);
/*
if (area->get_monitor_query())
_clear_query(area->get_monitor_query());
*/
area->set_space(NULL);
while (area->get_shape_count()) {
area->remove_shape(0);
}
area_owner.free(p_rid);
memdelete(area);
} else if (space_owner.owns(p_rid)) {
Space2DSW *space = space_owner.get(p_rid);
while (space->get_objects().size()) {
CollisionObject2DSW *co = (CollisionObject2DSW *)space->get_objects().front()->get();
co->set_space(NULL);
}
active_spaces.erase(space);
free(space->get_default_area()->get_self());
space_owner.free(p_rid);
memdelete(space);
} else if (joint_owner.owns(p_rid)) {
Joint2DSW *joint = joint_owner.get(p_rid);
joint_owner.free(p_rid);
memdelete(joint);
} else {
ERR_EXPLAIN("Invalid ID");
ERR_FAIL();
}
};