40 |
*/ |
*/ |
41 |
public class NodeType2D extends AbstractNodeType2D { |
public class NodeType2D extends AbstractNodeType2D { |
42 |
public static boolean dbg = false; |
public static boolean dbg = false; |
43 |
private static void pa(String s) { System.out.println(s); } |
private static void pa(String s) { System.out.println("NodeType2D:: "+s); } |
44 |
|
|
45 |
public static int effigy = 0; |
public static int effigy = 0; |
46 |
|
|
60 |
|
|
61 |
public int renderBuoy(VobScene vs, int into, Object linkId, |
public int renderBuoy(VobScene vs, int into, Object linkId, |
62 |
Object anchor, Object cachedSize) { |
Object anchor, Object cachedSize) { |
63 |
|
if (dbg) pa("start renderBuoy"); |
64 |
if(effigy != 0) { |
if(effigy != 0) { |
65 |
Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1, 0,0); |
Vob eff = org.nongnu.libvob.gl.GLRen.createQuad(effigy-1, 0,0); |
66 |
vs.map.put( eff, into); |
vs.map.put( eff, into); |
73 |
float[] tmp = new float[2]; |
float[] tmp = new float[2]; |
74 |
vs.coords.getSqSize(into, tmp); |
vs.coords.getSqSize(into, tmp); |
75 |
float w = tmp[0], h = tmp[1]; |
float w = tmp[0], h = tmp[1]; |
76 |
pa("rect "+rect+" coords "+w+","+h); |
if (dbg) pa("rect "+rect+" coords "+w+","+h); |
77 |
|
|
78 |
float scale = w / rect.width; |
float scale = w / rect.width; |
79 |
if(scale < h / rect.height) scale = h / rect.height; |
if(scale < h / rect.height) scale = h / rect.height; |
88 |
|
|
89 |
view2d.render(vs, plane, into, into, box2paper); |
view2d.render(vs, plane, into, into, box2paper); |
90 |
|
|
91 |
|
if (dbg) pa("start renderBuoy..DONE"); |
92 |
return vs.coords.translate(into, w/2f, h/2f); |
return vs.coords.translate(into, w/2f, h/2f); |
93 |
} |
} |
94 |
} |
} |