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