File tree Expand file tree Collapse file tree
Scripts/Modules/Components
Virtual Capsule Endoscopy/Scenes/SofaScenes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,10 +10,8 @@ RenderTexture:
1010 m_ImageContentsHash:
1111 serializedVersion: 2
1212 Hash: 00000000000000000000000000000000
13- m_ForcedFallbackFormat: 4
14- m_DownscaleFallback: 0
1513 m_IsAlphaChannelOptional: 0
16- serializedVersion: 5
14+ serializedVersion: 6
1715 m_Width: 1024
1816 m_Height: 1024
1917 m_AntiAliasing: 1
@@ -24,6 +22,7 @@ RenderTexture:
2422 m_GenerateMips: 1
2523 m_SRGB: 0
2624 m_UseDynamicScale: 0
25+ m_UseDynamicScaleExplicit: 0
2726 m_BindMS: 0
2827 m_EnableCompatibleFormat: 1
2928 m_EnableRandomWrite: 0
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ protected override void UpdateBeamMesh()
9696
9797 // update position vectors for camera
9898 Vector3 sofaScale = m_sofaMesh . m_sofaContext . GetScaleSofaToUnity ( ) ;
99-
99+
100100 m_tipPosition [ 0 ] = m_vertCenter [ 0 ] [ 0 ] * sofaScale [ 0 ] + this . transform . position [ 0 ] ;
101101 m_tipPosition [ 1 ] = m_vertCenter [ 0 ] [ 1 ] * sofaScale [ 1 ] + this . transform . position [ 1 ] ;
102102 m_tipPosition [ 2 ] = m_vertCenter [ 0 ] [ 2 ] * sofaScale [ 2 ] + this . transform . position [ 2 ] ;
@@ -141,9 +141,11 @@ void UpdateCamera()
141141 if ( m_childCameraScript == null )
142142 return ;
143143
144-
145- m_childCameraScript . transform . position = m_tipPosition ;
146- m_childCameraScript . transform . forward = m_tipDirection ;
144+
145+ Vector3 localPos = m_sofaMesh . m_sofaContext . transform . TransformPoint ( m_vertCenter [ 0 ] ) ;
146+ Vector3 localPosN = m_sofaMesh . m_sofaContext . transform . TransformPoint ( m_vertCenter [ 1 ] ) ;
147+ m_childCameraScript . transform . position = localPos ; // m_sofaMesh.m_sofaContext.transform.TransformPoint(m_tipPosition);
148+ m_childCameraScript . transform . forward = ( localPos - localPosN ) ;
147149 }
148150
149151
Original file line number Diff line number Diff line change 5858 startingPos =" 0 0 0 0 -0.7071068 0 0.7071068" xtip =" 0 0 0"
5959 step =" 0.5" speed =" 0.0"
6060 listening =" 1" controlledInstrument =" 0" />
61- <FixedConstraint name =" FixedConstraint" indices =" 0" />
61+ <FixedProjectiveConstraint name =" FixedConstraint" indices =" 0" />
6262 <RestShapeSpringsForceField name =" RestSPForceField" points =" @DeployController.indexFirstNode" angularStiffness =" 1e20" stiffness =" 1e20" />
6363 <LinearSolverConstraintCorrection wire_optimization =" true" />
6464
Original file line number Diff line number Diff line change 6565 />
6666
6767 <LinearSolverConstraintCorrection printLog =" 0" wire_optimization =" true" />
68- <FixedConstraint name =" FixStart1" indices =" 0" />
68+ <FixedProjectiveConstraint name =" FixStart1" indices =" 0" />
6969 <RestShapeSpringsForceField name =" RestSPForceField" points =" @DeployController.indexFirstNode" angularStiffness =" 1e8" stiffness =" 1e8" />
7070
7171 <!-- COLLISION
Original file line number Diff line number Diff line change 5757 speed =" 0.0" startingPos =" 3 3 -4 0.4689105 0.5470623 0 0.6934305" step =" 0.1" template =" Rigid3d" xtip =" 0.1" />
5858
5959 <LinearSolverConstraintCorrection wire_optimization =" true" />
60- <FixedConstraint name =" FixStart1" indices =" 0" />
60+ <FixedProjectiveConstraint name =" FixStart1" indices =" 0" />
6161 <RestShapeSpringsForceField name =" RestSPForceField" points =" @DeployController.indexFirstNode" angularStiffness =" 1e8" stiffness =" 1e8" />
6262
6363 <!-- COLLISION -->
Original file line number Diff line number Diff line change 4747
4848
4949 <BoxROI name =" FixedROI_1" box =" -4.1 9.4 1.9 -3.7 11.6 4.1" drawBoxes =" 0" position =" @dofs.rest_position" />
50- <FixedConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
50+ <FixedProjectiveConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
5151
5252 <BoxROI name =" FixedROI_2" box =" -4.1 9.4 1.9 -1.9 11.6 2.3" drawBoxes =" 0" position =" @dofs.rest_position" />
53- <FixedConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
53+ <FixedProjectiveConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
5454
5555 <BoxROI name =" FixedROI_3" box =" -4.1 11.2 1.9 -1.9 11.6 4.1" drawBoxes =" 0" position =" @dofs.rest_position" />
56- <FixedConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
56+ <FixedProjectiveConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
5757
5858 <BoxROI name =" FixedROI_4" box =" -4.1 9.6 1.9 -1.9 10 4.1" drawBoxes =" 0" position =" @dofs.rest_position" />
59- <FixedConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
59+ <FixedProjectiveConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
6060
6161
6262 <DiagonalMass totalMass =" 0.1" />
Original file line number Diff line number Diff line change 2828
2929
3030 <BoxROI name =" FixedROI_1" box =" -4.1 9.4 1.9 -3.7 11.6 4.1" drawBoxes =" 0" position =" @dofs.rest_position" />
31- <FixedConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
31+ <FixedProjectiveConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
3232
3333 <BoxROI name =" FixedROI_2" box =" -4.1 9.4 1.9 -1.9 11.6 2.3" drawBoxes =" 0" position =" @dofs.rest_position" />
34- <FixedConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
34+ <FixedProjectiveConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
3535
3636 <BoxROI name =" FixedROI_3" box =" -4.1 11.2 1.9 -1.9 11.6 4.1" drawBoxes =" 0" position =" @dofs.rest_position" />
37- <FixedConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
37+ <FixedProjectiveConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
3838
3939 <BoxROI name =" FixedROI_4" box =" -4.1 9.6 1.9 -1.9 10 4.1" drawBoxes =" 0" position =" @dofs.rest_position" />
40- <FixedConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
40+ <FixedProjectiveConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
4141
4242 <DiagonalMass totalMass =" 0.1" />
4343 <TetrahedralCorotationalFEMForceField name =" FEM" youngModulus =" 60" poissonRatio =" 0.3" method =" large" />
Original file line number Diff line number Diff line change 2424
2525
2626 <BoxROI name =" FixedROI_1" box =" -1 7 2 -7 8.5 5" drawBoxes =" 0" position =" @dofs.rest_position" />
27- <FixedConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
27+ <FixedProjectiveConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
2828
2929 <BoxROI name =" FixedROI_2" box =" -1 8 -4 -7 9.2 2" drawBoxes =" 1" position =" @dofs.rest_position" />
30- <FixedConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
30+ <FixedProjectiveConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
3131
3232 <BoxROI name =" FixedROI_3" box =" -1 11 -4 -7 12 0.5" drawBoxes =" 0" position =" @dofs.rest_position" />
33- <FixedConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
33+ <FixedProjectiveConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
3434
3535 <BoxROI name =" FixedROI_4" box =" -4.5 11 -1 -7 12 2" drawBoxes =" 0" position =" @dofs.rest_position" />
36- <FixedConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
36+ <FixedProjectiveConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
3737
3838 <DiagonalMass totalMass =" 0.1" />
3939 <TetrahedralCorotationalFEMForceField name =" FEM" youngModulus =" 100" poissonRatio =" 0.3" method =" large" />
Original file line number Diff line number Diff line change 2323 <HexahedronFEMForceField name =" FEM" youngModulus =" 100.0" poissonRatio =" 0.3" method =" large" printLog =" 0" />
2424
2525 <BoxROI name =" FixedROI_1" box =" -1 7 2 -7 8.5 5" drawBoxes =" 1" position =" @dofs.rest_position" />
26- <FixedConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
26+ <FixedProjectiveConstraint name =" ROI1" indices =" @FixedROI_1.indices" />
2727
2828 <BoxROI name =" FixedROI_2" box =" -1 8 -4 -7 9 0" drawBoxes =" 1" position =" @dofs.rest_position" />
29- <FixedConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
29+ <FixedProjectiveConstraint name =" ROI2" indices =" @FixedROI_2.indices" />
3030
3131 <BoxROI name =" FixedROI_3" box =" -1 11 -4 -7 12 0.5" drawBoxes =" 1" position =" @dofs.rest_position" />
32- <FixedConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
32+ <FixedProjectiveConstraint name =" ROI3" indices =" @FixedROI_3.indices" />
3333
3434 <BoxROI name =" FixedROI_4" box =" -4.5 11 -1 -7 12 2" drawBoxes =" 1" position =" @dofs.rest_position" />
35- <FixedConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
35+ <FixedProjectiveConstraint name =" ROI4" indices =" @FixedROI_4.indices" />
3636
3737 <UncoupledConstraintCorrection />
3838
You can’t perform that action at this time.
0 commit comments