/** * Raycaster for GameLib.D3 * @param position GameLib.API.Vector3 * @param direction GameLib.API.Vector3 * @constructor */ GameLib.D3.API.Raycaster = function( position, direction ) { if (GameLib.Utils.UndefinedOrNull(position)) { position = new GameLib.API.Vector3(); } this.position = position; if (GameLib.Utils.UndefinedOrNull(direction)) { direction = new GameLib.API.Vector3(0, -1, 0); } this.direction = direction; }; /** * Returns an API raycaster from an Object raycaster * @param objectRaycaster * @constructor */ GameLib.D3.API.Raycaster.FromObjectRaycaster = function(objectRaycaster) { return new GameLib.D3.API.Raycaster( GameLib.API.Vector3.FromObjectVector(objectRaycaster.position), GameLib.API.Vector3.FromObjectVector(objectRaycaster.direction) ); };