當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector2f.addLocal方法代碼示例

本文整理匯總了Java中com.jme3.math.Vector2f.addLocal方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector2f.addLocal方法的具體用法?Java Vector2f.addLocal怎麽用?Java Vector2f.addLocal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jme3.math.Vector2f的用法示例。


在下文中一共展示了Vector2f.addLocal方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: calcMinimumSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcMinimumSize(Frame parent) {
	Vector2f min = new Vector2f();
	Vector2f dbPref = dragBar.calcPreferredSize();
	Vector2f dbLeftPref = dragLeft.calcPreferredSize();
	Vector2f dbRightPref = dragRight.calcPreferredSize();
	Vector2f trayMin = buttonTray.calcMinimumSize();
	Vector2f contMin = content.calcMinimumSize();
	Vector2f accpref = accessories.calcMinimumSize();
	min.x = Math.max((parent.getIndent() * 4) + accpref.x + dbLeftPref.x + dbRightPref.x
			+ (Math.max(trayMin.x, dbPref.x)), contMin.x);
	min.y = Math.max(accpref.y, Math.max(trayMin.y, Math.max(dbPref.y, Math.max(dbLeftPref.y, dbRightPref.y))))
			+ contMin.y;
	min.addLocal(parent.getTotalPadding());
	return min;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:17,代碼來源:Frame.java

示例2: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(Frame parent) {
	Vector2f pref = new Vector2f();
	Vector2f dbPref = dragBar.calcPreferredSize();
	Vector2f dbLeftPref = dragLeft.calcPreferredSize();
	Vector2f dbRightPref = dragRight.calcPreferredSize();
	Vector2f contPref = content.calcPreferredSize();
	Vector2f accPref = accessories.calcPreferredSize();
	Vector2f trayPref = buttonTray.calcPreferredSize();
	pref.x = Math.max(
			(parent.getIndent() * 4) + accPref.x + dbLeftPref.x + dbRightPref.x + trayPref.x + dbPref.x,
			contPref.x);
	pref.y = Math.max(accPref.x,
			Math.max(trayPref.y, Math.max(dbPref.y, Math.max(dbLeftPref.y, dbRightPref.y)))) + contPref.y;
	pref.addLocal(parent.getTotalPadding());
	return pref;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:18,代碼來源:Frame.java

示例3: calcMinimumSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcMinimumSize(TabControl parent) {
	Vector2f maxC = new Vector2f();
	for (TabPanel p : tabPanels) {
		maxC = MathUtil.max(maxC, p.calcMinimumSize());
	}
	Vector2f cPref = tabSlider.calcMinimumSize();
	if (getOrientation().equals(Orientation.HORIZONTAL)) {
		cPref.y += maxC.y;
		cPref.x = Math.max(cPref.x, maxC.x);
	} else {
		cPref.x += maxC.x;
		cPref.y = Math.max(cPref.y, maxC.y);
	}
	cPref.addLocal(parent.getTotalPadding());
	return cPref;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:18,代碼來源:TabControl.java

示例4: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
public Vector2f calcPreferredSize(TableCell parent) {
	Vector2f prefCell = new Vector2f();
	if (!parent.getActualChildren().isEmpty()) {
		for (BaseElement e : parent.getActualChildren()) {
			prefCell = MathUtil.max(prefCell, e.calcPreferredSize());
		}
	}
	if (parent.expanderButton != null) {
		Vector2f p = parent.expanderButton.calcPreferredSize();
		prefCell.x += p.x;
		prefCell.y = Math.max(prefCell.y, p.y);
	}
	prefCell.addLocal(parent.getTotalPadding());
	return prefCell;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:17,代碼來源:TableCell.java

示例5: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(Slider<V> container) {
	Vector2f ps = new Vector2f();
	float size = calcSliderSize(container);
	if (container.orientation == Orientation.VERTICAL) {
		ps.x = size;
		ps.y = (int) ((container.getSliderModel().getMax().doubleValue()
				- container.getSliderModel().getMin().doubleValue())
				/ container.getSliderModel().getStep().doubleValue());
	} else {
		ps.x = (int) ((container.getSliderModel().getMax().doubleValue()
				- container.getSliderModel().getMin().doubleValue())
				/ container.getSliderModel().getStep().doubleValue());
		ps.y = size;
	}
	ps.addLocal(container.getTotalPadding());
	return ps;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:19,代碼來源:Slider.java

示例6: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(ComboBox<I> parent) {
	Vector2f ps = super.calcPreferredSize(parent);

	if (menu != null) {
		for (MenuItem<?> mi : menu.getMenuItems()) {
			ps.x = Math.max(ps.x, mi.calcPreferredSize().x);
		}
	}

	Vector2f tps = textField.calcPreferredSize();
	ps = MathUtil.largest(ps, tps);

	Vector2f bps = btnArrowDown.calcPreferredSize();
	ps.addLocal(bps.x + parent.getIndent(), 0);

	return ps.addLocal(ps.y, 0);
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:19,代碼來源:ComboBox.java

示例7: calcMinimumSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcMinimumSize(ElementContainer<?,?> target) {
	Vector2f d = new Vector2f(0, 0);
	for (BaseElement c : target.getElements()) {
		Vector2f s = c.calcMinimumSize();
		if (s.x > d.x) {
			d.x = s.x;
		}
		if (s.y > d.y) {
			d.y = s.y;
		}
	}
	d.addLocal(target.getTotalPadding());
	return d;

}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:17,代碼來源:FillLayout.java

示例8: getPointPercentagePosition

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
private @NotNull Vector2f getPointPercentagePosition(@NotNull final Terrain terrain, @NotNull final Vector3f localPoint,
                                            @NotNull final Vector3f localScale, @NotNull final Vector2f result) {
    result.set(localPoint.x, -localPoint.z);

    float scale = localScale.getX();

    // already centered on Terrain's node origin (0,0)
    float scaledSize = terrain.getTerrainSize() * scale;
    result.addLocal(scaledSize / 2, scaledSize / 2); // shift the bottom left corner up to 0,0
    result.divideLocal(scaledSize); // get the location as a percentage

    return result;
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:14,代碼來源:PaintTerrainToolControl.java

示例9: calcMaximumSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcMaximumSize(Frame parent) {
	Vector2f maximumSize = content.calcMaximumSize();
	Vector2f dbmin = dragBar.calcPreferredSize();
	Vector2f dbleftmin = dragLeft.calcPreferredSize();
	Vector2f dbrightmin = dragRight.calcPreferredSize();
	Vector2f accpref = accessories.calcPreferredSize();
	float dbh = Math.max(accpref.y, Math.max(Math.max(dbmin.y, dbleftmin.y), dbrightmin.y));
	maximumSize.addLocal(parent.getTotalPadding());
	return maximumSize.add(new Vector2f(0, dbh));
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:12,代碼來源:Frame.java

示例10: getPointPercentagePosition

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
private Vector2f getPointPercentagePosition(Terrain terrain, Vector3f worldLoc) {
    Vector2f uv = new Vector2f(worldLoc.x,-worldLoc.z);
    float scale = ((Node)terrain).getWorldScale().x;

    // already centered on Terrain's node origin (0,0)
    //uv.subtractLocal(((Node)terrain).getWorldTranslation().x*scale, ((Node)terrain).getWorldTranslation().z*scale); // center it on 0,0
    float scaledSize = terrain.getTerrainSize()*scale;
    uv.addLocal(scaledSize/2, scaledSize/2); // shift the bottom left corner up to 0,0
    uv.divideLocal(scaledSize); // get the location as a percentage
    
    return uv;
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:13,代碼來源:PaintTerrainToolAction.java

示例11: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(BaseElement container) {
	Vector2f t = new Vector2f();
	for (BaseElement e : container.getElements()) {
		Vector2f sz = e.calcPreferredSize();
		t.x += sz.x;
		t.y = Math.max(t.y, sz.y);
	}
	return t.addLocal(container.getTotalPadding());
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:11,代碼來源:TableHeaderLayout.java

示例12: calcMinimumSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcMinimumSize(Slider<V> container) {
	float size = calcSliderSize(container);
	Vector2f min = new Vector2f();
	if (container.orientation == Orientation.VERTICAL) {
		min.x = size;
		min.y = min.x * 3;
	} else {
		min.y = size;
		min.x = min.y * 3;
	}
	min.addLocal(container.getTotalPadding());
	return min;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:15,代碼來源:Slider.java

示例13: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(SlideTray parent) {
	Vector2f traySize = new Vector2f();
	Vector2f nextSize = btnNextElement.calcPreferredSize();
	Vector2f prevSize = btnPrevElement.calcPreferredSize();
	Vector2f elsSize = elTray.calcPreferredSize();
	if (orientation == Orientation.HORIZONTAL) {
		traySize.x += nextSize.x + prevSize.x + elsSize.x;
		traySize.y = Math.max(elsSize.y, Math.max(nextSize.y, prevSize.y));
	} else {
		traySize.y += nextSize.y + prevSize.y + elsSize.y;
		traySize.x = Math.max(elsSize.x, Math.max(nextSize.x, prevSize.x));
	}
	return traySize.addLocal(parent.getTotalPadding());
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:16,代碼來源:SlideTray.java

示例14: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(ElementContainer<?,?> target) {
	Vector2f prefSize = new Vector2f();
	for (BaseElement e : target.getElements()) {
		Vector4f bnds = getConstrainedBounds(e);
		prefSize.x = Math.max(prefSize.x, bnds.x + bnds.z);
		prefSize.y = Math.max(prefSize.y, bnds.y + bnds.w);
	}
	return prefSize.addLocal(target.getTotalPadding());
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:11,代碼來源:XYLayout.java

示例15: calcPreferredSize

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
@Override
protected Vector2f calcPreferredSize(ElementContainer<?,?> target) {
	Vector2f prefSize = new Vector2f();
	for (BaseElement e : target.getElements()) {
		prefSize.x = Math.max(prefSize.x, e.getX() + e.getWidth());
		prefSize.y = Math.max(prefSize.y, e.getY() + e.getHeight());
	}
	return prefSize.addLocal(target.getTotalPadding());
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:10,代碼來源:SizeLayout.java


注:本文中的com.jme3.math.Vector2f.addLocal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。