fulcrum's People
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.