+import "JavaBuiltin" as Java
+
import "G3D/Math/Vector3d"
import "G3D/Math/Quat4d"
-importJava "org.simantics.g3d.scenegraph.G3DNode" where
+include "./Node"
+
+importJava "org.simantics.g3d.scenegraph.IG3DNode" where
data G3DNode
- getOrientation :: G3DNode -> Quat4d
- getPosition :: G3DNode -> Vector3d
+ @JavaName getOrientation
+ getOrientation' :: G3DNode -> <Proc> Quat4d
+ @JavaName getPosition
+ getPosition' :: G3DNode -> <Proc> Vector3d
+
+ @JavaName setOrientation
+ setOrientation' :: G3DNode -> Quat4d -> <Proc> ()
+ @JavaName setPosition
+ setPosition' :: G3DNode -> Vector3d -> <Proc> ()
+
+ @JavaName getWorldOrientation
+ getWorldOrientation' :: G3DNode -> <Proc> Quat4d
+ @JavaName getWorldPosition
+ getWorldPosition' :: G3DNode -> <Proc> Vector3d
- setOrientation :: G3DNode -> Quat4d -> ()
- setPosition :: G3DNode -> Vector3d -> ()
+ @JavaName setWorldOrientation
+ setWorldOrientation' :: G3DNode -> Quat4d -> <Proc> ()
+ @JavaName setWorldPosition
+ setWorldPosition' :: G3DNode -> Vector3d -> <Proc> ()
+
+class G3DNodeClass a where
+ asG3DNode :: a -> G3DNode
+ asG3DNode = Java.unsafeCoerce
+
+ getOrientation :: a -> <Proc> Quat4d
+ getOrientation c = getOrientation' (asG3DNode c)
+ getPosition :: a -> <Proc> Vector3d
+ getPosition c = getPosition' (asG3DNode c)
- getWorldOrientation :: G3DNode -> Quat4d
- getWorldPosition :: G3DNode -> Vector3d
+ setOrientation :: a -> Quat4d -> <Proc> ()
+ setOrientation c = setOrientation' (asG3DNode c)
+ setPosition :: a -> Vector3d -> <Proc> ()
+ setPosition c = setPosition' (asG3DNode c)
- setWorldOrientation :: G3DNode -> Quat4d -> ()
- setWorldPosition :: G3DNode -> Vector3d -> ()
\ No newline at end of file
+ getWorldOrientation :: a -> <Proc> Quat4d
+ getWorldOrientation c = getWorldOrientation' (asG3DNode c)
+ getWorldPosition :: a -> <Proc> Vector3d
+ getWorldPosition c = getWorldPosition' (asG3DNode c)
+
+ setWorldOrientation :: a -> Quat4d -> <Proc> ()
+ setWorldOrientation c = setWorldOrientation' (asG3DNode c)
+ setWorldPosition :: a -> Vector3d -> <Proc> ()
+ setWorldPosition c = setWorldPosition' (asG3DNode c)
+
+instance NodeClass G3DNode
+instance G3DNodeClass G3DNode where
+ asG3DNode = id