\r
\r
public static Vector3d getLocalPosition(IG3DNode node, Vector3d worldCoord) {\r
- \r
+ \r
IG3DNode parent = (IG3DNode)node.getParent();\r
- if (parent == null) {// this is a root node ( has no transformation) \r
- return worldCoord;\r
- }\r
+ if (parent == null) {// this is a root node ( has no transformation) \r
+ return worldCoord;\r
+ }\r
\r
- Vector3d local = getLocalPosition(parent,worldCoord);\r
- local.sub(node.getPosition());\r
- \r
- Quat4d q = new Quat4d();\r
- q.set(node.getOrientation());\r
- q.inverse();\r
- MathTools.rotate(q, local, local);\r
- \r
- return local;\r
- }\r
+ Vector3d local = getLocalPosition(parent,worldCoord);\r
+ local.sub(node.getPosition());\r
+ \r
+ Quat4d q = new Quat4d();\r
+ q.set(node.getOrientation());\r
+ q.inverse();\r
+ MathTools.rotate(q, local, local);\r
+ \r
+ return local;\r
+ }\r
\r
public static Quat4d getLocalOrientation(IG3DNode node, Quat4d worldRot) {\r
\r