当前位置: 首页>>代码示例>>Java>>正文


Java Line.setLineWidth方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:VisibleBone.java

示例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++;
	}
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:19,代码来源:EditorRenderer.java

示例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);
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:12,代码来源:LineElement.java

示例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);
}
 
开发者ID:synergynet,项目名称:synergynet3.1,代码行数:19,代码来源:GestureDrawer.java

示例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++;
	}
}
 
开发者ID:methusalah,项目名称:OpenRTS,代码行数:49,代码来源:EditorRenderer.java


注:本文中的com.jme3.scene.shape.Line.setLineWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。