public void setHingeJoint(HingeJoint hingeJoint, int index) { this.hingeJointArray[index] = hingeJoint; }
private void parseHingeJoint(SexpT sExpression) { SexpT pointer = sExpression.list.next; string name = ""; float angle = 0; while (pointer != null) { if (pointer.ty == EltT.SEXP_LIST) { if (pointer.list.val == "n") { name = pointer.list.next.val; } if (pointer.list.val == "ax") { angle = (float)Convert.ToInt32(pointer.list.next.val); } } pointer = pointer.next; } HingeJoint hJoint = new HingeJoint(); hJoint.setAxis(angle); if (name == "hj1") { this.worldModel.setHingeJoint(hJoint, 0); } else if (name == "hj2") { this.worldModel.setHingeJoint(hJoint, 1); } else if (name == "raj1") { this.worldModel.setHingeJoint(hJoint, 2); } else if (name == "raj2") { this.worldModel.setHingeJoint(hJoint, 3); } else if (name == "raj3") { this.worldModel.setHingeJoint(hJoint, 4); } else if (name == "raj4") { this.worldModel.setHingeJoint(hJoint, 5); } else if (name == "laj1") { this.worldModel.setHingeJoint(hJoint, 6); } else if (name == "laj2") { this.worldModel.setHingeJoint(hJoint, 7); } else if (name == "laj3") { this.worldModel.setHingeJoint(hJoint, 8); } else if (name == "laj4") { this.worldModel.setHingeJoint(hJoint, 9); } else if (name == "rlj1") { this.worldModel.setHingeJoint(hJoint, 10); } else if (name == "rlj2") { this.worldModel.setHingeJoint(hJoint, 11); } else if (name == "rlj3") { this.worldModel.setHingeJoint(hJoint, 12); } else if (name == "rlj4") { this.worldModel.setHingeJoint(hJoint, 13); } else if (name == "rlj5") { this.worldModel.setHingeJoint(hJoint, 14); } else if (name == "rlj6") { this.worldModel.setHingeJoint(hJoint, 15); } else if (name == "llj1") { this.worldModel.setHingeJoint(hJoint, 16); } else if (name == "llj2") { this.worldModel.setHingeJoint(hJoint, 17); } else if (name == "llj3") { this.worldModel.setHingeJoint(hJoint, 18); } else if (name == "llj4") { this.worldModel.setHingeJoint(hJoint, 19); } else if (name == "llj5") { this.worldModel.setHingeJoint(hJoint, 20); } else if (name == "llj6") { this.worldModel.setHingeJoint(hJoint, 21); } }