Files
bullet3/ObsoleteDemos/NativeClient/bin_html/bind.js
erwin coumans 69e5454d18 Add the old Bullet 2.x obsolete demos, and CMake buildsystem files, and gradually move them to newer Bullet 3.x structure
Use statically linked freeglut, instead of dynamic glut for the obsolete Bullet 2.x demos
Add the 'reset' method to b3GpuDynamicsWorld, and use it in the BasicGpuDemo (pretty slow in debug mode, use release mode)
Don't crash in btCollisionWorld, if there is no collision dispatcher
2013-12-19 12:40:59 -08:00

23 lines
748 B
JavaScript

// Copyright (c) 2011 The Native Client Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview This class implements an extension to Function object that
* lets you bind a scope for |this| to a function.
*/
/**
* Bind a scope to a function. Used to bind an object to |this| for event
* handlers.
* @param {!Object} scope The scope in which the function executes. |scope|
* becomes |this| during function execution.
* @return {function} the bound version of the original function.
*/
Function.prototype.bind = function(scope) {
var boundContext = this;
return function() {
return boundContext.apply(scope, arguments);
}
}