GithubHelp home page GithubHelp logo

nickhardeman / ofxbullet Goto Github PK

View Code? Open in Web Editor NEW
145.0 22.0 52.0 49.07 MB

Bullet Physics Wrapper for Openframeworks

C 3.49% C++ 94.96% CMake 0.56% Lua 0.01% Makefile 0.88% Objective-C++ 0.10%
bullet-physics soft-bodies openframeworks-addon 3d-physics openframeworks addon

ofxbullet's Issues

Quaternion problem at create function of shapes

I think,
tr.setRotation( btQuaternion(btVector3(a_rot.x(), a_rot.y(), a_rot.z()), a_rot.w()) );
is not quaternion, it is axis-angle representation.
Maybe,
tr.setRotation(btQuaternion(a_rot.x(), a_rot.y(), a_rot.z(), a_rot.w()) );
is correct. Could you please check?

for example.
void ofxBulletCylinder::create( btDiscreteDynamicsWorld* a_world, ofVec3f a_loc, ofQuaternion a_rot, float a_mass, float a_radius, float a_height ) {
btTransform tr = ofGetBtTransformFromVec3f( a_loc );
//tr.setRotation( btQuaternion(btVector3(a_rot.x(), a_rot.y(), a_rot.z()), a_rot.w()) );
tr.setRotation( btQuaternion(a_rot.x(), a_rot.y(), a_rot.z(), a_rot.w()) );
}

Not compiling OF098 Ubuntu 16.04

Hi I'm getting a bunch of errors while trying to compile some of the examples (EventExample in this case):

any idea about the cause?

In file included from /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletWorldRigid.h:14:0, from /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBullet.h:11, from /mnt/FILES/CODE/OF/OF_098/apps/myApps/EventsExample/src/ofApp.h:4, from /mnt/FILES/CODE/OF/OF_098/apps/myApps/EventsExample/src/main.cpp:2: /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletUtils.h:13:47: error: ‘glm’ has not been declared static btTransform ofGetBtTransformFromVec3f( glm::vec3 a_v ) { ^ /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletUtils.h:13:63: error: expected ‘,’ or ‘;’ before ‘{’ token static btTransform ofGetBtTransformFromVec3f( glm::vec3 a_v ) { ^ /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletUtils.h:34:80: error: ‘glm’ has not been declared gidBody* ofGetBtRigidBodyFromCollisionShape(btCollisionShape* a_cs, glm::vec3 a ^ /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletUtils.h:34:90: error: expected ‘,’ or ‘...’ before ‘a_loc’ fGetBtRigidBodyFromCollisionShape(btCollisionShape* a_cs, glm::vec3 a_loc, floa ^ /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletUtils.h: In function ‘btRigidBody* ofGetBtRigidBodyFromCollisionShape(btCollisionShape*, int)’: /mnt/FILES/CODE/OF/OF_098/addons/ofxBullet/src/ofxBulletUtils.h:35:43: error: ‘a_loc’ was not declared in this scope btTransform tr=ofGetBtTransformFromVec3f(a_loc);

Doesn't compile on OF0.8.0

Compiling empty example in Code::Blocks under Debian gives..

../../../../addons/ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverBuffer_DX11.h:19:21: fatal error: windows.h: No such file or directory
#include <windows.h>

Some compile variable for Bullet that is wrong for Linux environment?

Doesn't play well with ofxOpenCL or ofxMSAOpenCL

Hey Nick,

Not sure this is a ofxBullet problem, but I've been trying to use ofxOpenCL + ofxBullet together and I get a runtime crash every time... is there any way to disable Bullet's use of openCL so it only uses the GPU?

Thanks for the addon man, its going to save me weeks of time.

Reza

XCode6 iOS8 compile issue of 0.8.4

I'm having trouble compiling

.../addons/ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexBuffer_DX11.h:22:10: 'windows.h' file not found`

The windows.h file is not found so I'm thinking the project configuration is off for iOS in XCode6.

Here is what I'm doing :

  1. Copied ofxBullet into my addons folder
  2. Used the Project Generator to create a new project
  3. Tried to compile this new project with XCode6

raycastTest error in iOS

2013-09-04 5 51 51

oF 0.8.0

void ofApp::draw(){
...
    ofSetColor(0, 0, 255);
    ofDrawSphere(cam.getPosition()+castRay*600, 10);

    ofSetColor(255, 100, 200);
    ofDrawSphere(rayWorldPos, 10);

    // line from origin-zero to castRay pos, it pass through rayWorldPos
    ofSetColor(0, 255, 0);
    ofSetLineWidth(5);
    ofLine(ofVec3f(0), cam.getPosition()+castRay*600);
...
}

///////////////
void ofApp::touchDown(ofTouchEventArgs & touch){
    ofxBulletRaycastData data = world.raycastTest(touch.x, touch.y);

    if ( data.bHasHit ){
        MyBodyInfo* info = (MyBodyInfo*)data.userData;
        info->c = ofColor(0, 255, 100);

        rayWorldPos = data.rayWorldPos;

    }

    castRay = cam.screenToWorld( ofVec3f(touch.x, touch.y, 0) );
    castRay = castRay - cam.getPosition();
    castRay.normalize();
}

something wrong with this?

world->rayTest( rayStart, rayEnd, rayCallback ); 

Getting an error message after quitting application

Every time after I quit any application using ofBullet I get the following message in the console

**
Assertion failed: (m_constraintRefs.size()==0), function btRigidBody, file /Users/NickHardeman/Desktop/bullet-2.77 2/src/BulletDynamics/Dynamics/btRigidBody.h, line 175.
sharedlibrary apply-load-rules all
warning: Could not find object file "/Developer/usr/lib/gcc/i686-apple-darwin10/4.0.1/libgcc.a(_eprintf.o)" - no debug information available for "/var/tmp/gcc_40/gcc_40-5494
211/src/gcc/libgcc2.c".

warning: Could not find object file "/Users/theo/Documents/CODE/__OPENFRAMEWORKS/gitOF/openFrameworks/apps/devApps/macDragDropExample/buildGlutFrameworkHackedWindowLevel10.4/libForeground.a(macx_foreground.o)" - no debug information available for "/Users/mcast/Code/GLUT-ToPost/macx_foreground.m".
**
And also points to the following thread
GitHub Logo

I don't know what is going on, any ideas?

Potential Visual Studio Change/Fix

I recently was able to get ofxBullet working under vs2012, but the fix I had to make to your code is something that I can't possibly know the implications of just yet. It has to do with aligned types in bt that vc11 just doesn't know how to deal with. Everywhere you use a bt_transform needs to be passed by reference because it is an aligned type. Last time I dealt with this it had to do with containers and MS not really keeping in line with the STL, and basically the compiler doesn't know how to deal with containers of values of aligned types. But once again, I don't know what this would do to the existing code base, as passing by reference is a notorious sleeper agent for bugs. I'll keep testing and seeing what's up, but it looks pretty promising. It's a total hack, but it hasn't unexpectedly broken yet.

issue building on ios

hey @NickHardeman,
nice addon man!

i had some errors compiling the ios examples.

  • iOS6.1 Base SDK
  • iPhone simulator 5.0
  • Xcode 4.6.3

found this this to work,

  • add the 'libs' folder into ofxBullet addon folder in xcode.
  • remove,
    • ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11
    • ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL

not sure if this is the best solution but it worked for me.

softbody texture on to mesh

thanks for the great add-on.

is it possible to apply a texture to the bunny in the SoftBodyMeshExample?
it would be great to hear your advice on how to achieve that.

thanks, stephan

Compiling for windows/code::blocks, but crashing at startup

Hey,

first of all thanks for your work here. I compiled the bulletlib2.81 without the MultiThreaded and MiniCL parts using codeblocks in windows. I then used the project generator, added ofxBullet, also removed MultiThreaded and MiniCL from search directories and project and compiled an empty project. That worked just fine, just had to change two include paths for glu.h and glut.h. I copied the source from the SimpleExample and tried to run it, but it crashes right on start up. Funny enough: commenting out just the ofxBullet parts in testApp.cpp doesn't change anything. I also had to comment the camera positioning. Using simple of methods like ofSetColor, ofLine, ofBox, ect works just fine though

I think it might not be very ofxBullet specific, but maybe some one has an idea what to try next or how to debug that crash?

thanks in advance!

Bullet3?

Any thoughts on upgrade to Bullet3?

Unknown Error 0x800700c1, Visual Studio 2015

Hey,

I get the following error for each of the examples. Any idea what will help?
I also tried to create the Visual Studio files again with the project generator, but it remains the same..

error

gl matrix function in new oF Version( 0.8.0 )

transformGL() bug when use ofGLProgrammableRender. ( If use this render, all matrix function will not work( eg. glPushMatrix, glMultMatrix, glTranslate, glRotate )

Like:

//--------------------------------------------------------------
void ofxBulletBaseShape::transformGL() {
    btScalar    m[16];
    ofGetOpenGLMatrixFromRigidBody( getRigidBody(), m );

    // not work with ofGLProgrammableRender
    // matrix was calculate in shader
    //glPushMatrix();
    //glMultMatrixf( m );

    // I think is better to use oF Matrix function
    ofPushMatrix();
    ofMultMatrix(ofMatrix4x4(m));
}

//--------------------------------------------------------------
void ofxBulletBaseShape::restoreTramsformGL() {
    //glPopMatrix();
    ofPopMatrix();
}

I think we should use more oF function. :)

Xcode 6.1 "EXC_BAD_ACCESS" with ofxBulletSimpleExample and others

Hi there,
Firstly thank you for creating this project. It looks really awesome.

Unfortunately I'm struggling to run any of the examples included with the library, with the exception of the 'emptyExample' project, which runs fine.

When running the SimpleExample, the project builds and runs, but straight away gives this error:

btMatrix3x3.h
Line 360
Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

screen shot 2014-11-26 at 15 55 35

Googling turns up this forum post...
http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=8514

...But that's as far as I've got. I'm completely stumped by this. Any ideas?

Many thanks,

OF 0.8.4, Xcode 6.1, Mac OS 10.9.5

Problems with 3D models in Android

Hi Nick,

i am experimenting some unexpected results when trying this add-on on Android.

Everything worked fine with the old add-on so i guess it might be related with GL ES 2.

when loading models, in an Android context (it works fine in the desktop version), it looks like the physics are not generated from the mesh (and the model has only one --> it's the oflogo.dae). The model is shown but it goes crazy and keeps moving around the 3D space.

Instead the right 3D model, there is an "invisible" object which determines the physics.

I think there might be some issue with these lines because getNumMeshes() used to return 1, and now returns variable values from -1 to 30k:

for (int i = 0; i < 3; i++) {
logos.push_back( new ofxBulletCustomShape() );
startLoc = ofVec3f( ofRandom(-5, 5), ofRandom(0, -hwidth+5), ofRandom(-5, 5) );

           if(i == 0) {
                   for(int i = 0; i < assimpModel.getNumMeshes(); i++) {
                           logos[i]->addMesh(assimpModel.getMesh(i), scale, true);
                   }
           } else {
                   logos[i]>init( (btCompoundShape*)logos[0]>getCollisionShape(), logos[0]->getCentroid() );
           }
           logos[i]->create( world.world, startLoc, startRot, 3. );
           logos[i]->add();
   }

any ideas?

Doesn't compile with xcode 6

Bad access in btMatrix3x3.h
breaks on line 360 with bad access EXC_1386_GPFLT.
On oF 0.8.4, Xcode 6.0.1, build for 10.7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.