X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fscl%2FG3D%2FScenegraph%2FG3DNode.scl;fp=org.simantics.g3d%2Fscl%2FG3D%2FScenegraph%2FG3DNode.scl;h=658eb9c5f4e7e7d60a3ef91ebbb2cc5ff3f1271b;hb=d3f535e82944e98845638c0e56b23077c1e7c104;hp=14b362f826adc88bc325c588b8d2e26f25dbcc26;hpb=8c8a6f597d1c56ebe788a028d70c7851f58dae9f;p=simantics%2F3d.git diff --git a/org.simantics.g3d/scl/G3D/Scenegraph/G3DNode.scl b/org.simantics.g3d/scl/G3D/Scenegraph/G3DNode.scl index 14b362f8..658eb9c5 100644 --- a/org.simantics.g3d/scl/G3D/Scenegraph/G3DNode.scl +++ b/org.simantics.g3d/scl/G3D/Scenegraph/G3DNode.scl @@ -1,17 +1,57 @@ +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 -> Quat4d + @JavaName getPosition + getPosition' :: G3DNode -> Vector3d + + @JavaName setOrientation + setOrientation' :: G3DNode -> Quat4d -> () + @JavaName setPosition + setPosition' :: G3DNode -> Vector3d -> () + + @JavaName getWorldOrientation + getWorldOrientation' :: G3DNode -> Quat4d + @JavaName getWorldPosition + getWorldPosition' :: G3DNode -> Vector3d - setOrientation :: G3DNode -> Quat4d -> () - setPosition :: G3DNode -> Vector3d -> () + @JavaName setWorldOrientation + setWorldOrientation' :: G3DNode -> Quat4d -> () + @JavaName setWorldPosition + setWorldPosition' :: G3DNode -> Vector3d -> () + +class G3DNodeClass a where + asG3DNode :: a -> G3DNode + asG3DNode = Java.unsafeCoerce + + getOrientation :: a -> Quat4d + getOrientation c = getOrientation' (asG3DNode c) + getPosition :: a -> Vector3d + getPosition c = getPosition' (asG3DNode c) - getWorldOrientation :: G3DNode -> Quat4d - getWorldPosition :: G3DNode -> Vector3d + setOrientation :: a -> Quat4d -> () + setOrientation c = setOrientation' (asG3DNode c) + setPosition :: a -> Vector3d -> () + setPosition c = setPosition' (asG3DNode c) - setWorldOrientation :: G3DNode -> Quat4d -> () - setWorldPosition :: G3DNode -> Vector3d -> () \ No newline at end of file + getWorldOrientation :: a -> Quat4d + getWorldOrientation c = getWorldOrientation' (asG3DNode c) + getWorldPosition :: a -> Vector3d + getWorldPosition c = getWorldPosition' (asG3DNode c) + + setWorldOrientation :: a -> Quat4d -> () + setWorldOrientation c = setWorldOrientation' (asG3DNode c) + setWorldPosition :: a -> Vector3d -> () + setWorldPosition c = setWorldPosition' (asG3DNode c) + +instance NodeClass G3DNode +instance G3DNodeClass G3DNode where + asG3DNode = id