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 */