send uv data with intersect

beta.r3js.org
-=yb4f310 2018-03-24 19:39:11 +01:00
parent 23083a6ef1
commit a1b5cd4347
2 changed files with 7 additions and 2 deletions

View File

@ -177,7 +177,11 @@ GameLib.D3.Raycaster.prototype.getIntersectedObjects = function(meshes) {
mesh: mesh,
distance : intersects[0].distance,
face: mesh.geometry.faces[intersects[0].faceIndex],
faceIndex: intersects[0].faceIndex
faceIndex: intersects[0].faceIndex,
uv : {
x : intersects[0].uv.x,
y : intersects[0].uv.y
}
}
);
}

View File

@ -160,7 +160,7 @@ GameLib.Image.prototype.getPixelData = function() {
var imageData = context.getImageData(0, 0, this.width, this.height);
var pixels = imageData.data;
return pixels;
};
@ -177,6 +177,7 @@ GameLib.Image.prototype.getHeightData = function() {
var pixels = this.getPixelData();
var data = new Float32Array( this.width * this.height );
var height, i, j = 0;