Skip to content

Commit

Permalink
Remove dbg! statements
Browse files Browse the repository at this point in the history
Whoops.
  • Loading branch information
Demindiro committed Jun 25, 2021
1 parent e304d97 commit ce74081
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 3 deletions.
17 changes: 17 additions & 0 deletions benchmark/exclusion/exclude_all.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends Node


export var box: PackedScene
export var count := 1000
export var spawn := Vector3(0, 1, 0)


func _ready():
var list := []
for _i in 1000:
var b: RigidBody = box;
for e in list:
b.add_collision_exception_with(e)
b.translation = spawn
add_child(b)
list.push(b)
9 changes: 9 additions & 0 deletions benchmark/exclusion/exclude_all.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://benchmark/environment.tscn" type="PackedScene" id=1]
[ext_resource path="res://benchmark/exclusion/exclude_all.gd" type="Script" id=2]

[node name="Exclude all" type="Node"]
script = ExtResource( 2 )

[node name="Environment" parent="." instance=ExtResource( 1 )]
29 changes: 29 additions & 0 deletions benchmark/heightmap/boxes.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
extends Node


export var box: PackedScene
export var count_x := 50
export var count_y := 50
export var start := Vector3(-45, 10, -45)
export var end := Vector3(45, 10, 45)
export var colors := [
Color.white,
Color.red,
Color.green,
Color.blue,
Color.cyan,
Color.pink,
]

func _ready():
var d := (end - start) / Vector3(count_x, 1.0, count_y)
var i := 0
for x in count_x:
for y in count_y:
var p := start + d * Vector3(x, 0.0, y)
var b: Spatial = box.instance()
b.translation = p
b.can_sleep = false
b.get_node("Mesh").color = colors[i % len(colors)]
add_child(b)
i += 1
42 changes: 42 additions & 0 deletions benchmark/heightmap/boxes.tscn

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions benchmark/joint/slider.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://benchmark/boxes/box_godot.tscn" type="PackedScene" id=1]

[sub_resource type="BoxShape" id=1]

[node name="Slider" type="Node"]

[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.965926, 0.258819, 0, -0.258819, 0.965926, 0, 2, 8 )

[node name="StaticBody" type="RigidBody" parent="."]
axis_lock_linear_x = true
axis_lock_linear_y = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true

[node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 0, 0 )
shape = SubResource( 1 )

[node name="SliderJoint" type="SliderJoint" parent="."]
transform = Transform( 0.965926, 0.258819, 0, -0.258819, 0.965926, 0, 0, 0, 1, 0, 0, 0 )
nodes/node_a = NodePath("../StaticBody")
nodes/node_b = NodePath("../Box")
linear_limit/lower_distance = -6.0

[node name="Box" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0 )
mass = 1000.0
3 changes: 0 additions & 3 deletions rapier3d/src/server/joint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ fn create_hinge(
body_b: Index,
transform_b: &Transform,
) -> Option<Index> {
dbg!("CREATE MEEEEE");
let body_a = if let Index::Body(index) = body_a {
index
} else {
Expand Down Expand Up @@ -192,11 +191,9 @@ fn create_hinge(
}

fn disable_collisions_between_bodies(joint: Index, disable: bool) {
dbg!("I live you shit");
// *disable* collisions = *enable* exclusion
let enable = disable;
map_or_err!(joint, map_joint_mut, |joint, _| {
dbg!(joint.exclude_bodies, enable);
if joint.exclude_bodies != enable {
joint.exclude_bodies = enable;
if let Instance::Attached(joint, space) = joint.joint {
Expand Down
30 changes: 30 additions & 0 deletions test/lock/lock.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://benchmark/bodies/box.tscn" type="PackedScene" id=1]

[node name="Node" type="Node"]

[node name="Camera" type="Camera" parent="."]
transform = Transform( 1, 0, 0, 0, 0.965926, 0.258819, 0, -0.258819, 0.965926, 0, 5, 14 )

[node name="Lock translation" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 0 )
axis_lock_linear_x = true
axis_lock_linear_y = true
axis_lock_linear_z = true

[node name="Lock translation + rotation" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 0 )
axis_lock_linear_x = true
axis_lock_linear_y = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true

[node name="Lock none" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.18644, 1.24856, 0 )

[node name="Lock rotation Z" parent="." instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2.20791, 1.27471, 0 )
axis_lock_angular_z = true

0 comments on commit ce74081

Please sign in to comment.