use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class ParticleLineConstraint method render.
public void render(Renderer renderer, int flags) {
if (myLineSize > 0) {
computeRenderVtxs();
RenderProps props = myRenderProps;
Shading savedShading = renderer.setPropsShading(props);
renderer.setLineColoring(props, isSelected());
renderer.drawLine(myRenderVtxs[0], myRenderVtxs[1]);
renderer.setShading(savedShading);
}
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class PlanarConnector method render.
public void render(Renderer renderer, int flags) {
Vector3d nrm = new Vector3d(0, 0, 1);
RigidTransform3d TDW = getCurrentTDW();
computeRenderVtxs(TDW);
nrm.transform(TDW);
RenderProps props = myRenderProps;
Shading savedShading = renderer.setPropsShading(props);
renderer.setFaceColoring(props, isSelected());
renderer.setFaceStyle(props.getFaceStyle());
renderer.beginDraw(DrawMode.TRIANGLE_STRIP);
renderer.setNormal(nrm.x, nrm.y, nrm.z);
renderer.addVertex(myRenderVtxs[3]);
renderer.addVertex(myRenderVtxs[0]);
renderer.addVertex(myRenderVtxs[2]);
renderer.addVertex(myRenderVtxs[1]);
renderer.endDraw();
renderer.setShading(savedShading);
// set default
renderer.setFaceStyle(FaceStyle.FRONT);
renderer.drawPoint(myRenderProps, myRenderCoords, isSelected());
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class SoftPlaneCollider method defaultRenderProps.
protected static RenderProps defaultRenderProps(HasProperties host) {
RenderProps props = RenderProps.createMeshProps(host);
props.setFaceColor(new Color(0.5f, 0.5f, 0.5f));
props.setFaceStyle(Renderer.FaceStyle.FRONT_AND_BACK);
props.setAlpha(0.8);
props.setShininess(32);
return props;
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class PointList method render.
public void render(Renderer renderer, int flags) {
RenderProps props = myRenderProps;
if (myRob != null) {
int numReg = myRob.numPoints(REG_GRP);
int numSel = myRob.numPoints(SEL_GRP);
// draw selected first
if (renderer.isSelecting()) {
if (numSel > 0) {
drawPointsSelecting(renderer, SEL_GRP, props);
}
if (numReg > 0) {
drawPointsSelecting(renderer, REG_GRP, props);
}
} else {
if (numSel > 0) {
drawPoints(renderer, SEL_GRP, props, /*selected=*/
true);
}
if (numReg > 0) {
drawPoints(renderer, REG_GRP, props, /*selected=*/
false);
}
}
}
}
use of maspack.render.RenderProps in project artisynth_core by artisynth.
the class MotionTargetTerm method initTargetRenderProps.
public void initTargetRenderProps() {
targetRenderProps = new RenderProps();
targetRenderProps.setDrawEdges(true);
targetRenderProps.setFaceStyle(FaceStyle.NONE);
targetRenderProps.setLineColor(Color.CYAN);
targetRenderProps.setLineWidth(2);
targetRenderProps.setPointColor(Color.CYAN);
targetRenderProps.setPointStyle(PointStyle.SPHERE);
// set target point radius explicitly
targetRenderProps.setPointRadius(myController.targetsPointRadius);
myController.targetPoints.setRenderProps(targetRenderProps);
myController.targetFrames.setRenderProps(targetRenderProps);
}
Aggregations