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


Java Vector2f.equals方法代碼示例

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


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

示例1: sizeToContent

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
public BaseElement sizeToContent() {
	Vector2f was = dimensions.clone();

	/*
	 * Reset size to zero to preferred text widths calculate properly. If
	 * this is not done, tooltips won't size correctly
	 */
	dimensions.set(0, 0);

	/*
	 * This is done for a maximum of twice for the benefit of elements that
	 * only know their true preferred size once their children are laid out
	 * (such as scroll panel and wrapping text).
	 */
	for (int i = 0; i < 2; i++) {
		Vector2f newWindowSize = calcPreferredSize();
		if (newWindowSize.equals(was)) {
			dimensions.set(was);
			break;
		}
		setDimensions(newWindowSize);
		if (isLockToParentBounds()) {
			lockToParentBounds(getX(), getY());
		}

		// Shoud be done in setDimensiions
		// if (!was.equals(dimensions)) {
		// dirtyLayout(false, LayoutType.boundsChange());
		// layoutChildren();
		// }
		was = newWindowSize;
	}

	return this;
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:36,代碼來源:BaseElement.java

示例2: equals

import com.jme3.math.Vector2f; //導入方法依賴的package包/類
/**
 * Checks to see if the given Vector2f is equals to the data stored in the
 * buffer at the given data index.
 *
 * @param check
 *            the vector to check against - null will return false.
 * @param buf
 *            the buffer to compare data with
 * @param index
 *            the position (in terms of vectors, not floats) of the vector
 *            in the buffer to check against
 * @return
 */
public static boolean equals(Vector2f check, FloatBuffer buf, int index) {
    TempVars vars = TempVars.get();
    Vector2f tempVec2 = vars.vect2d;
    populateFromBuffer(tempVec2, buf, index);
    boolean eq = tempVec2.equals(check);
    vars.release();
    return eq;
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:22,代碼來源:BufferUtils.java


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