publish
This commit is contained in:
parent
f38388896d
commit
2f62a1a123
67 changed files with 4545 additions and 0 deletions
8
Roboter_Demo/META-INF/MANIFEST.MF
Normal file
8
Roboter_Demo/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,8 @@
|
|||
Manifest-Version: 1.0
|
||||
Ant-Version: Apache Ant 1.9.7
|
||||
Created-By: 1.8.0_172-b11 (Oracle Corporation)
|
||||
Class-Path: lib/SC_DLL_Wrapper.jar lib/jogamp-fat.jar lib/j3dcore.jar
|
||||
lib/j3dutils.jar lib/vecmath.jar
|
||||
X-COMMENT: Main-Class will be added automatically by build
|
||||
Main-Class: roboter_demo.RoboterApp
|
||||
|
BIN
Roboter_Demo/pics/roboter.ico
Normal file
BIN
Roboter_Demo/pics/roboter.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
Roboter_Demo/pics/roboter_16.png
Normal file
BIN
Roboter_Demo/pics/roboter_16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 519 B |
BIN
Roboter_Demo/pics/roboter_32.png
Normal file
BIN
Roboter_Demo/pics/roboter_32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
BIN
Roboter_Demo/pics/roboter_64.png
Normal file
BIN
Roboter_Demo/pics/roboter_64.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
143
Roboter_Demo/roboter_demo/Base.java
Normal file
143
Roboter_Demo/roboter_demo/Base.java
Normal file
|
@ -0,0 +1,143 @@
|
|||
package roboter_demo;
|
||||
|
||||
import com.sun.j3d.utils.geometry.Box;
|
||||
import javax.media.j3d.Appearance;
|
||||
import javax.media.j3d.BranchGroup;
|
||||
import javax.media.j3d.Material;
|
||||
import javax.media.j3d.Node;
|
||||
import javax.media.j3d.Transform3D;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.vecmath.Vector3d;
|
||||
|
||||
class Base {
|
||||
private final float mWidth = 1.0F;
|
||||
|
||||
private final float mScale = 1.0F;
|
||||
|
||||
private final Vector3d mNullVec = new Vector3d(0.0D, 0.5D, 0.0D);
|
||||
|
||||
private BranchGroup mBrGrp = new BranchGroup();
|
||||
|
||||
private TransformGroup mBaseTfGrp;
|
||||
|
||||
private TransformGroup mUpperArmTfGrp = new TransformGroup();
|
||||
|
||||
private UpperArm mUpperArm = new UpperArm();
|
||||
|
||||
private double mAngle;
|
||||
|
||||
private Transform3D mRotTf = new Transform3D();
|
||||
|
||||
public BranchGroup getBrGrp() {
|
||||
return this.mBrGrp;
|
||||
}
|
||||
|
||||
public void incUpperArmAngle() {
|
||||
this.mUpperArm.incAngle();
|
||||
}
|
||||
|
||||
public void decUpperArmAngle() {
|
||||
this.mUpperArm.decAngle();
|
||||
}
|
||||
|
||||
public void incForeArmAngle() {
|
||||
this.mUpperArm.incForeArmAngle();
|
||||
}
|
||||
|
||||
public void decForeArmAngle() {
|
||||
this.mUpperArm.decForeArmAngle();
|
||||
}
|
||||
|
||||
public void incWristAngle() {
|
||||
this.mUpperArm.incWristAngle();
|
||||
}
|
||||
|
||||
public void decWristAngle() {
|
||||
this.mUpperArm.decWristAngle();
|
||||
}
|
||||
|
||||
public void incHandAngle() {
|
||||
this.mUpperArm.incHandAngle();
|
||||
}
|
||||
|
||||
public void decHandAngle() {
|
||||
this.mUpperArm.decHandAngle();
|
||||
}
|
||||
|
||||
public void incHandSpan() {
|
||||
this.mUpperArm.incHandSpan();
|
||||
}
|
||||
|
||||
public void decHandSpan() {
|
||||
this.mUpperArm.decHandSpan();
|
||||
}
|
||||
|
||||
public void incUpperArmAngle(double paramDouble) {
|
||||
this.mUpperArm.incAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incForeArmAngle(double paramDouble) {
|
||||
this.mUpperArm.incForeArmAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incWristAngle(double paramDouble) {
|
||||
this.mUpperArm.incWristAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandAngle(double paramDouble) {
|
||||
this.mUpperArm.incHandAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandSpan(double paramDouble) {
|
||||
this.mUpperArm.incHandSpan(paramDouble);
|
||||
}
|
||||
|
||||
public Base(TransformGroup paramTransformGroup) {
|
||||
Box box = new Box(0.5F, 0.5F, 0.25F, 1, null);
|
||||
Material material = new Material();
|
||||
Appearance appearance = new Appearance();
|
||||
Transform3D transform3D = new Transform3D();
|
||||
Vector3d vector3d = new Vector3d();
|
||||
this.mBaseTfGrp = paramTransformGroup;
|
||||
this.mBaseTfGrp.addChild((Node)box);
|
||||
this.mUpperArmTfGrp.addChild((Node)this.mUpperArm.getBrGrp());
|
||||
this.mBaseTfGrp.addChild((Node)this.mUpperArmTfGrp);
|
||||
this.mBrGrp.addChild((Node)this.mBaseTfGrp);
|
||||
vector3d.set(0.0D, 0.5D, 0.0D);
|
||||
transform3D.setTranslation(vector3d);
|
||||
this.mBaseTfGrp.setTransform(transform3D);
|
||||
vector3d.set(0.5D, 0.875D, 0.25D);
|
||||
transform3D.setTranslation(vector3d);
|
||||
this.mUpperArmTfGrp.setTransform(transform3D);
|
||||
material.setDiffuseColor(1.0F, 0.0F, 0.0F);
|
||||
material.setAmbientColor(0.4F, 0.0F, 0.0F);
|
||||
appearance.setMaterial(material);
|
||||
box.setAppearance(appearance);
|
||||
this.mBaseTfGrp.setCapability(18);
|
||||
}
|
||||
|
||||
public void incBaseAngle() {
|
||||
rotateBase(0.02D);
|
||||
}
|
||||
|
||||
private void rotateBase(double paramDouble) {
|
||||
this.mAngle += paramDouble;
|
||||
this.mRotTf.rotY(this.mAngle);
|
||||
this.mRotTf.setTranslation(this.mNullVec);
|
||||
this.mBaseTfGrp.setTransform(this.mRotTf);
|
||||
}
|
||||
|
||||
public void incBaseAngle(double paramDouble) {
|
||||
rotateBase(paramDouble);
|
||||
}
|
||||
|
||||
public void decBaseAngle() {
|
||||
rotateBase(-0.02D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/Base.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
77
Roboter_Demo/roboter_demo/Floor.java
Normal file
77
Roboter_Demo/roboter_demo/Floor.java
Normal file
|
@ -0,0 +1,77 @@
|
|||
package roboter_demo;
|
||||
|
||||
import javax.media.j3d.Appearance;
|
||||
import javax.media.j3d.Geometry;
|
||||
import javax.media.j3d.Material;
|
||||
import javax.media.j3d.QuadArray;
|
||||
import javax.media.j3d.Shape3D;
|
||||
import javax.media.j3d.TransparencyAttributes;
|
||||
import javax.vecmath.Color4f;
|
||||
import javax.vecmath.Point3d;
|
||||
import javax.vecmath.TexCoord2f;
|
||||
|
||||
class Floor extends Shape3D {
|
||||
private final int mGridNum = 8;
|
||||
|
||||
private Geometry mGeom = createGeometry();
|
||||
|
||||
private Appearance mApr = createAppearance();
|
||||
|
||||
public Floor() {
|
||||
setAppearance(this.mApr);
|
||||
setGeometry(this.mGeom);
|
||||
}
|
||||
|
||||
private Geometry createGeometry() {
|
||||
QuadArray quadArray = new QuadArray(1040, 15);
|
||||
Point3d point3d = new Point3d();
|
||||
TexCoord2f texCoord2f = new TexCoord2f();
|
||||
Color4f color4f1 = new Color4f(1.0F, 0.0F, 0.0F, 1.0F);
|
||||
Color4f color4f2 = new Color4f(0.157F, 0.5F, 1.0F, 0.8F);
|
||||
Color4f color4f3 = new Color4f(1.0F, 1.0F, 1.0F, 0.8F);
|
||||
Color4f color4f4 = color4f2;
|
||||
int i = 0;
|
||||
float[] arrayOfFloat = new float[3];
|
||||
arrayOfFloat[0] = 0.0F;
|
||||
arrayOfFloat[1] = 1.0F;
|
||||
arrayOfFloat[2] = 0.0F;
|
||||
for (int j = -8; j < 8; j++) {
|
||||
for (int k = -8; k < 8; k++) {
|
||||
point3d.set(k, 0.0D, j);
|
||||
quadArray.setCoordinate(i, point3d);
|
||||
quadArray.setColor(i, color4f4);
|
||||
quadArray.setNormal(i++, arrayOfFloat);
|
||||
point3d.set(k, 0.0D, (j + 1));
|
||||
quadArray.setCoordinate(i, point3d);
|
||||
quadArray.setColor(i, color4f4);
|
||||
quadArray.setNormal(i++, arrayOfFloat);
|
||||
point3d.set((k + 1), 0.0D, (j + 1));
|
||||
quadArray.setCoordinate(i, point3d);
|
||||
quadArray.setColor(i, color4f4);
|
||||
quadArray.setNormal(i++, arrayOfFloat);
|
||||
point3d.set((k + 1), 0.0D, j);
|
||||
quadArray.setCoordinate(i, point3d);
|
||||
quadArray.setColor(i, color4f4);
|
||||
quadArray.setNormal(i++, arrayOfFloat);
|
||||
color4f4 = (color4f4 == color4f2) ? color4f3 : color4f2;
|
||||
}
|
||||
color4f4 = (color4f4 == color4f2) ? color4f3 : color4f2;
|
||||
}
|
||||
return (Geometry)quadArray;
|
||||
}
|
||||
|
||||
private Appearance createAppearance() {
|
||||
Appearance appearance = new Appearance();
|
||||
Material material = new Material();
|
||||
TransparencyAttributes transparencyAttributes = new TransparencyAttributes(1, 0.0F);
|
||||
appearance.setMaterial(material);
|
||||
appearance.setTransparencyAttributes(transparencyAttributes);
|
||||
return appearance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/Floor.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
129
Roboter_Demo/roboter_demo/ForeArm.java
Normal file
129
Roboter_Demo/roboter_demo/ForeArm.java
Normal file
|
@ -0,0 +1,129 @@
|
|||
package roboter_demo;
|
||||
|
||||
import com.sun.j3d.utils.geometry.Box;
|
||||
import javax.media.j3d.Appearance;
|
||||
import javax.media.j3d.BranchGroup;
|
||||
import javax.media.j3d.Material;
|
||||
import javax.media.j3d.Node;
|
||||
import javax.media.j3d.Transform3D;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.vecmath.Vector3d;
|
||||
|
||||
class ForeArm {
|
||||
private final float mWidth = 0.25F;
|
||||
|
||||
private final float mLength = 1.0F;
|
||||
|
||||
private final float mScale = 1.0F;
|
||||
|
||||
private final Vector3d mTransTo = new Vector3d(0.0D, 0.375D, 0.0D);
|
||||
|
||||
private final Vector3d mTransFro = new Vector3d(0.0D, -0.375D, 0.0D);
|
||||
|
||||
private BranchGroup mBrGrp = new BranchGroup();
|
||||
|
||||
private TransformGroup mTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mWristTfGrp = new TransformGroup();
|
||||
|
||||
private Wrist mWrist = new Wrist();
|
||||
|
||||
private double mAngle;
|
||||
|
||||
private Transform3D mRotTf = new Transform3D();
|
||||
|
||||
private Transform3D mTrnTf = new Transform3D();
|
||||
|
||||
private Transform3D mResTf = new Transform3D();
|
||||
|
||||
public BranchGroup getBrGrp() {
|
||||
return this.mBrGrp;
|
||||
}
|
||||
|
||||
public void incWristAngle() {
|
||||
this.mWrist.incAngle();
|
||||
}
|
||||
|
||||
public void decWristAngle() {
|
||||
this.mWrist.decAngle();
|
||||
}
|
||||
|
||||
public void incHandAngle() {
|
||||
this.mWrist.incHandAngle();
|
||||
}
|
||||
|
||||
public void decHandAngle() {
|
||||
this.mWrist.decHandAngle();
|
||||
}
|
||||
|
||||
public void incHandSpan() {
|
||||
this.mWrist.incHandSpan();
|
||||
}
|
||||
|
||||
public void decHandSpan() {
|
||||
this.mWrist.decHandSpan();
|
||||
}
|
||||
|
||||
public void incWristAngle(double paramDouble) {
|
||||
this.mWrist.incAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandAngle(double paramDouble) {
|
||||
this.mWrist.incHandAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandSpan(double paramDouble) {
|
||||
this.mWrist.incHandSpan(paramDouble);
|
||||
}
|
||||
|
||||
public ForeArm() {
|
||||
Box box = new Box(0.125F, 0.5F, 0.125F, 1, null);
|
||||
Material material = new Material();
|
||||
Appearance appearance = new Appearance();
|
||||
Transform3D transform3D = new Transform3D();
|
||||
Vector3d vector3d = new Vector3d();
|
||||
this.mTfGrp.addChild((Node)box);
|
||||
this.mWristTfGrp.addChild((Node)this.mWrist.getBrGrp());
|
||||
this.mTfGrp.addChild((Node)this.mWristTfGrp);
|
||||
this.mBrGrp.addChild((Node)this.mTfGrp);
|
||||
vector3d.set(0.0D, 0.75D, 0.0D);
|
||||
transform3D.setTranslation(vector3d);
|
||||
this.mWristTfGrp.setTransform(transform3D);
|
||||
material.setDiffuseColor(0.0F, 1.0F, 0.0F);
|
||||
material.setAmbientColor(0.0F, 0.4F, 0.0F);
|
||||
appearance.setMaterial(material);
|
||||
box.setAppearance(appearance);
|
||||
this.mTfGrp.setCapability(18);
|
||||
rotate(0.0D);
|
||||
}
|
||||
|
||||
public void incAngle() {
|
||||
rotate(0.02D);
|
||||
}
|
||||
|
||||
private void rotate(double paramDouble) {
|
||||
this.mAngle += paramDouble;
|
||||
this.mRotTf.rotZ(this.mAngle);
|
||||
this.mResTf.setIdentity();
|
||||
this.mTrnTf.setTranslation(this.mTransFro);
|
||||
this.mResTf.mul(this.mTrnTf);
|
||||
this.mResTf.mul(this.mRotTf);
|
||||
this.mTrnTf.setTranslation(this.mTransTo);
|
||||
this.mResTf.mul(this.mTrnTf);
|
||||
this.mTfGrp.setTransform(this.mResTf);
|
||||
}
|
||||
|
||||
public void incAngle(double paramDouble) {
|
||||
rotate(paramDouble);
|
||||
}
|
||||
|
||||
public void decAngle() {
|
||||
rotate(-0.02D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/ForeArm.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
133
Roboter_Demo/roboter_demo/Hand.java
Normal file
133
Roboter_Demo/roboter_demo/Hand.java
Normal file
|
@ -0,0 +1,133 @@
|
|||
package roboter_demo;
|
||||
|
||||
import com.sun.j3d.utils.geometry.Box;
|
||||
import javax.media.j3d.Appearance;
|
||||
import javax.media.j3d.BranchGroup;
|
||||
import javax.media.j3d.Material;
|
||||
import javax.media.j3d.Node;
|
||||
import javax.media.j3d.Transform3D;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.vecmath.Vector3d;
|
||||
|
||||
class Hand {
|
||||
private final float mWidth = 0.25F;
|
||||
|
||||
private final float mScale = 1.0F;
|
||||
|
||||
private final float mThumbWitdh = 0.025F;
|
||||
|
||||
private BranchGroup mBrGrp = new BranchGroup();
|
||||
|
||||
private TransformGroup mTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mThumbTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mFingersTfGrp = new TransformGroup();
|
||||
|
||||
private double mSpan;
|
||||
|
||||
private double mAngle;
|
||||
|
||||
private Vector3d mVec = new Vector3d();
|
||||
|
||||
private Transform3D mTrnTf = new Transform3D();
|
||||
|
||||
private Transform3D mRotTf = new Transform3D();
|
||||
|
||||
public BranchGroup getBrGrp() {
|
||||
return this.mBrGrp;
|
||||
}
|
||||
|
||||
public Hand() {
|
||||
Box box1 = new Box(0.125F, 0.125F, 0.125F, 1, null);
|
||||
Box box2 = new Box(0.0125F, 0.125F, 0.125F, 1, null);
|
||||
Box box3 = new Box(0.0125F, 0.125F, 0.125F, 1, null);
|
||||
TransformGroup transformGroup = new TransformGroup();
|
||||
Vector3d vector3d = new Vector3d();
|
||||
Transform3D transform3D = new Transform3D();
|
||||
Material material1 = new Material();
|
||||
Material material2 = new Material();
|
||||
Appearance appearance1 = new Appearance();
|
||||
Appearance appearance2 = new Appearance();
|
||||
this.mSpan = 0.25D;
|
||||
this.mAngle = 0.0D;
|
||||
transformGroup.addChild((Node)box1);
|
||||
this.mThumbTfGrp.addChild((Node)box2);
|
||||
this.mFingersTfGrp.addChild((Node)box3);
|
||||
this.mTfGrp.addChild((Node)transformGroup);
|
||||
this.mTfGrp.addChild((Node)this.mThumbTfGrp);
|
||||
this.mTfGrp.addChild((Node)this.mFingersTfGrp);
|
||||
this.mBrGrp.addChild((Node)this.mTfGrp);
|
||||
moveThumbAndFingers(this.mSpan);
|
||||
rotateHand(0.0D);
|
||||
material1.setDiffuseColor(0.0F, 1.0F, 1.0F);
|
||||
material1.setAmbientColor(0.0F, 0.4F, 0.4F);
|
||||
appearance1.setMaterial(material1);
|
||||
box1.setAppearance(appearance1);
|
||||
material2.setDiffuseColor(1.0F, 1.0F, 0.0F);
|
||||
material2.setAmbientColor(0.4F, 0.4F, 0.0F);
|
||||
appearance2.setMaterial(material2);
|
||||
box2.setAppearance(appearance2);
|
||||
box3.setAppearance(appearance2);
|
||||
this.mTfGrp.setCapability(18);
|
||||
this.mThumbTfGrp.setCapability(18);
|
||||
this.mFingersTfGrp.setCapability(18);
|
||||
this.mBrGrp.compile();
|
||||
}
|
||||
|
||||
public void moveThumbAndFingers(double paramDouble) {
|
||||
this.mVec.set(-paramDouble / 2.0D, 0.25D, 0.0D);
|
||||
this.mTrnTf.set(this.mVec);
|
||||
this.mThumbTfGrp.setTransform(this.mTrnTf);
|
||||
this.mVec.set(paramDouble / 2.0D, 0.25D, 0.0D);
|
||||
this.mTrnTf.set(this.mVec);
|
||||
this.mFingersTfGrp.setTransform(this.mTrnTf);
|
||||
}
|
||||
|
||||
public void incHandSpan() {
|
||||
if (this.mSpan < 0.25D)
|
||||
this.mSpan += 0.01D;
|
||||
moveThumbAndFingers(this.mSpan);
|
||||
}
|
||||
|
||||
public void incHandSpan(double paramDouble) {
|
||||
this.mSpan += paramDouble;
|
||||
if (this.mSpan <= 0.02500000037252903D)
|
||||
this.mSpan = 0.02500000037252903D;
|
||||
if (this.mSpan >= 0.25D)
|
||||
this.mSpan = 0.25D;
|
||||
moveThumbAndFingers(this.mSpan);
|
||||
}
|
||||
|
||||
public void decHandSpan() {
|
||||
if (this.mSpan > 0.02500000037252903D)
|
||||
this.mSpan -= 0.01D;
|
||||
moveThumbAndFingers(this.mSpan);
|
||||
}
|
||||
|
||||
public void rotateHand(double paramDouble) {
|
||||
this.mRotTf.rotX(paramDouble);
|
||||
this.mTfGrp.setTransform(this.mRotTf);
|
||||
}
|
||||
|
||||
public void incHandAngle() {
|
||||
this.mAngle += 0.02D;
|
||||
rotateHand(this.mAngle);
|
||||
}
|
||||
|
||||
public void incHandAngle(double paramDouble) {
|
||||
this.mAngle += paramDouble;
|
||||
rotateHand(this.mAngle);
|
||||
}
|
||||
|
||||
public void decHandAngle() {
|
||||
this.mAngle -= 0.02D;
|
||||
rotateHand(this.mAngle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/Hand.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
36
Roboter_Demo/roboter_demo/HandBehavior.java
Normal file
36
Roboter_Demo/roboter_demo/HandBehavior.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package roboter_demo;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import javax.media.j3d.Behavior;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.media.j3d.WakeupCondition;
|
||||
import javax.media.j3d.WakeupOnTransformChange;
|
||||
|
||||
class HandBehavior extends Behavior {
|
||||
private TransformGroup mTfGrp;
|
||||
|
||||
private WakeupOnTransformChange mWakeUp;
|
||||
|
||||
public void setTg(TransformGroup paramTransformGroup) {
|
||||
this.mTfGrp = paramTransformGroup;
|
||||
}
|
||||
|
||||
HandBehavior(TransformGroup paramTransformGroup) {
|
||||
this.mTfGrp = paramTransformGroup;
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
this.mWakeUp = new WakeupOnTransformChange(this.mTfGrp);
|
||||
wakeupOn((WakeupCondition)this.mWakeUp);
|
||||
}
|
||||
|
||||
public void processStimulus(Enumeration paramEnumeration) {
|
||||
wakeupOn((WakeupCondition)this.mWakeUp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/HandBehavior.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
62
Roboter_Demo/roboter_demo/ReadingThread.java
Normal file
62
Roboter_Demo/roboter_demo/ReadingThread.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
package roboter_demo;
|
||||
|
||||
import de.spacecontrol.sc.dllwrapper.ScDllWrapper;
|
||||
import de.spacecontrol.sc.dllwrapper.ScEx;
|
||||
import de.spacecontrol.sc.dllwrapper.ScStdData;
|
||||
|
||||
public class ReadingThread extends Thread {
|
||||
private RoboterApp mApp;
|
||||
|
||||
private int mDevIdx;
|
||||
|
||||
private boolean mIsReading;
|
||||
|
||||
public void setDevIdx(int paramInt) {
|
||||
this.mDevIdx = paramInt;
|
||||
}
|
||||
|
||||
public void stopReadingThread() {
|
||||
this.mIsReading = false;
|
||||
}
|
||||
|
||||
public ReadingThread(RoboterApp paramRoboterApp) {
|
||||
this.mApp = paramRoboterApp;
|
||||
this.mDevIdx = paramRoboterApp.getDevIdx();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
boolean bool = true;
|
||||
int i = 0;
|
||||
ScStdData scStdData = new ScStdData();
|
||||
this.mIsReading = true;
|
||||
while (this.mIsReading) {
|
||||
try {
|
||||
ScDllWrapper.scFetchStdData(this.mDevIdx, scStdData);
|
||||
if (scStdData.mEvent > -1) {
|
||||
this.mApp.handleEvent(this.mDevIdx, scStdData.mEvent);
|
||||
continue;
|
||||
}
|
||||
this.mApp.repaintDemo(scStdData);
|
||||
} catch (ScEx scEx) {
|
||||
if (bool) {
|
||||
this.mApp.repaintDemo(scStdData);
|
||||
if (i++ > 3) {
|
||||
i = 0;
|
||||
bool = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("*** Reading thread stopped.");
|
||||
}
|
||||
|
||||
public void stopp() {
|
||||
this.mIsReading = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/ReadingThread.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
281
Roboter_Demo/roboter_demo/RoboterApp.java
Normal file
281
Roboter_Demo/roboter_demo/RoboterApp.java
Normal file
|
@ -0,0 +1,281 @@
|
|||
package roboter_demo;
|
||||
|
||||
import com.sun.j3d.utils.behaviors.vp.OrbitBehavior;
|
||||
import com.sun.j3d.utils.behaviors.vp.ViewPlatformBehavior;
|
||||
import com.sun.j3d.utils.geometry.ColorCube;
|
||||
import com.sun.j3d.utils.universe.SimpleUniverse;
|
||||
import com.sun.j3d.utils.universe.ViewingPlatform;
|
||||
import de.spacecontrol.sc.dllwrapper.ScDllWrapper;
|
||||
import de.spacecontrol.sc.dllwrapper.ScEx;
|
||||
import de.spacecontrol.sc.dllwrapper.ScStdData;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.Image;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.ArrayList;
|
||||
import javax.media.j3d.AmbientLight;
|
||||
import javax.media.j3d.BoundingSphere;
|
||||
import javax.media.j3d.Bounds;
|
||||
import javax.media.j3d.BranchGroup;
|
||||
import javax.media.j3d.Canvas3D;
|
||||
import javax.media.j3d.DirectionalLight;
|
||||
import javax.media.j3d.Node;
|
||||
import javax.media.j3d.Transform3D;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
import javax.vecmath.Color3f;
|
||||
import javax.vecmath.Point3d;
|
||||
import javax.vecmath.Vector3d;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
public class RoboterApp extends JFrame {
|
||||
private final int mBoundsRange = 1000;
|
||||
|
||||
private int mSceneNo;
|
||||
|
||||
private double mHandSpan;
|
||||
|
||||
private double mHandAngle;
|
||||
|
||||
private ReadingThread mReadingThread = new ReadingThread(this);
|
||||
|
||||
private int mDevIdx;
|
||||
|
||||
private TransformGroup mCubeTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mThumbTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mFingersTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mHandTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mForeArmTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mBaseTfGrp = new TransformGroup();
|
||||
|
||||
private Base mBase = new Base(this.mBaseTfGrp);
|
||||
|
||||
private ViewingPlatform mVp;
|
||||
|
||||
private JPanel mGraphicPanel;
|
||||
|
||||
public int getDevIdx() {
|
||||
return this.mDevIdx;
|
||||
}
|
||||
|
||||
public RoboterApp() {
|
||||
GraphicsConfiguration graphicsConfiguration = SimpleUniverse.getPreferredConfiguration();
|
||||
Canvas3D canvas3D = new Canvas3D(graphicsConfiguration);
|
||||
SimpleUniverse simpleUniverse = new SimpleUniverse(canvas3D);
|
||||
BranchGroup branchGroup = null;
|
||||
OrbitBehavior orbitBehavior = new OrbitBehavior(canvas3D);
|
||||
ArrayList<Image> arrayList = new ArrayList();
|
||||
String str1 = System.getProperty("os.name");
|
||||
boolean bool = str1.contains("OS X");
|
||||
this.mVp = simpleUniverse.getViewingPlatform();
|
||||
Image image1 = getToolkit().getImage(getClass().getResource("/pics/roboter_16.png"));
|
||||
Image image2 = getToolkit().getImage(getClass().getResource("/pics/roboter_32.png"));
|
||||
Image image3 = getToolkit().getImage(getClass().getResource("/pics/roboter_64.png"));
|
||||
arrayList.add(image1);
|
||||
arrayList.add(image2);
|
||||
arrayList.add(image3);
|
||||
setIconImages(arrayList);
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (UnsupportedLookAndFeelException unsupportedLookAndFeelException) {
|
||||
|
||||
} catch (IllegalAccessException illegalAccessException) {
|
||||
|
||||
} catch (InstantiationException instantiationException) {
|
||||
|
||||
} catch (ClassNotFoundException classNotFoundException) {}
|
||||
initComponents();
|
||||
String str2 = bool ? getClass().getSimpleName() : getTitle();
|
||||
this.mGraphicPanel.add("Center", (Component)canvas3D);
|
||||
simpleUniverse.getViewer().getView().setBackClipDistance(1000.0D);
|
||||
this.mSceneNo = 1;
|
||||
switch (this.mSceneNo) {
|
||||
case 0:
|
||||
branchGroup = createRoboterSceneGraph();
|
||||
this.mVp.setNominalViewingTransform();
|
||||
break;
|
||||
case 1:
|
||||
branchGroup = createRoboterSceneGraph();
|
||||
setViewPos(this.mVp);
|
||||
orbitBehavior.setSchedulingBounds((Bounds)new BoundingSphere(new Point3d(), 1000.0D));
|
||||
orbitBehavior.setZoomFactor(5.0D);
|
||||
this.mVp.setViewPlatformBehavior((ViewPlatformBehavior)orbitBehavior);
|
||||
break;
|
||||
default:
|
||||
System.out.println("Unknown sceneNo: " + this.mSceneNo);
|
||||
break;
|
||||
}
|
||||
branchGroup.compile();
|
||||
simpleUniverse.addBranchGraph(branchGroup);
|
||||
this.mGraphicPanel.requestFocus();
|
||||
try {
|
||||
String str3 = ManagementFactory.getRuntimeMXBean().getName();
|
||||
int i = str3.indexOf('@');
|
||||
String str4 = str3.substring(0, i);
|
||||
ScDllWrapper.scConnect2(false, str2);
|
||||
this.mReadingThread.start();
|
||||
} catch (ScEx scEx) {
|
||||
System.out.println(scEx);
|
||||
JOptionPane.showMessageDialog(this.mGraphicPanel, "No connection to SpaceControl driver!\nMove the roboter with keys 1-6 and shift.", "Connection Error", 0);
|
||||
}
|
||||
this.mBase.incUpperArmAngle(1.5707963267948966D);
|
||||
this.mBase.incForeArmAngle(Math.PI);
|
||||
this.mBase.incWristAngle(1.5707963267948966D);
|
||||
this.mBase.incHandSpan(-1.0D);
|
||||
}
|
||||
|
||||
public BranchGroup createSimpleCubeSceneGraph() {
|
||||
BranchGroup branchGroup = new BranchGroup();
|
||||
branchGroup.addChild((Node)this.mCubeTfGrp);
|
||||
this.mCubeTfGrp.addChild((Node)new ColorCube(0.4D));
|
||||
this.mCubeTfGrp.setCapability(18);
|
||||
return branchGroup;
|
||||
}
|
||||
|
||||
private void setViewPos(ViewingPlatform paramViewingPlatform) {
|
||||
TransformGroup transformGroup = paramViewingPlatform.getViewPlatformTransform();
|
||||
Transform3D transform3D1 = new Transform3D();
|
||||
Transform3D transform3D2 = new Transform3D();
|
||||
transformGroup.getTransform(transform3D2);
|
||||
transform3D2.rotY(Math.toRadians(0.0D));
|
||||
transform3D2.rotX(Math.toRadians(-10.0D));
|
||||
transform3D1.mul(transform3D2);
|
||||
transform3D2.setTranslation(new Vector3d(0.0D, 4.0D, 10.0D));
|
||||
transform3D1.mul(transform3D2);
|
||||
transformGroup.setTransform(transform3D1);
|
||||
}
|
||||
|
||||
private BranchGroup createRoboterSceneGraph() {
|
||||
BranchGroup branchGroup = new BranchGroup();
|
||||
AmbientLight ambientLight = new AmbientLight(new Color3f(1.0F, 1.0F, 1.0F));
|
||||
DirectionalLight directionalLight = new DirectionalLight(new Color3f(1.0F, 1.0F, 1.0F), new Vector3f(-1.0F, -0.7F, -0.5F));
|
||||
BoundingSphere boundingSphere = new BoundingSphere(new Point3d(), 20.0D);
|
||||
Floor floor = new Floor();
|
||||
branchGroup.addChild((Node)directionalLight);
|
||||
branchGroup.addChild((Node)ambientLight);
|
||||
branchGroup.addChild((Node)floor);
|
||||
branchGroup.addChild((Node)this.mBase.getBrGrp());
|
||||
directionalLight.setInfluencingBounds((Bounds)boundingSphere);
|
||||
ambientLight.setInfluencingBounds((Bounds)boundingSphere);
|
||||
return branchGroup;
|
||||
}
|
||||
|
||||
public void repaintDemo(ScStdData paramScStdData) {
|
||||
int i = 2000;
|
||||
if (paramScStdData.mB != 0)
|
||||
this.mBase.incBaseAngle(paramScStdData.mB / i);
|
||||
if (paramScStdData.mA != 0)
|
||||
this.mBase.incUpperArmAngle(paramScStdData.mA / i);
|
||||
if (paramScStdData.mC != 0)
|
||||
this.mBase.incWristAngle(-(paramScStdData.mC) / i);
|
||||
if (paramScStdData.mX != 0)
|
||||
this.mBase.incHandAngle(-(paramScStdData.mX) / i);
|
||||
if (paramScStdData.mY != 0)
|
||||
this.mBase.incHandSpan(paramScStdData.mY / i);
|
||||
if (paramScStdData.mZ != 0)
|
||||
this.mBase.incForeArmAngle(paramScStdData.mZ / i);
|
||||
}
|
||||
|
||||
public void handleEvent(int paramInt1, int paramInt2) {
|
||||
switch (paramInt2) {
|
||||
case 131084:
|
||||
handleFitEvent();
|
||||
break;
|
||||
default:
|
||||
System.out.println("*** Event '" + paramInt2 + "' not supported.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleFitEvent() {
|
||||
setViewPos(this.mVp);
|
||||
}
|
||||
|
||||
private void initComponents() {
|
||||
this.mGraphicPanel = new JPanel();
|
||||
setDefaultCloseOperation(3);
|
||||
setTitle("SC Roboter Demo");
|
||||
this.mGraphicPanel.setMinimumSize(new Dimension(640, 480));
|
||||
this.mGraphicPanel.setPreferredSize(new Dimension(640, 480));
|
||||
this.mGraphicPanel.addFocusListener(new FocusAdapter() {
|
||||
public void focusLost(FocusEvent param1FocusEvent) {
|
||||
RoboterApp.this.mGraphicPanelFocusLost(param1FocusEvent);
|
||||
}
|
||||
});
|
||||
this.mGraphicPanel.addKeyListener(new KeyAdapter() {
|
||||
public void keyPressed(KeyEvent param1KeyEvent) {
|
||||
RoboterApp.this.mGraphicPanelKeyPressed(param1KeyEvent);
|
||||
}
|
||||
});
|
||||
this.mGraphicPanel.setLayout(new BorderLayout());
|
||||
getContentPane().add(this.mGraphicPanel, "Center");
|
||||
pack();
|
||||
}
|
||||
|
||||
private void mGraphicPanelFocusLost(FocusEvent paramFocusEvent) {
|
||||
String str = System.getProperty("os.name");
|
||||
if (str.equals("Linux"))
|
||||
return;
|
||||
this.mGraphicPanel.requestFocus();
|
||||
}
|
||||
|
||||
private void mGraphicPanelKeyPressed(KeyEvent paramKeyEvent) {
|
||||
int i = paramKeyEvent.getKeyCode();
|
||||
char c = paramKeyEvent.getKeyChar();
|
||||
if (c == '1') {
|
||||
this.mBase.incBaseAngle();
|
||||
} else if (c == '!') {
|
||||
this.mBase.decBaseAngle();
|
||||
} else if (c == '2') {
|
||||
this.mBase.incUpperArmAngle();
|
||||
} else if (c == '"') {
|
||||
this.mBase.decUpperArmAngle();
|
||||
} else if (c == '3') {
|
||||
this.mBase.incForeArmAngle();
|
||||
} else if (c == '<27>') {
|
||||
this.mBase.decForeArmAngle();
|
||||
} else if (c == '4') {
|
||||
this.mBase.incWristAngle();
|
||||
} else if (c == '$') {
|
||||
this.mBase.decWristAngle();
|
||||
} else if (c == '5') {
|
||||
this.mBase.incHandAngle();
|
||||
} else if (c == '%') {
|
||||
this.mBase.decHandAngle();
|
||||
} else if (c == '6') {
|
||||
this.mBase.incHandSpan();
|
||||
} else if (c == '&') {
|
||||
this.mBase.decHandSpan();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] paramArrayOfString) {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
new RoboterApp().setVisible(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/RoboterApp.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
141
Roboter_Demo/roboter_demo/UpperArm.java
Normal file
141
Roboter_Demo/roboter_demo/UpperArm.java
Normal file
|
@ -0,0 +1,141 @@
|
|||
package roboter_demo;
|
||||
|
||||
import com.sun.j3d.utils.geometry.Box;
|
||||
import javax.media.j3d.Appearance;
|
||||
import javax.media.j3d.BranchGroup;
|
||||
import javax.media.j3d.Material;
|
||||
import javax.media.j3d.Node;
|
||||
import javax.media.j3d.Transform3D;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.vecmath.Vector3d;
|
||||
|
||||
class UpperArm {
|
||||
private final float mWidth = 0.25F;
|
||||
|
||||
private final float mLength = 1.0F;
|
||||
|
||||
private final float mScale = 1.0F;
|
||||
|
||||
private final Vector3d mTransTo = new Vector3d(0.0D, 0.375D, 0.0D);
|
||||
|
||||
private final Vector3d mTransFro = new Vector3d(0.0D, -0.375D, 0.0D);
|
||||
|
||||
private BranchGroup mBrGrp = new BranchGroup();
|
||||
|
||||
private TransformGroup mTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mForeArmTfGrp = new TransformGroup();
|
||||
|
||||
private ForeArm mForeArm = new ForeArm();
|
||||
|
||||
private double mAngle;
|
||||
|
||||
private Transform3D mRotTf = new Transform3D();
|
||||
|
||||
private Transform3D mTrnTf = new Transform3D();
|
||||
|
||||
private Transform3D mResTf = new Transform3D();
|
||||
|
||||
public BranchGroup getBrGrp() {
|
||||
return this.mBrGrp;
|
||||
}
|
||||
|
||||
public void incForeArmAngle() {
|
||||
this.mForeArm.incAngle();
|
||||
}
|
||||
|
||||
public void decForeArmAngle() {
|
||||
this.mForeArm.decAngle();
|
||||
}
|
||||
|
||||
public void incWristAngle() {
|
||||
this.mForeArm.incWristAngle();
|
||||
}
|
||||
|
||||
public void decWristAngle() {
|
||||
this.mForeArm.decWristAngle();
|
||||
}
|
||||
|
||||
public void incHandAngle() {
|
||||
this.mForeArm.incHandAngle();
|
||||
}
|
||||
|
||||
public void decHandAngle() {
|
||||
this.mForeArm.decHandAngle();
|
||||
}
|
||||
|
||||
public void incHandSpan() {
|
||||
this.mForeArm.incHandSpan();
|
||||
}
|
||||
|
||||
public void decHandSpan() {
|
||||
this.mForeArm.decHandSpan();
|
||||
}
|
||||
|
||||
public void incForeArmAngle(double paramDouble) {
|
||||
this.mForeArm.incAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incWristAngle(double paramDouble) {
|
||||
this.mForeArm.incWristAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandAngle(double paramDouble) {
|
||||
this.mForeArm.incHandAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandSpan(double paramDouble) {
|
||||
this.mForeArm.incHandSpan(paramDouble);
|
||||
}
|
||||
|
||||
public UpperArm() {
|
||||
Box box = new Box(0.125F, 0.5F, 0.125F, 1, null);
|
||||
Material material = new Material();
|
||||
Appearance appearance = new Appearance();
|
||||
Transform3D transform3D = new Transform3D();
|
||||
Vector3d vector3d = new Vector3d();
|
||||
this.mTfGrp.addChild((Node)box);
|
||||
this.mForeArmTfGrp.addChild((Node)this.mForeArm.getBrGrp());
|
||||
this.mTfGrp.addChild((Node)this.mForeArmTfGrp);
|
||||
this.mBrGrp.addChild((Node)this.mTfGrp);
|
||||
vector3d.set(0.0D, 0.75D, -0.25D);
|
||||
transform3D.setTranslation(vector3d);
|
||||
this.mForeArmTfGrp.setTransform(transform3D);
|
||||
material.setDiffuseColor(1.0F, 0.0F, 1.0F);
|
||||
material.setAmbientColor(0.4F, 0.0F, 0.4F);
|
||||
appearance.setMaterial(material);
|
||||
box.setAppearance(appearance);
|
||||
this.mTfGrp.setCapability(18);
|
||||
rotate(0.0D);
|
||||
}
|
||||
|
||||
public void incAngle() {
|
||||
rotate(0.02D);
|
||||
}
|
||||
|
||||
private void rotate(double paramDouble) {
|
||||
this.mAngle += paramDouble;
|
||||
this.mRotTf.rotZ(this.mAngle);
|
||||
this.mResTf.setIdentity();
|
||||
this.mTrnTf.setTranslation(this.mTransFro);
|
||||
this.mResTf.mul(this.mTrnTf);
|
||||
this.mResTf.mul(this.mRotTf);
|
||||
this.mTrnTf.setTranslation(this.mTransTo);
|
||||
this.mResTf.mul(this.mTrnTf);
|
||||
this.mTfGrp.setTransform(this.mResTf);
|
||||
}
|
||||
|
||||
public void incAngle(double paramDouble) {
|
||||
rotate(paramDouble);
|
||||
}
|
||||
|
||||
public void decAngle() {
|
||||
rotate(-0.02D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/UpperArm.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
110
Roboter_Demo/roboter_demo/Wrist.java
Normal file
110
Roboter_Demo/roboter_demo/Wrist.java
Normal file
|
@ -0,0 +1,110 @@
|
|||
package roboter_demo;
|
||||
|
||||
import com.sun.j3d.utils.geometry.Box;
|
||||
import javax.media.j3d.Appearance;
|
||||
import javax.media.j3d.BranchGroup;
|
||||
import javax.media.j3d.Material;
|
||||
import javax.media.j3d.Node;
|
||||
import javax.media.j3d.Transform3D;
|
||||
import javax.media.j3d.TransformGroup;
|
||||
import javax.vecmath.Vector3d;
|
||||
|
||||
class Wrist {
|
||||
private final float mWidth = 0.25F;
|
||||
|
||||
private final float mLength = 0.5F;
|
||||
|
||||
private final float mScale = 1.0F;
|
||||
|
||||
private BranchGroup mBrGrp = new BranchGroup();
|
||||
|
||||
private TransformGroup mTfGrp = new TransformGroup();
|
||||
|
||||
private TransformGroup mHandTfGrp = new TransformGroup();
|
||||
|
||||
private Hand mHand = new Hand();
|
||||
|
||||
private double mAngle;
|
||||
|
||||
private Transform3D mRotTf = new Transform3D();
|
||||
|
||||
private Transform3D mTrnTf = new Transform3D();
|
||||
|
||||
private Transform3D mResTf = new Transform3D();
|
||||
|
||||
public BranchGroup getBrGrp() {
|
||||
return this.mBrGrp;
|
||||
}
|
||||
|
||||
public void incHandAngle() {
|
||||
this.mHand.incHandAngle();
|
||||
}
|
||||
|
||||
public void decHandAngle() {
|
||||
this.mHand.decHandAngle();
|
||||
}
|
||||
|
||||
public void incHandSpan() {
|
||||
this.mHand.incHandSpan();
|
||||
}
|
||||
|
||||
public void decHandSpan() {
|
||||
this.mHand.decHandSpan();
|
||||
}
|
||||
|
||||
public void incHandAngle(double paramDouble) {
|
||||
this.mHand.incHandAngle(paramDouble);
|
||||
}
|
||||
|
||||
public void incHandSpan(double paramDouble) {
|
||||
this.mHand.incHandSpan(paramDouble);
|
||||
}
|
||||
|
||||
public Wrist() {
|
||||
Box box = new Box(0.125F, 0.25F, 0.125F, 1, null);
|
||||
Material material = new Material();
|
||||
Appearance appearance = new Appearance();
|
||||
Transform3D transform3D = new Transform3D();
|
||||
Vector3d vector3d = new Vector3d();
|
||||
this.mTfGrp.addChild((Node)box);
|
||||
this.mHandTfGrp.addChild((Node)this.mHand.getBrGrp());
|
||||
this.mTfGrp.addChild((Node)this.mHandTfGrp);
|
||||
this.mBrGrp.addChild((Node)this.mTfGrp);
|
||||
vector3d.set(0.0D, 0.125D, -0.25D);
|
||||
transform3D.rotY(1.5707963267948966D);
|
||||
transform3D.setTranslation(vector3d);
|
||||
this.mHandTfGrp.setTransform(transform3D);
|
||||
material.setDiffuseColor(0.0F, 0.0F, 1.0F);
|
||||
material.setAmbientColor(0.0F, 0.0F, 0.4F);
|
||||
appearance.setMaterial(material);
|
||||
box.setAppearance(appearance);
|
||||
this.mTfGrp.setCapability(18);
|
||||
rotate(0.0D);
|
||||
}
|
||||
|
||||
public void incAngle() {
|
||||
rotate(0.02D);
|
||||
}
|
||||
|
||||
private void rotate(double paramDouble) {
|
||||
this.mAngle += paramDouble;
|
||||
this.mRotTf.rotY(this.mAngle);
|
||||
this.mResTf.setIdentity();
|
||||
this.mResTf.mul(this.mRotTf);
|
||||
this.mTfGrp.setTransform(this.mResTf);
|
||||
}
|
||||
|
||||
public void incAngle(double paramDouble) {
|
||||
rotate(paramDouble);
|
||||
}
|
||||
|
||||
public void decAngle() {
|
||||
rotate(-0.02D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Location: /opt/SpaceControl/Roboter_Demo.jar!/roboter_demo/Wrist.class
|
||||
* Java compiler version: 8 (52.0)
|
||||
* JD-Core Version: 1.2.1
|
||||
*/
|
Loading…
Add table
Add a link
Reference in a new issue