use of monkstone.vecmath.JRender in project propane by ruby-processing.
the class Vec2 method toCurveVertex.
/**
* To curve vertex
*
* @param context ThreadContext
* @param object IRubyObject vertex renderer
*/
@JRubyMethod(name = "to_curve_vertex")
public void toCurveVertex(ThreadContext context, IRubyObject object) {
JRender renderer = (JRender) object.toJava(JRender.class);
renderer.curveVertex(jx, jy);
}
use of monkstone.vecmath.JRender in project propane by ruby-processing.
the class Vec3 method toNormal.
/**
* Sends this Vec3D as a processing normal
*
* @param context ThreadContext
* @param object IRubyObject vertex renderer
*/
@JRubyMethod(name = "to_normal")
public void toNormal(ThreadContext context, IRubyObject object) {
JRender renderer = (JRender) object.toJava(JRender.class);
renderer.normal(jx, jy, jz);
}
use of monkstone.vecmath.JRender in project propane by ruby-processing.
the class Vec3 method toVertexUV.
/**
* Sends this Vec3D as a processing vertex uv
*
* @param context ThreadContext
* @param args IRubyObject[]
*/
@JRubyMethod(name = "to_vertex_uv", rest = true)
public void toVertexUV(ThreadContext context, IRubyObject... args) {
int count = args.length;
double u = 0;
double v = 0;
if (count == 3) {
u = args[1] instanceof RubyFloat ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
v = args[2] instanceof RubyFloat ? ((RubyFloat) args[2]).getValue() : ((RubyFixnum) args[2]).getDoubleValue();
}
if (count == 2) {
Vec2 texture = (Vec2) args[1].toJava(Vec2.class);
u = texture.javax();
v = texture.javay();
}
JRender renderer = (JRender) args[0].toJava(JRender.class);
renderer.vertex(jx, jy, jz, u, v);
}
use of monkstone.vecmath.JRender in project propane by ruby-processing.
the class Vec3 method toVertex.
/**
* To vertex
*
* @param context ThreadContext
* @param object IRubyObject vertex renderer
*/
@JRubyMethod(name = "to_vertex")
public void toVertex(ThreadContext context, IRubyObject object) {
JRender renderer = (JRender) object.toJava(JRender.class);
renderer.vertex(jx, jy, jz);
}
use of monkstone.vecmath.JRender in project propane by ruby-processing.
the class Vec3 method toCurveVertex.
/**
* To curve vertex
*
* @param context ThreadContext
* @param object IRubyObject vertex renderer
*/
@JRubyMethod(name = "to_curve_vertex")
public void toCurveVertex(ThreadContext context, IRubyObject object) {
JRender renderer = (JRender) object.toJava(JRender.class);
renderer.curveVertex(jx, jy, jz);
}
Aggregations