Skip to content

Commit

Permalink
fixed merge version issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor Salga authored and Andor Salga committed Sep 10, 2011
2 parents 2abd9d1 + ec56545 commit f48b802
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
@@ -1,4 +1,4 @@
July 19, 2011 - Release 0.75
July 21, 2011 - Release 0.75

* Created changelog
* Added anti-aliasing option
Expand Down
6 changes: 6 additions & 0 deletions demos/lion/lion.js
Expand Up @@ -32,6 +32,12 @@ function keyDown(){
if(ps.key == KEY_ESC){
ps.stop("../../clouds/lion_1048K_n.psi");
}

// D deletes and recreates the cloud
if(ps.key == 68 || ps.key == 100 ){
ps.delete(lion);
lion = ps.load("../../clouds/lion_1048K_n.psi");
}
}

function render() {
Expand Down
24 changes: 21 additions & 3 deletions psapi.js
Expand Up @@ -6,7 +6,7 @@
@class XB PointStream is a WebGL library designed to efficiently stream and
render point cloud data in a canvas element.
@version 0.7
@version 0.75
*/
var PointStream = (function() {

Expand Down Expand Up @@ -56,7 +56,7 @@ var PointStream = (function() {
registeredParsers["pts"] = PTSParser;
registeredParsers["ply"] = PLYParser;

var VERSION = "0.7";
const VERSION = "0.75";

// Following should be const, but some browsers along
// with jslint have issues with this keyword.
Expand Down Expand Up @@ -1192,7 +1192,25 @@ var PointStream = (function() {
this.clear = function(){
ctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT);
};


this.delete = function(pointCloud){
var semantics = Object.keys(pointCloud.attributes);
var firstSemantic = semantics[0];

var arrayOfBufferObjsV = pointCloud.attributes[firstSemantic];
if(arrayOfBufferObjsV){
// Iterate over all the vertex buffer objects.
for(var currVBO = 0; currVBO < arrayOfBufferObjsV.length; currVBO++){
// iterate over all the semantic names "ps_Vertex", "ps_Normal", etc.
for(name in semantics){
if(pointCloud.attributes[semantics[name]][currVBO]){
ctx.deleteBuffer(pointCloud.attributes[semantics[name]][currVBO].VBO);
}
}
}
}
};

/**
Renders a point cloud.
@param {} pointCloud
Expand Down

0 comments on commit f48b802

Please sign in to comment.