vujadin / BabylonHx

Port of Babylon.js 3D engine to Haxe.
http:/paradoxplay.com/babylonhx
Apache License 2.0
189 stars 43 forks source link

Picking with instances #122

Closed mightymarcus closed 8 years ago

mightymarcus commented 8 years ago

I don't know if this is fixed already, but if not it's an easy fix. If picking on an InstancedMesh the positions:Array is null or undefined. So I just use the this._mesh.positions.

com.babylonhx.mesh.SubMesh

// inline public function intersects(ray:Ray, positions:Array, indices:Array, fastCheck:Bool = false):IntersectionInfo { var intersectInfo:IntersectionInfo = null;

    // fix
    if (positions == null)
    {
        positions = this._mesh.positions;
    }
mightymarcus commented 8 years ago

Is fixed in the latest version.