/******************************************************************************* * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. * 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); } }