From fd420671d401139e1070050e994af0c102409c41 Mon Sep 17 00:00:00 2001 From: Benjamin Deleze Date: Tue, 15 Aug 2023 15:05:38 +0200 Subject: [PATCH] Fix ljoint bo --- .../objects/factory/pipes/protos/LJoint.proto | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/projects/objects/factory/pipes/protos/LJoint.proto b/projects/objects/factory/pipes/protos/LJoint.proto index 51f02565dd4..2a61e1f775e 100644 --- a/projects/objects/factory/pipes/protos/LJoint.proto +++ b/projects/objects/factory/pipes/protos/LJoint.proto @@ -4,6 +4,7 @@ # documentation url: https://webots.cloud/run?url=https://github.com/cyberbotics/webots/blob/released/projects/objects/factory/pipes/protos/LJoint.proto # keywords: industrial/plumbing # 90-degree L-joint for connecting pipes. +# template language: javascript EXTERNPROTO "webots://projects/appearances/protos/OldSteel.proto" @@ -15,6 +16,11 @@ PROTO LJoint [ field SFNode appearance OldSteel { textureTransform TextureTransform { rotation 0.78 scale 2 2 } } # Defines the appearance of the pipe. ] { +%< + const scaleX = fields.scale.value.x; + const scaleY = fields.scale.value.y; + const scaleZ = fields.scale.value.z; +>% Solid { translation IS translation rotation IS rotation @@ -325,33 +331,33 @@ PROTO LJoint [ boundingObject Group { children [ Pose { - translation 0.031098346 0 -0.036 + translation %<= scaleX * 0.031098346 >% 0 %<= scaleZ * -0.036 >% rotation 0 1 0 1.8325997 children [ Capsule { - height 0.04 - radius 0.035 + height %<= scaleX * 0.04 >% + radius %<= scaleX * 0.035 >% } ] } Pose { - translation -0.036079734 0 0.029794677 + translation %<= scaleX * -0.036079734 >% 0 %<= scaleZ * 0.029794677 >% rotation 0 -1 0 0.2 children [ Capsule { - height 0.04 - radius 0.035 + height %<= scaleX * 0.04 >% + radius %<= scaleX * 0.035 >% } ] translationStep 0.001 } Pose { - translation -0.019555909 0 -0.0041774259 + translation %<= scaleX * -0.019555909 >% 0 %<= scaleZ * -0.0041774259 >% rotation 0 1 0 -0.59269969 children [ Capsule { - height 0.04 - radius 0.035 + height %<= scaleX * 0.04 >% + radius %<= scaleX * 0.035 >% } ] rotationStep 0.01