Package javax.vecmath

Examples of javax.vecmath.Vector3f


  }

  public Object clone() throws CloneNotSupportedException{
    TransformDataXith3d res=(TransformDataXith3d)super.clone();
    res.trans=new Transform3D();
    res.v3=new Vector3f();
    res.m3=new Matrix3f();
    res.m4=new Matrix4f();
    res.q=new Quat4f();   
    return res;
  }
View Full Code Here


    }
    if(isIdentity(m)){
      return IDENTITY;
    }
    Matrix3f m3=new Matrix3f();
    Vector3f v=new Vector3f();
    float s=m.get(m3, v);
    if(s==1.0f){
      if(isIdentity(m3)){
        if(v.x==0.f){
          if(v.y==0.f){
            return TRANSZ;
          }
          else{
            if(v.z==0.f){
              return TRANSY;
            }
          }
        }
        else if(v.y==0.f && v.z==0.f){
          return TRANSX;
        }
        return TRANSXYZ;
      }
      else if(v.lengthSquared()==0.f){
        Quat4f q=new Quat4f();
        m.get(q);
        if(q.x==0.f){
          if(q.y==0.f){
            return ROTZ;
          }
          else if(q.z==0.f){
            return ROTY;
          }
        }
        else if(q.y==0.f && q.z==0.f){
          return ROTX;
        }
        return ROTXYZ;
      }
    }
    else if(v.lengthSquared()==0.f){
      if(isIdentity(m3)){
        if(m.m00==m.m11 && m.m11==m.m22){
          return SCALE;
        }
        if(m.m00==1.f){
View Full Code Here

        AmbientLight ambientLightNode = new AmbientLight(ambientColor);
        ambientLightNode.setInfluencingBounds(bounds);
        objRoot.addChild(ambientLightNode);
        // Set up one directional lights
        Color3f light1Color = new Color3f(1.0f, 1.0f, 0.9f);
        Vector3f light1Direction = new Vector3f(1.0f, 1.0f, 1.0f);
        DirectionalLight light1 = new DirectionalLight(light1Color,
                light1Direction);
        light1.setInfluencingBounds(bounds);
        objRoot.addChild(light1);
        return objRoot;
View Full Code Here

            super(object);
        }

        @Override
        public Vector3f getPropertyValue() {
            Vector3f res=new Vector3f();
            ((SpotLight)_object).getDirection(res);
            return res;
        }
View Full Code Here

        _rot.setIdentity();
        _trans = new Matrix4f();
        _trans.setIdentity();
        _drotX = new Matrix4f();
        _drotY = new Matrix4f();
        _vtrans = new Vector3f();
        _zoomFactor = 0.f;
        _scaleFactor = 1.f;
        _eyeDistance = 2.f;
        _transFactorX = 0.f;
        _transFactorY = 0.f;
View Full Code Here

                    synchronized (ViewTransform.this) {
                        accuCopy = _accumulator;
                        _accumulator = 0;
                        _zoomAccumulator = null;
                    }
                    Vector3f view = new Vector3f(0, 0, -1);
                    _rot.transform(view);
                    float scale = (float) Math.pow(2.0, Math.abs(accuCopy))
                            * getSceneSize() / 200.0f;
                    if (accuCopy < 0)
                        scale = -scale;
                    view.scale(scale);
                    _trans.m03 += view.x;
                    _trans.m13 += view.y;
                    _trans.m23 += view.z;
                    applyTransform();
                }
View Full Code Here

        }
        float dx = (float) (newX - _pos2DX) / _wsize;
        float dy = -(float) (newY - _pos2DY) / _wsize;
        _pos2DX = newX;
        _pos2DY = newY;
        Vector3f viewX = new Vector3f(1, 0, 0);
        _rot.transform(viewX);
        viewX.scale(dx / 5.0f);
        Vector3f viewY = new Vector3f(0, 1, 0);
        _rot.transform(viewY);
        viewY.scale(dy / 5.0f);
        _trans.m03 += viewX.x + viewY.x;
        _trans.m13 += viewX.y + viewY.y;
        _trans.m23 += viewX.z + viewY.z;
        applyTransform();
    }
View Full Code Here

            updateTranslateMatrix();
            applyTransform();
            return;
        }
        // rotation around view vector
        Vector3f view = new Vector3f(0, 0, -1);
        _rot.transform(view);
        float dx = (float) (newX - _pos2DX) / _wsize;
        float dy = (float) (newY - _pos2DY) / _wsize;
        _pos2DX = newX;
        _pos2DY = newY;
View Full Code Here

        res._zoom=new Matrix4f(_zoom);
        res._rot=new Matrix4f(_rot);
        res._drotX=new Matrix4f(_drotX);
        res._drotY=new Matrix4f(_drotY);
        res._trans=new Matrix4f(_trans);
        res._vtrans=new Vector3f(_vtrans);

        res._transform = new Transform3D();
        res._transform.setAutoNormalize(true);
        res._tempTransform = new Transform3D();
       
View Full Code Here

            super(object, LightDirection);
        }

        @Override
        public Vector3f getPropertyValue() {
            Vector3f res=new Vector3f();
            ((DirectionalLight)_object).getDirection(res);
            return res;
        }
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector3f

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.