diff --git a/examples_dd3d/DebugDrawDemoScene.gd b/examples_dd3d/DebugDrawDemoScene.gd index 2eb05a49..c5ba1259 100644 --- a/examples_dd3d/DebugDrawDemoScene.gd +++ b/examples_dd3d/DebugDrawDemoScene.gd @@ -164,7 +164,7 @@ func main_update(delta: float) -> void: # Boxes DebugDraw3D.draw_box_xf($Boxes/Box1.global_transform, Color.MEDIUM_PURPLE) - DebugDraw3D.draw_box($Boxes/Box2.global_position, Quaternion.IDENTITY, Vector3.ONE, Color.REBECCA_PURPLE) + DebugDraw3D.draw_box($Boxes/Box2.global_position, Quaternion.from_euler(Vector3(0, deg_to_rad(45), deg_to_rad(45))), Vector3.ONE, Color.REBECCA_PURPLE) DebugDraw3D.draw_box_xf(Transform3D(Basis(Vector3.UP, PI * 0.25).scaled(Vector3.ONE * 2), $Boxes/Box3.global_position), Color.ROSY_BROWN) DebugDraw3D.draw_aabb(AABB($Boxes/AABB_fixed.global_position, Vector3(2, 1, 2)), Color.AQUA) diff --git a/examples_dd3d/DebugDrawDemoScene.tscn b/examples_dd3d/DebugDrawDemoScene.tscn index 41aeb7f4..9453c1a5 100644 --- a/examples_dd3d/DebugDrawDemoScene.tscn +++ b/examples_dd3d/DebugDrawDemoScene.tscn @@ -402,7 +402,7 @@ transform = Transform3D(2.90583, -0.000527017, -5.34615, 0.00469241, 3.92788, 0. rotation_edit_mode = 2 [node name="Box2" type="Node3D" parent="Boxes"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.104528, -0.809874, 2.10804) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.531922, -1.34723, 1.44924) [node name="Box3" type="Node3D" parent="Boxes"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.34837, -1.08298, 4.36414) diff --git a/examples_dd3d/DebugDrawDemoSceneCS.cs b/examples_dd3d/DebugDrawDemoSceneCS.cs index adad6d3f..dfc588d1 100644 --- a/examples_dd3d/DebugDrawDemoSceneCS.cs +++ b/examples_dd3d/DebugDrawDemoSceneCS.cs @@ -351,7 +351,7 @@ void MainUpdate(double delta) // Boxes DebugDraw3D.DrawBoxXf(dBox1.GlobalTransform, Colors.MediumPurple); - DebugDraw3D.DrawBox(dBox2.GlobalPosition, Quaternion.Identity, Vector3.One, Colors.RebeccaPurple); + DebugDraw3D.DrawBox(dBox2.GlobalPosition, Quaternion.FromEuler(new Vector3(0, Mathf.DegToRad(45), Mathf.DegToRad(45))), Vector3.One, Colors.RebeccaPurple); DebugDraw3D.DrawBoxXf(new Transform3D(new Basis(Vector3.Up, Mathf.Pi * 0.25f).Scaled(Vector3.One * 2), dBox3.GlobalPosition), Colors.RosyBrown); DebugDraw3D.DrawAabb(new Aabb(dAABB_fixed.GlobalPosition, new Vector3(2, 1, 2)), Colors.Aqua); diff --git a/src/3d/debug_draw_3d.cpp b/src/3d/debug_draw_3d.cpp index 1ec35728..4e7be54b 100644 --- a/src/3d/debug_draw_3d.cpp +++ b/src/3d/debug_draw_3d.cpp @@ -634,7 +634,7 @@ void DebugDraw3D::draw_cylinder_ab(const Vector3 &a, const Vector3 &b, const rea void DebugDraw3D::draw_box(const Vector3 &position, const Quaternion &rotation, const Vector3 &size, const Color &color, const bool &is_box_centered, const real_t &duration) { ZoneScoped; CHECK_BEFORE_CALL(); - draw_box_xf(Transform3D(Basis(rotation).scaled(size), position), color, is_box_centered, duration); + draw_box_xf(Transform3D(Basis(rotation, size), position), color, is_box_centered, duration); } void DebugDraw3D::draw_box_ab(const Vector3 &a, const Vector3 &b, const Vector3 &up, const Color &color, const bool &is_ab_diagonal, const real_t &duration) {