|
@@ -145,7 +145,7 @@ class Polygon extends Object3D {
|
|
|
primitive.tangents = [for(p in points) new h3d.col.Point(0., 1., 0.)];
|
|
|
primitive.uvs = [for(uv in uvs) new h3d.prim.UV(uv.x, uv.y)];
|
|
|
primitive.colors = [for(p in points) new h3d.col.Point(1,1,1)];
|
|
|
-
|
|
|
+ primitive.incref();
|
|
|
cache.set(shape, primitive);
|
|
|
return primitive;
|
|
|
}
|
|
@@ -189,7 +189,10 @@ class Polygon extends Object3D {
|
|
|
polyPrim.alloc(h3d.Engine.getCurrent());
|
|
|
}
|
|
|
#if editor
|
|
|
+ if(cachedPrim != null)
|
|
|
+ cachedPrim.decref();
|
|
|
cachedPrim = polyPrim;
|
|
|
+ cachedPrim.incref();
|
|
|
#end
|
|
|
return polyPrim;
|
|
|
}
|