You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-25 15:37:42 +00:00
Port collision and layer masks to 3D, fixes #1759
Raycasts now have type_mask and layer_mask. Areas - collision_mask and layer_mask. PhysicsBodies needed only collision_mask.
This commit is contained in:
@@ -418,6 +418,22 @@ Transform PhysicsServerSW::area_get_transform(RID p_area) const {
|
||||
return area->get_transform();
|
||||
};
|
||||
|
||||
void PhysicsServerSW::area_set_layer_mask(RID p_area,uint32_t p_mask) {
|
||||
|
||||
AreaSW *area = area_owner.get(p_area);
|
||||
ERR_FAIL_COND(!area);
|
||||
|
||||
area->set_layer_mask(p_mask);
|
||||
}
|
||||
|
||||
void PhysicsServerSW::area_set_collision_mask(RID p_area,uint32_t p_mask) {
|
||||
|
||||
AreaSW *area = area_owner.get(p_area);
|
||||
ERR_FAIL_COND(!area);
|
||||
|
||||
area->set_collision_mask(p_mask);
|
||||
}
|
||||
|
||||
void PhysicsServerSW::area_set_monitorable(RID p_area,bool p_monitorable) {
|
||||
|
||||
AreaSW *area = area_owner.get(p_area);
|
||||
@@ -657,6 +673,25 @@ uint32_t PhysicsServerSW::body_get_layer_mask(RID p_body, uint32_t p_mask) const
|
||||
|
||||
}
|
||||
|
||||
void PhysicsServerSW::body_set_collision_mask(RID p_body, uint32_t p_mask) {
|
||||
|
||||
BodySW *body = body_owner.get(p_body);
|
||||
ERR_FAIL_COND(!body);
|
||||
|
||||
body->set_collision_mask(p_mask);
|
||||
body->wakeup();
|
||||
|
||||
}
|
||||
|
||||
uint32_t PhysicsServerSW::body_get_collision_mask(RID p_body, uint32_t p_mask) const{
|
||||
|
||||
const BodySW *body = body_owner.get(p_body);
|
||||
ERR_FAIL_COND_V(!body,0);
|
||||
|
||||
return body->get_collision_mask();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void PhysicsServerSW::body_attach_object_instance_ID(RID p_body,uint32_t p_ID) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user