Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

margh

  • Loading branch information...
commit 4e80802ad5df3f6f4419a5407c36835cf15c718c 1 parent 2d5c20c
Nicholas Kinsey authored
3  index.js
View
@@ -1,3 +0,0 @@
-(function() {
- module.exports = require('./lib/bullet');
-}).call(this);
6 lib/bullet.js
View
@@ -1,6 +0,0 @@
-(function() {
- var Bullet, exports;
- Bullet = require('../build/default/bullet');
- exports = module.exports = Bullet;
- exports.VERSION = '0.1.0';
-}).call(this);
2  src/BoxShape.cc
View
@@ -31,6 +31,6 @@ BoxShape::BoxShape(): ObjectWrap() {
BoxShape::~BoxShape() {
if (_btBoxShape) {
- free(_btBoxShape);
+ delete _btBoxShape;
}
}
2  src/CollisionDispatcher.cc
View
@@ -34,6 +34,6 @@ CollisionDispatcher::CollisionDispatcher(DefaultCollisionConfiguration* defaultC
CollisionDispatcher::~CollisionDispatcher() {
if (_btCollisionDispatcher) {
- delete _btCollisionDispatcher;
+ //delete _btCollisionDispatcher;
}
}
2  src/DbvtBroadphase.cc
View
@@ -31,6 +31,6 @@ DbvtBroadphase::DbvtBroadphase(): ObjectWrap() {
DbvtBroadphase::~DbvtBroadphase() {
if (_btDbvtBroadphase) {
- delete _btDbvtBroadphase;
+ //delete _btDbvtBroadphase;
}
}
2  src/DefaultCollisionConfiguration.cc
View
@@ -31,6 +31,6 @@ DefaultCollisionConfiguration::DefaultCollisionConfiguration(): ObjectWrap() {
DefaultCollisionConfiguration::~DefaultCollisionConfiguration() {
if (_btDefaultCollisionConfiguration) {
- delete _btDefaultCollisionConfiguration;
+ //delete _btDefaultCollisionConfiguration;
}
}
8 src/DiscreteDynamicsWorld.cc
View
@@ -50,6 +50,12 @@ Handle<Value>
DiscreteDynamicsWorld::SetGravity(const Arguments &args) {
HandleScope scope;
+ // const btScalar x = ObjectWrap::Unwrap<btScalar>(args[0]->ToNumber());
+ // const btScalar y = ObjectWrap::Unwrap<btScalar>(args[1]->ToNumber());
+ // const btScalar z = ObjectWrap::Unwrap<btScalar>(args[2]->ToNumber());
+
+ // btVector3 vector(, ObjectWrap::Unwrap<btScalar>(args[1]->ToNumber()), ObjectWrap::Unwrap<btScalar>(args[2]->ToNumber()));
+
DiscreteDynamicsWorld* discreteDynamicsWorld = ObjectWrap::Unwrap<DiscreteDynamicsWorld>(args.This());
discreteDynamicsWorld->_btDiscreteDynamicsWorld->setGravity(btVector3(0, -10, 0));
@@ -96,6 +102,6 @@ DiscreteDynamicsWorld::DiscreteDynamicsWorld(CollisionDispatcher* collisionDispa
DiscreteDynamicsWorld::~DiscreteDynamicsWorld() {
if (_btDiscreteDynamicsWorld) {
- delete _btDiscreteDynamicsWorld;
+ //delete _btDiscreteDynamicsWorld;
}
}
2  src/SequentialImpulseConstraintSolver.cc
View
@@ -31,6 +31,6 @@ SequentialImpulseConstraintSolver::SequentialImpulseConstraintSolver(): ObjectWr
SequentialImpulseConstraintSolver::~SequentialImpulseConstraintSolver() {
if (_btSequentialImpulseConstraintSolver) {
- delete _btSequentialImpulseConstraintSolver;
+ //delete _btSequentialImpulseConstraintSolver;
}
}
2  src/Transform.cc
View
@@ -35,6 +35,6 @@ Transform::Transform(): ObjectWrap() {
Transform::~Transform() {
if (_btTransform) {
- free(_btTransform);
+ delete _btTransform;
}
}
8 test/master.coffee
View
@@ -22,24 +22,22 @@ discreteDynamicsWorld.setGravity()
# # boxShape = new Bullet.BoxShape
# # console.log 'boxShape', boxShape
-#
+
# # transform = new Bullet.Transform
# # console.log 'transform', transform
-for i in [0...1000]
+for i in [0...1]
rigidBody = new Bullet.RigidBody
console.log 'rigidBody', rigidBody
discreteDynamicsWorld.addRigidBody rigidBody
-gc()
-
fps = 0
tick = ->
fps++
discreteDynamicsWorld.stepSimulation()
- gc()
+
process.nextTick tick
process.nextTick ->
35 test/master.js
View
@@ -1,35 +0,0 @@
-(function() {
- var Bullet, bullet, collisionDispatcher, dbvtBroadphase, defaultCollisionConfiguration, discreteDynamicsWorld, fps, i, rigidBody, sequentialImpulseConstraintSolver, tick;
- Bullet = require('../index');
- bullet = new Bullet.Bullet;
- console.log('bullet', bullet);
- defaultCollisionConfiguration = new Bullet.DefaultCollisionConfiguration;
- console.log('defaultCollisionConfiguration', defaultCollisionConfiguration);
- collisionDispatcher = new Bullet.CollisionDispatcher(defaultCollisionConfiguration);
- console.log('collisionDispatcher', collisionDispatcher);
- dbvtBroadphase = new Bullet.DbvtBroadphase;
- console.log('dbvtBroadphase', dbvtBroadphase);
- sequentialImpulseConstraintSolver = new Bullet.SequentialImpulseConstraintSolver;
- console.log('sequentialImpulseConstraintSolver', sequentialImpulseConstraintSolver);
- discreteDynamicsWorld = new Bullet.DiscreteDynamicsWorld(collisionDispatcher, dbvtBroadphase, sequentialImpulseConstraintSolver, defaultCollisionConfiguration);
- console.log('discreteDynamicsWorld', discreteDynamicsWorld);
- discreteDynamicsWorld.setGravity();
- for (i = 0; i < 1; i++) {
- rigidBody = new Bullet.RigidBody;
- console.log('rigidBody', rigidBody);
- }
- discreteDynamicsWorld.addRigidBody(rigidBody);
- fps = 0;
- tick = function() {
- fps++;
- discreteDynamicsWorld.stepSimulation();
- return process.nextTick(tick);
- };
- process.nextTick(function() {
- return tick();
- });
- setInterval(function() {
- console.log(fps);
- return fps = 0;
- }, 1000);
-}).call(this);
6 test/npm.js
View
@@ -1,6 +0,0 @@
-(function() {
- var Bullet, b;
- Bullet = require('bullet').Bullet;
- b = new Bullet;
- console.log(b);
-}).call(this);
Please sign in to comment.
Something went wrong with that request. Please try again.