Code Monkey home page Code Monkey logo

fulcrum's People

Contributors

james-z avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

fulcrum's Issues

rbd->applyTorque( btVector3() ) does not work

_rigid_body->applyTorque( btVector3() ) does not work in "_object_base.cpp", I googled it and tried every thing I could do and but the problem is still,anyone could help this?
applyCentralForce() is working all the time, and applyAngularVelocity() is also working.
the code in _object_base.cpp row 56 :

void _object_base::apply_physics (void) {
/* _rigid_body->applyCentralImpulse( _force ); _/
_rigid_body->setAngularFactor( 1.0F );
_rigid_body->setLinearFactor( btVector3(1.0F, 1.0 ,1.0) );
_rigid_body->updateInertiaTensor();
std::cout<<_angular.getY();
_rigid_body->applyCentralForce( _force );
_rigid_body->applyTorque( angular );
/
_rigid_body->setLinearVelocity( _force ); /
/
_rigid_body->setAngularVelocity( _angular ); */
}

void _object_base::move_and_turn ( const int state ) {
_state = state;
if( state == MOTION_STATE::FORWORD ) {
_force = btVector3( 0.0F, 0.0F, -10.5F );
_force = _rigid_body->getWorldTransform().getBasis() * _force;
} else if( state == BACKWARD ) {
_force = btVector3( 0.0F, 0.0F, 10.0F );
_force = _rigid_body->getWorldTransform().getBasis() * _force;
} else if( state == MOTION_STATE::CLOCK_WISE_ROTATION ) {
_angular = btVector3( 0.0F, 100.0F, 0.0F );
_angular = _rigid_body->getWorldTransform().getBasis() * _angular;
} else if( state == MOTION_STATE::ANTI_CLOCK_WISE_ROTATION ) {
_angular = btVector3( 0.0F, -100.0F, 0.0F );
_angular = _rigid_body->getWorldTransform().getBasis() * _angular;
} else if( state == MOTION_STATE::STOP ) {
_force = btVector3( 0.0F, 0.0F, 0.0F );
_angular = btVector3( 0.0F, 0.0F, 0.0F );
} else {
/* _angular = btVector3( 0.0F, 0.0F, 0.0F ); /
/
_force = btVector3( 0.0F, 0.0F, 0.0F ); /
/
std::cout<<"else"<<std::endl; */
}
}

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.