本文整理汇总了C++中AreaBullet::set_space方法的典型用法代码示例。如果您正苦于以下问题:C++ AreaBullet::set_space方法的具体用法?C++ AreaBullet::set_space怎么用?C++ AreaBullet::set_space使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AreaBullet
的用法示例。
在下文中一共展示了AreaBullet::set_space方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: area_set_space
void BulletPhysicsServer::area_set_space(RID p_area, RID p_space) {
AreaBullet *area = area_owner.get(p_area);
ERR_FAIL_COND(!area);
SpaceBullet *space = NULL;
if (p_space.is_valid()) {
space = space_owner.get(p_space);
ERR_FAIL_COND(!space);
}
area->set_space(space);
}
示例2: free
void BulletPhysicsServer::free(RID p_rid) {
if (shape_owner.owns(p_rid)) {
ShapeBullet *shape = shape_owner.get(p_rid);
// Notify the shape is configured
for (Map<ShapeOwnerBullet *, int>::Element *element = shape->get_owners().front(); element; element = element->next()) {
static_cast<ShapeOwnerBullet *>(element->key())->remove_shape(shape);
}
shape_owner.free(p_rid);
bulletdelete(shape);
} else if (rigid_body_owner.owns(p_rid)) {
RigidBodyBullet *body = rigid_body_owner.get(p_rid);
body->set_space(NULL);
body->remove_all_shapes(true);
rigid_body_owner.free(p_rid);
bulletdelete(body);
} else if (soft_body_owner.owns(p_rid)) {
SoftBodyBullet *body = soft_body_owner.get(p_rid);
body->set_space(NULL);
soft_body_owner.free(p_rid);
bulletdelete(body);
} else if (area_owner.owns(p_rid)) {
AreaBullet *area = area_owner.get(p_rid);
area->set_space(NULL);
area->remove_all_shapes(true);
area_owner.free(p_rid);
bulletdelete(area);
} else if (joint_owner.owns(p_rid)) {
JointBullet *joint = joint_owner.get(p_rid);
joint->destroy_internal_constraint();
joint_owner.free(p_rid);
bulletdelete(joint);
} else if (space_owner.owns(p_rid)) {
SpaceBullet *space = space_owner.get(p_rid);
space->remove_all_collision_objects();
space_set_active(p_rid, false);
space_owner.free(p_rid);
bulletdelete(space);
} else {
ERR_EXPLAIN("Invalid ID");
ERR_FAIL();
}
}