congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Vector2Double.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
jadex.extension.envsupport.math.Vector2Double
constructor

Best Java code snippets using jadex.extension.envsupport.math.Vector2Double.<init> (Showing top 20 results out of 315)

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Gets the shift of all objects.
 */
public IVector2 getObjectShift()
{
  return new Vector2Double(objShiftX_, objShiftY_);
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

public IVector2 copy()
{
  return new Vector2Double(x_, y_);
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Creates a new TiledLayer.
 */
public TiledLayer()
{
  this(new Vector2Double(1.0), Color.WHITE, "");
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 *  Get a vector for two doubles.
 *  @param a The first value.
 *  @param b The second value.
 *  @return The vector (null if at least one of args is null).
 */
public static IVector2 getVector2(Double a, Double b)
{
  IVector2 ret = null;
  if(a!=null && b!=null)
    ret = a.doubleValue()==0 && b.doubleValue()==0? ZERO: new Vector2Double(a.doubleValue(), b.doubleValue());
  else if (a!=null || b !=null)
    ret = new Vector2Double(a == null? 0.0:a.doubleValue(), b == null? 0.0:b.doubleValue());
  return ret;
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Returns the size of the canvas as a vector.
 * @return size of the canvas in pixel
 */
public IVector2 getCanvasSize()
{
  return new Vector2Double(canvas_.getWidth(), canvas_.getHeight());
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 *  Create a vector2 from this and another vector.
 *  @param sec The second vector.
 */
public IVector2 createVector2(IVector1 sec)
{
  return new Vector2Double(this.getAsDouble(), sec.getAsDouble());
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 *  Create a vector2 from this and another vector.
 *  @param sec The second vector.
 */
public IVector2 createVector2(IVector1 sec)
{
  return new Vector2Double(this.getAsLong(), sec.getAsLong());
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 *  Create a vector2 from this and another vector.
 *  @param sec The second vector.
 */
public IVector2 createVector2(IVector1 sec)
{
  return new Vector2Double(this.getAsInteger(), sec.getAsInteger());
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Returns the size of the canvas as a vector.
 * @return size of the canvas in pixel
 */
public IVector2 getCanvasSize()
{
  return new Vector2Double(canvas_.getWidth(), canvas_.getHeight());
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Initializes the members with default values.
 */
public AbstractVisual2D(Object position, Object rotation, Object size)
{
  this.size = size!=null? size: new Vector2Double(1.0);
  this.rotation = rotation!=null? rotation: Vector3Double.ZERO.copy();
  this.position = position!=null? position: Vector2Double.ZERO.copy();
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

  public AbstractViewport3d(IPerspective perspective, IVector3 areasize, boolean isGrid, boolean shader, String camera, ISpaceController spaceController)
  {
    rendering = false;
    this.perspective = perspective;
    size_ = new Vector3Double(1.0);
    position_ = Vector3Double.ZERO.copy();
    isGrid_    = isGrid;
    preserveAR_ = true;
    areaSize_ = areasize;
    paddedSize_ = new Vector2Double(1.0);
    drawObjects_ = new HashSet<Object>();
//        objectList_ = new ArrayList<Object>();
    listeners_ = new HashSet<Object>();
//        zoomLimit_ = 20.0;
    this.shader = shader;
    this.camera = camera;
    this.spacecontroller = spaceController;
  }
  
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

public Text(Object position, Font baseFont, Color color, String text, int halign, int valign, int absFlags, IParsedExpression drawcondition)
{
  super(Primitive.PRIMITIVE_TYPE_TEXT, position, Vector3Double.ZERO.copy(), new Vector2Double(1.0), absFlags, color, drawcondition);
  setHAlign(halign);
  setVAlign(valign);
  if (baseFont == null)
    baseFont = new Font(null);
  this.baseFont = baseFont;
  if (text == null)
    text = "";
  this.text = text;
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Creates a new TiledLayer.
 * 
 * @param tileSize size of an individual tile
 * @param color the modulation color
 * @param texturePath resource path of the texture
 */
public TiledLayer(IVector2 tileSize, Object color, String texturePath)
{
  super(Layer.LAYER_TYPE_TILED, color);
  this.tileSize_ = tileSize.copy();
  //this.modColor_ = color==null? Color.WHITE: color;
  this.invTileSize_ = (new Vector2Double(1.0)).divide(tileSize_);
  this.texturePath_ = texturePath;
  //texture_ = 0;
}

origin: org.activecomponents.jadex/jadex-applications-bdi

  /**
   *  The plan body.
   */
  public void body()
  {
    double x_dest = Math.random();
    double y_dest = Math.random();
    Vector2Double dest = new Vector2Double(x_dest, y_dest);
    IGoal moveto = createGoal("achievemoveto");
    moveto.getParameter("location").setValue(dest);
//        System.out.println("Created: "+dest+" "+this);
    dispatchSubgoalAndWait(moveto);
//        System.out.println("Reached: "+dest+" "+this);
//        getLogger().info("Reached point: "+dest);
  }
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Returns the size of a pixel.
 * @retun size of a pixel
 */
public IVector2 getPixelSize()
{
  Canvas canvas = canvas_;
  if (canvas == null)
    return Vector2Double.ZERO;
  return paddedSize_.copy().divide(new Vector2Double(canvas.getWidth(), canvas.getHeight()));
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/**
 * Sets the position of the viewport.
 */
public void setPosition(IVector2 pos)
{
  position_ = pos;
  IVector2 pixSize = getPixelSize();
  pixPosition_ = position_.copy().divide(pixSize);
  pixPosition_ = (new Vector2Double(new Vector2Int(pixPosition_))).multiply(pixSize);
}
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

  public void run()
  {
    areaSize_ = new Vector2Double(areaSize);
    setSize(areaSize.copy());
    if (preserveAR_)
    {
      setPosition(paddedSize_.copy().subtract(areaSize_).multiply(0.5).negate());
    }
  }
});
origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

public void mouseDragged(MouseEvent e)
{
  if (lastDragPos != null)
  {
    IVector2 position = (new Vector2Double(e.getX(), e.getY())).multiply(getPixelSize());
    IVector2 diff = position.copy().subtract(lastDragPos);
    if (getInvertX())
      diff.negateX();
    if (!getInvertY())
      diff.negateY();
    lastDragPos = position;
    setPosition(getPosition().copy().subtract(diff));
  }
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

public final static IVector2 getBasePosition(AbstractViewport vp, IVector2 dcPos, IVector2 position, IVector2 canvasSize, boolean invX, boolean invY)
{
  IVector2 pos = vp.getPosition().copy().negate().add(vp.getObjectShift()).add(dcPos).add(position).divide(vp.getPaddedSize()).multiply(canvasSize);
  if (invX)
    pos.negateX().add(new Vector2Double(canvasSize.getXAsDouble(), 0));
  if (invY)
    pos.negateY().add(new Vector2Double(0, canvasSize.getYAsDouble()));
  return pos;
}

origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport

/** Sets a new zoom factor
 *  @param zoom new zoom factor
 */
public void setZoom(double zoom)
{
  IVector2 newSize = viewport.getAreaSize().copy().divide(new Vector2Double(zoom));
  IVector2 oldSize = viewport.getSize().copy();
  IVector2 pos = viewport.getPosition();
  viewport.setSize(newSize);
  pos.add(oldSize.subtract(newSize).multiply(0.5));
  viewport.setPosition(pos);
}

jadex.extension.envsupport.mathVector2Double<init>

Javadoc

Creates a new Vector2Double with the value (0,0).

Popular methods of Vector2Double

  • copy
  • divide
    Performs a division on the vector.
  • equals
  • getInnerProductAsDouble
  • getVector2
    Get a vector for two doubles.
  • getXAsDouble
  • getXAsFloat
  • getYAsDouble
  • getYAsFloat
  • multiply
  • negate
  • setX
  • negate,
  • setX,
  • setY

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JComboBox (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now