本文整理匯總了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;
}
示例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;
}