Normand Briere
2019-09-29 255bcc8ac2faaf412e78e231eaa8e4a560621668
link2master + link2support + UF
13 files modified
2 files added
135 ■■■■ changed files
CSG.java 2 ●●● patch | view | raw | blame | history
CSGEditor.java 2 ●●● patch | view | raw | blame | history
CameraPane.java 13 ●●●●● patch | view | raw | blame | history
FrameSelector.java 2 ●●● patch | view | raw | blame | history
GenericJoint.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 6 ●●●● patch | view | raw | blame | history
Merge.java 4 ●●●● patch | view | raw | blame | history
Mocap.java 14 ●●●● patch | view | raw | blame | history
ObjEditor.java 60 ●●●●● patch | view | raw | blame | history
Object3D.java 24 ●●●●● patch | view | raw | blame | history
RandomNode.java 2 ●●● patch | view | raw | blame | history
SwitchNode.java 2 ●●● patch | view | raw | blame | history
cTreeModel.java 2 ●●● patch | view | raw | blame | history
fullscenes/urbanfuture3.png patch | view | raw | blame | history
fullscenes/urbanfuture4.png patch | view | raw | blame | history
CSG.java
....@@ -134,7 +134,7 @@
134134 /**/
135135 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
136136 {
137
- if (csgType == UNION || !link2master) // || csgType == MERGE)
137
+ if (csgType == UNION || !Link2Support()) // || csgType == MERGE)
138138 {
139139 BoundaryRep keep = bRep;
140140 bRep = null;
CSGEditor.java
....@@ -256,7 +256,7 @@
256256 csg.cellSize2 = size2Slider.getInteger();
257257 csg.tolerance = toleranceSlider.getFloat();
258258
259
- if (csg.link2master)
259
+ if (csg.Link2Support())
260260 csg.retile();
261261 }
262262
CameraPane.java
....@@ -1530,7 +1530,7 @@
15301530 }
15311531 }
15321532 float b = 0;
1533
- if (obj.support != null && obj.link2master)
1533
+ if (obj.support != null && obj.Link2Support())
15341534 {
15351535 b = 1;
15361536 }
....@@ -14676,9 +14676,14 @@
1467614676 RigidBody.pos.z = 0;
1467714677 if (RigidBody.justclicked)
1467814678 {
14679
- RigidBody.pos.x = (float)manipCamera.lookAt.x;
14680
- RigidBody.pos.y = (float)manipCamera.lookAt.y;
14681
- RigidBody.pos.z = (float)manipCamera.lookAt.z;
14679
+// RigidBody.pos.x = (float)manipCamera.lookAt.x;
14680
+// RigidBody.pos.y = (float)manipCamera.lookAt.y;
14681
+// RigidBody.pos.z = (float)manipCamera.lookAt.z;
14682
+ // System.err.println("selected point = " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][1]) + " " + Trunk(selectedpoint.toParent[3][2]));
14683
+ RigidBody.pos.x = (float)selectedpoint.toParent[3][0];
14684
+ RigidBody.pos.y = (float)selectedpoint.toParent[3][1];
14685
+ RigidBody.pos.z = (float)selectedpoint.toParent[3][2];
14686
+
1468214687 RigidBody.wind.set(RigidBody.pos);
1468314688 RigidBody.wind.x -= (float)manipCamera.location.x;
1468414689 RigidBody.wind.y -= (float)manipCamera.location.y;
FrameSelector.java
....@@ -25,7 +25,7 @@
2525
2626 // System.err.println("Select Frame # " + frame);
2727 // frame %= (getNumFrames() - mocap.offset);
28
- if (!link2master) // freeze current value
28
+ if (!Link2Support()) // freeze current value
2929 frame = (int)((getNumFrames() - mocap.GetFirstFrame()) * realframe);
3030 // System.err.println("Select Frame modulo # " + frame);
3131 boolean waslive = mocap.live;
GenericJoint.java
....@@ -492,7 +492,7 @@
492492
493493 tc.getFrameOffsetB(trans);
494494
495
- if (c == 8) // DEBUG
495
+ if (false) //c == 8) // DEBUG
496496 {
497497 gl.glDisable(gl.GL_LIGHTING);
498498
GroupEditor.java
....@@ -741,8 +741,6 @@
741741 morphItem.addActionListener(this);
742742
743743 menu.add("-");
744
- physicsItem = menu.add(new MenuItem("Physics"));
745
- physicsItem.addActionListener(this);
746744 frameselectorItem = menu.add(new MenuItem("Frame Selector"));
747745 frameselectorItem.addActionListener(this);
748746 scriptNodeItem = menu.add(new MenuItem("Script Node"));
....@@ -1981,12 +1979,14 @@
19811979
19821980 // particleItem = menu.add(new MenuItem("Particle system"));
19831981 // particleItem.addActionListener(this);
1984
- if (Globals.ADVANCED)
1982
+ //if (Globals.ADVANCED)
19851983 {
19861984 ragdollItem = menu.add(new MenuItem("Rag Walk"));
19871985 ragdollItem.addActionListener(this);
19881986 ragdoll2Item = menu.add(new MenuItem("Rag Fall"));
19891987 ragdoll2Item.addActionListener(this);
1988
+ physicsItem = menu.add(new MenuItem("Physics"));
1989
+ physicsItem.addActionListener(this);
19901990 }
19911991 menu.add("-");
19921992 meshItem = menu.add(new MenuItem("Dynamic Mesh"));
Merge.java
....@@ -126,7 +126,7 @@
126126
127127 bRep = null;
128128
129
- if (link2master)
129
+ if (Link2Support())
130130 renderme(); // null);
131131 }
132132
....@@ -144,7 +144,7 @@
144144 if (bRep == null && GetObject() != null)
145145 renderme(); // display); // only once
146146
147
- if (/*display.LIVE && live &&*/link2master) // && display.drawMode == display.SHADOW) // SHADOW!!!
147
+ if (/*display.LIVE && live &&*/Link2Support()) // && display.drawMode == display.SHADOW) // SHADOW!!!
148148 {
149149 try
150150 {
Mocap.java
....@@ -998,7 +998,7 @@
998998
999999 get(0).link2master = path.size() > 1; // hip orientation
10001000
1001
- if (get(0).link2master)
1001
+ if (get(0).Link2Support())
10021002 {
10031003 rotateonce = 2;
10041004 }
....@@ -1427,7 +1427,7 @@
14271427 double w = 0.00015;
14281428
14291429 //if (!sourcenode.link2master) // strong pin on floor
1430
- if (parent.link2master) // strong pin on floor
1430
+ if (parent.Link2Support()) // strong pin on floor
14311431 {
14321432 w = 0.005; // .001;
14331433 }
....@@ -1641,7 +1641,7 @@
16411641 // sourcenode.parent.toParent[3][1] = ground - floor.y;
16421642 // sourcenode.parent.toParent[3][2] += groundz - floor.z;
16431643 // sourcenode.parent.toParent[3][1] = K * (ground - floor.y) + (1 - K) * oldposy;
1644
- if (footcontact && (sourcenode.parent != null && !sourcenode.parent.link2master)) // strong pin on floor
1644
+ if (footcontact && (sourcenode.parent != null && !sourcenode.parent.Link2Support())) // strong pin on floor
16451645 {
16461646 v0.x = groundx - floor.x;
16471647 v0.y = 0; // groundx - floor.x;
....@@ -2006,7 +2006,7 @@
20062006 // if (sourcenode.link2master)
20072007 // if (goalx != 0 || goalz != 0)
20082008 // K = 0.02; // .0625;
2009
- if (parent.link2master) // strong pin on floor
2009
+ if (parent.Link2Support()) // strong pin on floor
20102010 {
20112011 K = 0.05; // 0.02;
20122012 }
....@@ -2423,9 +2423,9 @@
24232423 // SetBreakPoint(get(0).toParent[0], 0);
24242424 // }
24252425
2426
- boolean setrotation = get(0).link2master && !firsttimeafterload && frame > 0;
2426
+ boolean setrotation = get(0).Link2Support() && !firsttimeafterload && frame > 0;
24272427 boolean setposition = sourcenode != null && // sourcenode.parent != null && // july 2014
2428
- sourcenode./*parent.*/link2master && !firsttimeafterload && frame > 0;
2428
+ sourcenode./*parent.*/Link2Support() && !firsttimeafterload && frame > 0;
24292429
24302430 // cVector centroid = new cVector();
24312431 // cVector floor = new cVector();
....@@ -2858,7 +2858,7 @@
28582858
28592859 // set translation
28602860 // (currently only possible for root bone! see mocapdata.com data)
2861
- if (bone._isRoot && link2master) // && !GetFileRoot().link2master)
2861
+ if (bone._isRoot && Link2Support()) // && !GetFileRoot().link2master)
28622862 {
28632863 if (hasTranslation) // && _translationEnabled)
28642864 {
ObjEditor.java
....@@ -558,7 +558,7 @@
558558 // }
559559 // }
560560 // }
561
- cameraView.transformMode = objectTabbedPane.getSelectedIndex() == 5;
561
+ cameraView.transformMode = objectTabbedPane.getSelectedIndex() == transformTabIndex;
562562
563563 // refreshContents(false); // To refresh Info tab
564564 cameraView.repaint();
....@@ -1421,7 +1421,7 @@
14211421 randomCB = AddCheckBox(setupPanel2, "Random", copy.random);
14221422 randomCB.setToolTipText("Randomly Rewind (or Go back and forth)");
14231423
1424
- link2masterCB = AddCheckBox(setupPanel2, GetSupportText(), copy.link2master);
1424
+ link2masterCB = AddCheckBox(setupPanel2, GetSupportText(), copy.Link2Support());
14251425 link2masterCB.setToolTipText("Link to support");
14261426
14271427 if (Globals.ADVANCED)
....@@ -1600,6 +1600,8 @@
16001600 }
16011601
16021602 int objectTabCount;
1603
+
1604
+ int transformTabIndex;
16031605
16041606 void SetupViews()
16051607 {
....@@ -1792,12 +1794,15 @@
17921794 objectTabbedPane.add(materialPanel);
17931795 objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/material.png"));
17941796 objectTabbedPane.setToolTipTextAt(objectTabCount++, "Material");
1795
-
1797
+
1798
+ if (Globals.ADVANCED)
1799
+ {
17961800 figurePanel = new cGridBag();
17971801 figurePanel.add(new cButton("FIGURES and POSES coming soon!"));
17981802 objectTabbedPane.add(figurePanel);
17991803 objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/figure.png"));
18001804 objectTabbedPane.setToolTipTextAt(objectTabCount++, "Figures and poses");
1805
+ }
18011806
18021807 // JPanel north = new JPanel(new BorderLayout());
18031808 // north.setName("Edit");
....@@ -1806,7 +1811,8 @@
18061811 objectTabbedPane.add(editPanel);
18071812 objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/writewhite.png"));
18081813 objectTabbedPane.setToolTipTextAt(objectTabCount++, "Edit controls");
1809
-
1814
+
1815
+ transformTabIndex = objectTabCount;
18101816 objectTabbedPane.add(transformPanel);
18111817 objectTabbedPane.setIconAt(objectTabCount, GetIcon("icons/XYZ.png"));
18121818 objectTabbedPane.setToolTipTextAt(objectTabCount++, "TRS transform");
....@@ -2037,6 +2043,52 @@
20372043
20382044 fullscenePanel.Return();
20392045
2046
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/urbanfuture3.png", !Globals.NIMBUSLAF));
2047
+ fullsceneButton.setToolTipText("Urban Future!");
2048
+ fullsceneButton.addActionListener(new ActionListener()
2049
+ {
2050
+ @Override
2051
+ public void actionPerformed(ActionEvent e)
2052
+ {
2053
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/uf3.gfd", new iCallBack()
2054
+ {
2055
+
2056
+ public void Callback(Object obj)
2057
+ {
2058
+ LoadIt(obj);
2059
+ }
2060
+
2061
+ public void DragGesture()
2062
+ {
2063
+ }
2064
+ });
2065
+ }
2066
+ });
2067
+
2068
+ fullscenePanel.add(fullsceneButton = GetButton("fullscenes/urbanfuture4.png", !Globals.NIMBUSLAF));
2069
+ fullsceneButton.setToolTipText("Street Level!");
2070
+ fullsceneButton.addActionListener(new ActionListener()
2071
+ {
2072
+ @Override
2073
+ public void actionPerformed(ActionEvent e)
2074
+ {
2075
+ ReadGFD("https://www.noaofarc.ca/akeeba/categories/Applications/uf4.gfd", new iCallBack()
2076
+ {
2077
+
2078
+ public void Callback(Object obj)
2079
+ {
2080
+ LoadIt(obj);
2081
+ }
2082
+
2083
+ public void DragGesture()
2084
+ {
2085
+ }
2086
+ });
2087
+ }
2088
+ });
2089
+
2090
+ fullscenePanel.Return();
2091
+
20402092 fullscenePanel.add(new cGridBag());
20412093 fullscenePanel.add(new cGridBag());
20422094 fullscenePanel.Return();
Object3D.java
....@@ -100,7 +100,7 @@
100100 other.softtouched = softtouched;
101101
102102 other.random = random;
103
- other.link2master = link2master;
103
+ other.link2master = Link2Support();
104104 other.transformcount = transformcount;
105105 other.marked = marked;
106106 other.skip = skip;
....@@ -220,7 +220,7 @@
220220 return;
221221
222222 transientsupport = support;
223
- transientlink2master = link2master;
223
+ transientlink2master = Link2Support();
224224
225225 support = null;
226226 link2master = false;
....@@ -633,7 +633,10 @@
633633 transient boolean keepdontselect;
634634 boolean dontselect = false;
635635 boolean hide = false;
636
+
636637 boolean link2master = false; // performs reset support/master at each frame (cannot rename due to serialization)
638
+ boolean link2support = false; // (cannot rename due to serialization)
639
+
637640 boolean marked = false; // animation node
638641 boolean skip = false; // centroid issue
639642 boolean skipmocap = false; // mocap data
....@@ -6154,7 +6157,7 @@
61546157 boolean NeedSupport()
61556158 {
61566159 return
6157
- CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
6160
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && Link2Support() && /*live &&*/ support != null
61586161 // PROBLEM with CROWD!!
61596162 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
61606163 }
....@@ -6177,6 +6180,11 @@
61776180 return live && bRep != null;
61786181 }
61796182
6183
+ boolean Link2Support()
6184
+ {
6185
+ return link2master || link2support;
6186
+ }
6187
+
61806188 static cVector minima = new cVector();
61816189 static cVector maxima = new cVector();
61826190 static javax.vecmath.Point3d center = new javax.vecmath.Point3d();
....@@ -6190,7 +6198,7 @@
61906198 // System.err.println("Draw " + this + " Frame # " + ((Mocap)((Merge)support).object).frame);
61916199 }
61926200
6193
- if (live && link2master && support == null && !this.marked) // project on ground
6201
+ if (live && Link2Support() && support == null && !this.marked) // project on ground
61946202 {
61956203 getBounds(minima, maxima, true);
61966204 center.x = (minima.x + maxima.x) / 2;
....@@ -6265,7 +6273,7 @@
62656273 support = support;
62666274
62676275 boolean usecalllists = !IsDynamic() &&
6268
- IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6276
+ IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !Link2Support()); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
62696277 //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
62706278
62716279 //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
....@@ -6373,7 +6381,7 @@
63736381 {
63746382 if (display.DrawMode() == iCameraPane.SHADOW)
63756383 {
6376
- if (!link2master // tricky to cull in shadow mode.
6384
+ if (!Link2Support() // tricky to cull in shadow mode.
63776385 && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
63786386 {
63796387 //System.out.print("CULLED");
....@@ -6846,7 +6854,7 @@
68466854
68476855 //javax.media.opengl.GL gl = display.GetGL();
68486856
6849
- if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
6857
+ if (CameraPane.BOXMODE && !Link2Support()) //selected) // || CameraPane.movingcamera)
68506858 {
68516859 int fc = bRep.FaceCount();
68526860 int vc = bRep.VertexCount();
....@@ -8917,7 +8925,7 @@
89178925
89188926 boolean touch = false;
89198927
8920
- if (bRep != null && link2master)
8928
+ if (bRep != null && Link2Support())
89218929 {
89228930 if (bbox == null)
89238931 {
RandomNode.java
....@@ -36,7 +36,7 @@
3636
3737 boolean IsSwitch()
3838 {
39
- return CameraPane.SWITCH && !this.link2master;
39
+ return CameraPane.SWITCH && !this.Link2Support();
4040 }
4141
4242 public int size()
SwitchNode.java
....@@ -63,7 +63,7 @@
6363 {
6464 countspeed = speed;
6565
66
- if (toggleneutral || !link2master)
66
+ if (toggleneutral || !Link2Support())
6767 {
6868 do
6969 {
cTreeModel.java
....@@ -96,7 +96,7 @@
9696 r = 192;
9797 }
9898
99
- if (obj.link2master)
99
+ if (obj.Link2Support())
100100 {
101101 b = 192;
102102 }
fullscenes/urbanfuture3.png
Binary files differ
fullscenes/urbanfuture4.png
Binary files differ