@@ -14,73 +14,6 @@ visualize!(renderer::Modia3D.AbstractRenderer, time::Float64) = error("No render
1414closeVisualization (renderer:: Modia3D.AbstractRenderer ) = error (" No renderer defined." )
1515
1616
17- # -------------------------------------- Default Contact Detection -------------------------------
18-
19- """
20- ContactPairs(nzmax, collSuperObjs, noCPairs, dummyObject3D)
21-
22- Generate a new ContactPairs structure used for communication between the Object3D handler and a ContactDetection handler.
23-
24- - `DummyObject3D::Modia3D.AbstractObject3DFeature`: A dummy Object3D that can be used in the struct as element of a vector of Object3Ds
25- to fill the vector with a dummy value of the correct type.
26- """
27- mutable struct ContactPairs
28- # Solid shapes used in contact detection (provided by Object3D handler)
29- allowedToMove:: Vector{Union{Bool,Nothing}}
30- dummyObject3D:: Modia3D.AbstractObject3DFeature # Dummy Object3D for non-used elements of z-Vector.
31-
32- # Dimensions
33- ne:: Int # length(collSuperObjs)
34- nz:: Int # length(z)
35- nzContact:: Int # length(z | z has contact) length of z where zi has contact
36-
37- function ContactPairs (world:: Composition.Object3D , AABB:: Vector{Vector{Basics.BoundingBox}} , superObjs:: Vector{SuperObjsRow} ,
38- allowedToMove:: Vector{Union{Bool,Nothing}} , visualizeBoundingBox:: Bool , nVisualContSupPoints:: Int ,
39- visualizeContactPoints:: Bool , visualizeSupportPoints:: Bool , defaultContactSphereDiameter:: Float64 )
40- @assert (length (superObjs) > 0 )
41- @assert (nVisualContSupPoints > 0 )
42- dummyObject3D = Composition. emptyObject3DFeature
43-
44- lengthCollSuperObjs = length (superObjs)
45- if lengthCollSuperObjs <= 1
46- error (" There's nothing to collide. All Object3Ds are rigidly connected." )
47- end
48-
49- nzContact = 0
50- nz = 2
51-
52- if lengthCollSuperObjs > 2
53- nz = lengthCollSuperObjs
54- end
55-
56- amountVisuPoints = 1
57- amountSuppPoints = 1
58- if visualizeContactPoints
59- addContactVisuObjToWorld! (world, nVisualContSupPoints, defaultContactSphereDiameter)
60- end
61- if visualizeSupportPoints
62- addSupportVisuObjToWorld! (world, nVisualContSupPoints, defaultContactSphereDiameter)
63- end
64-
65- if visualizeBoundingBox
66- addAABBVisuToWorld! (world, AABB)
67- end
68-
69-
70- new (allowedToMove, dummyObject3D, lengthCollSuperObjs, nz, nzContact)
71- end
72- end
73-
74- initializeContactDetection! (ch:: Modia3D.AbstractContactDetection , collSuperObjs:: Vector{Vector{Modia3D.AbstractObject3DFeature}} , noCPairs:: Vector{Vector{Int64}} ) = error (" No contact detection handler defined." )
75- selectContactPairsWithEvent! (ch:: Modia3D.AbstractContactDetection ) = error (" No contact detection handler defined." )
76- selectContactPairsNoEvent! (ch:: Modia3D.AbstractContactDetection ) = error (" No contact detection handler defined." )
77- getDistances! (ch:: Modia3D.AbstractContactDetection ) = error (" No contact detection handler defined." )
78- setComputationFlag (ch:: Modia3D.AbstractContactDetection ) = error (" No contact detection handler defined." )
79- closeContactDetection! (ch:: Modia3D.AbstractContactDetection ) = error (" No contact detection handler defined." )
80-
81- include (joinpath (Modia3D. path, " src" , " contactDetection" , " ContactDetectionMPR" , " ContactDetectionMPR_handler.jl" ))
82-
83-
8417
8518# -------------------------------------- Gravity field ----------------------------------
8619
0 commit comments