summaryrefslogtreecommitdiff
path: root/modules/bullet/space_bullet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bullet/space_bullet.cpp')
-rw-r--r--modules/bullet/space_bullet.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index 762637ce75..69f3d1b393 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -122,7 +122,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra
if (p_result_max <= 0)
return 0;
- ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get(p_shape);
+ ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape);
btCollisionShape *btShape = shape->create_bt_shape(p_xform.basis.get_scale_abs(), p_margin);
if (!btShape->isConvex()) {
@@ -152,7 +152,7 @@ int BulletPhysicsDirectSpaceState::intersect_shape(const RID &p_shape, const Tra
}
bool BulletPhysicsDirectSpaceState::cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, float p_margin, float &r_closest_safe, float &r_closest_unsafe, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas, ShapeRestInfo *r_info) {
- ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get(p_shape);
+ ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape);
btCollisionShape *btShape = shape->create_bt_shape(p_xform.basis.get_scale(), p_margin);
if (!btShape->isConvex()) {
@@ -207,7 +207,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &
if (p_result_max <= 0)
return 0;
- ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get(p_shape);
+ ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape);
btCollisionShape *btShape = shape->create_bt_shape(p_shape_xform.basis.get_scale_abs(), p_margin);
if (!btShape->isConvex()) {
@@ -239,7 +239,7 @@ bool BulletPhysicsDirectSpaceState::collide_shape(RID p_shape, const Transform &
bool BulletPhysicsDirectSpaceState::rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude, uint32_t p_collision_mask, bool p_collide_with_bodies, bool p_collide_with_areas) {
- ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->get(p_shape);
+ ShapeBullet *shape = space->get_physics_server()->get_shape_owner()->getornull(p_shape);
btCollisionShape *btShape = shape->create_bt_shape(p_shape_xform.basis.get_scale_abs(), p_margin);
if (!btShape->isConvex()) {
@@ -890,8 +890,8 @@ void SpaceBullet::update_gravity() {
static ImmediateGeometry *motionVec(NULL);
static ImmediateGeometry *normalLine(NULL);
-static Ref<SpatialMaterial> red_mat;
-static Ref<SpatialMaterial> blue_mat;
+static Ref<StandardMaterial3D> red_mat;
+static Ref<StandardMaterial3D> blue_mat;
#endif
bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, PhysicsServer::MotionResult *r_result, bool p_exclude_raycast_shapes) {
@@ -908,21 +908,21 @@ bool SpaceBullet::test_body_motion(RigidBodyBullet *p_body, const Transform &p_f
motionVec->set_as_toplevel(true);
normalLine->set_as_toplevel(true);
- red_mat = Ref<SpatialMaterial>(memnew(SpatialMaterial));
- red_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ red_mat = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
+ red_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
red_mat->set_line_width(20.0);
- red_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
- red_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- red_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ red_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
+ red_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ red_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
red_mat->set_albedo(Color(1, 0, 0, 1));
motionVec->set_material_override(red_mat);
- blue_mat = Ref<SpatialMaterial>(memnew(SpatialMaterial));
- blue_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
+ blue_mat = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
+ blue_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
blue_mat->set_line_width(20.0);
- blue_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
- blue_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
- blue_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true);
+ blue_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
+ blue_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
+ blue_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
blue_mat->set_albedo(Color(0, 0, 1, 1));
normalLine->set_material_override(blue_mat);
}