本文整理汇总了Java中com.jme3.scene.shape.Line.setLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setLineWidth方法的具体用法?Java Line.setLineWidth怎么用?Java Line.setLineWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.shape.Line
的用法示例。
在下文中一共展示了Line.setLineWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VisibleBone
import com.jme3.scene.shape.Line; //导入方法依赖的package包/类
public VisibleBone(Bone bone, Vector3f parentLocation, Quaternion parentRotation, AssetManager assetManager) {
Material redMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
redMat.setColor("Color", ColorRGBA.Red);
Material whiteMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
whiteMat.setColor("Color", ColorRGBA.White);
Geometry g = new Geometry(bone.getName(), new Sphere(9, 9, 0.01f));
globalPosition = bone.getLocalPosition().add(parentLocation);
g.setLocalTranslation(globalPosition);
g.setLocalRotation(bone.getLocalRotation().mult(parentRotation));
g.setMaterial(redMat);
this.attachChild(g);
if (bone.getChildren() != null) {
for (Bone child : bone.getChildren()) {
VisibleBone vb = new VisibleBone(child, bone.getLocalPosition(), bone.getLocalRotation(), assetManager);
this.attachChild(vb);
Line line = new Line(globalPosition, vb.globalPosition);
line.setLineWidth(2);
Geometry geom = new Geometry("", line);
geom.setMaterial(whiteMat);
this.attachChild(geom);
}
}
}
示例2: drawHeightPencil
import com.jme3.scene.shape.Line; //导入方法依赖的package包/类
private void drawHeightPencil() {
List<Tile> tiles = ToolManager.getHeightTool().pencil.getNodes();
int index = 0;
for (Spatial s : HeightPencilNode.getChildren()) {
if (index < tiles.size()) {
Point3D start = tiles.get(index).getPos();
Point3D end = tiles.get(index).getPos().getAddition(0, 0, 0.5);
Line l = new Line(TranslateUtil.toVector3f(start), TranslateUtil.toVector3f(end));
l.setLineWidth(PENCIL_THICKNESS);
((Geometry) s).setMesh(l);
s.setLocalTranslation(Vector3f.ZERO);
// s.setLocalTranslation(Translator.toVector3f(tiles.get(index).getPos2D(), (float)toolManager.selector.getElevation()+0.1f));
} else {
s.setLocalTranslation(new Vector3f(-1000, -1000, 0));
}
index++;
}
}
示例3: LineElement
import com.jme3.scene.shape.Line; //导入方法依赖的package包/类
public LineElement(BaseScreen screen, Vector2f p1, Vector2f p2, ColorRGBA color, float lineWidth) {
super(screen, p1, new Size(p2.subtract(p1)));
Line l1 = new Line(new Vector3f(0, 0, 0), new Vector3f(p2.x - p1.x, p2.y - p1.y, 0));
l1.setLineWidth(lineWidth);
Geometry geom = new Geometry("A shape", l1);
meshMaterial.setColor("Color", color);
geom.setMaterial(meshMaterial);
attachChild(geom);
}
示例4: initLine
import com.jme3.scene.shape.Line; //导入方法依赖的package包/类
/**
* Inits the line.
*
* @param l
* the l
*/
private void initLine(Line l)
{
l.setLineWidth(3f);
// TODO: where do we set color, scale, translation, etc.
// l.setSolidColor(ColorRGBA.White);
// l.setLocalScale(200f);
// l.setMode(Mode.Connected);
// TODO: work out why Line is no longer a spatial
// attachChild(l);
}
示例5: drawAtlasPencil
import com.jme3.scene.shape.Line; //导入方法依赖的package包/类
private void drawAtlasPencil() {
Pencil s = ToolManager.getActualTool().pencil;
PointRing pr = new PointRing();
Point2D center = ToolManager.getActualTool().pencil.getCoord();
if (s.shape == Pencil.SHAPE.Square || s.shape == Pencil.SHAPE.Diamond) {
for (double i = -s.size / 2; i < s.size / 2; i += QUAD_PENCIL_SAMPLE_LENGTH) {
pr.add(center.getAddition(i, -s.size / 2));
}
for (double i = -s.size / 2; i < s.size / 2; i += QUAD_PENCIL_SAMPLE_LENGTH) {
pr.add(center.getAddition(s.size / 2, i));
}
for (double i = s.size / 2; i > -s.size / 2; i -= QUAD_PENCIL_SAMPLE_LENGTH) {
pr.add(center.getAddition(i, s.size / 2));
}
for (double i = s.size / 2; i > -s.size / 2; i -= QUAD_PENCIL_SAMPLE_LENGTH) {
pr.add(center.getAddition(-s.size / 2, i));
}
if (s.shape == Pencil.SHAPE.Diamond) {
PointRing newPR = new PointRing();
for (Point2D p : pr) {
newPR.add(p.getRotation(AngleUtil.RIGHT / 2, center));
}
pr = newPR;
}
} else {
Point2D revol = center.getAddition(s.size / 2, 0);
for (int i = 0; i < CIRCLE_PENCIL_SAMPLE_COUNT; i++) {
pr.add(revol.getRotation(AngleUtil.FLAT * 2 * i / CIRCLE_PENCIL_SAMPLE_COUNT, center));
}
}
int index = 0;
for (Spatial spatial : AtlasPencilNode.getChildren()) {
if (index < pr.size() && ModelManager.getBattlefield().getMap().isInBounds(pr.get(index))
&& ModelManager.getBattlefield().getMap().isInBounds(pr.getNext(index))) {
Point3D start = pr.get(index).get3D(ModelManager.getBattlefield().getMap().getAltitudeAt(pr.get(index)) + 0.1);
Point3D end = pr.getNext(index).get3D(ModelManager.getBattlefield().getMap().getAltitudeAt(pr.getNext(index)) + 0.1);
Line l = new Line(TranslateUtil.toVector3f(start), TranslateUtil.toVector3f(end));
l.setLineWidth(PENCIL_THICKNESS);
((Geometry) spatial).setMesh(l);
spatial.setLocalTranslation(Vector3f.ZERO);
} else {
spatial.setLocalTranslation(new Vector3f(-1000, -1000, 0));
}
index++;
}
}