X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FVecmathJmeTools.java;fp=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fbase%2FVecmathJmeTools.java;h=315660e22608e7ed80ba779410302b849bd9e04d;hb=10f144a2bb2d7bec98b812b83acecb333fd098ea;hp=0000000000000000000000000000000000000000;hpb=3055b543aa5afc0cca4bb3b341704e7c5103fa6a;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/proconf/g3d/base/VecmathJmeTools.java b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/VecmathJmeTools.java new file mode 100644 index 00000000..315660e2 --- /dev/null +++ b/org.simantics.g3d/src/org/simantics/proconf/g3d/base/VecmathJmeTools.java @@ -0,0 +1,78 @@ +/******************************************************************************* + * Copyright (c) 2007- VTT Technical Research Centre of Finland. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.proconf.g3d.base; + +import javax.vecmath.Color4f; + +import com.jme.renderer.ColorRGBA; + +public class VecmathJmeTools { + + public static javax.vecmath.Vector3f get(com.jme.math.Vector3f v) { + return new javax.vecmath.Vector3f(v.x,v.y,v.z); + } + + public static javax.vecmath.Vector3d getD(com.jme.math.Vector3f v) { + return new javax.vecmath.Vector3d(v.x,v.y,v.z); + } + + public static com.jme.math.Vector3f get(javax.vecmath.Tuple3f v) { + return new com.jme.math.Vector3f(v.x,v.y,v.z); + } + + public static com.jme.math.Vector3f get(javax.vecmath.Tuple3d v) { + return new com.jme.math.Vector3f((float)v.x,(float)v.y,(float)v.z); + } + + public static com.jme.math.Matrix3f get(javax.vecmath.Matrix3d m) { + return new com.jme.math.Matrix3f((float)m.m00,(float)m.m01,(float)m.m02,(float)m.m10,(float)m.m11,(float)m.m12,(float)m.m20,(float)m.m21,(float)m.m22); + } + + public static javax.vecmath.Quat4f get(com.jme.math.Quaternion v) { + return new javax.vecmath.Quat4f(v.x,v.y,v.z,v.w); + } + + public static javax.vecmath.Quat4d getD(com.jme.math.Quaternion v) { + return new javax.vecmath.Quat4d(v.x,v.y,v.z,v.w); + } + + + public static com.jme.math.Quaternion get(javax.vecmath.Quat4f v) { + return new com.jme.math.Quaternion(v.x,v.y,v.z,v.w); + } + + public static com.jme.math.Quaternion get(javax.vecmath.Quat4d v) { + return new com.jme.math.Quaternion((float)v.x,(float)v.y,(float)v.z,(float)v.w); + } + + public static com.jme.math.Quaternion get(javax.vecmath.AxisAngle4f aa) { + javax.vecmath.Quat4f v = new javax.vecmath.Quat4f(); + v.set(aa); + return new com.jme.math.Quaternion(v.x,v.y,v.z,v.w); + + } + + public static com.jme.math.Quaternion get(javax.vecmath.AxisAngle4d aa) { + javax.vecmath.Quat4f v = new javax.vecmath.Quat4f(); + v.set(aa); + return new com.jme.math.Quaternion(v.x,v.y,v.z,v.w); + + } + + public static ColorRGBA get(Color4f c) { + return new ColorRGBA(c.x,c.y,c.z,c.w); + } + + public static Color4f get(ColorRGBA c) { + return new Color4f(c.r,c.g,c.b,c.a); + } + +}