Changeset 528 for trunk/src


Ignore:
Timestamp:
11/09/16 01:07:34 (9 years ago)
Author:
epyon
Message:
  • physics updates
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bullet/bullet_world.cc

    r527 r528  
    140140}
    141141
     142void nv::bullet_world::set_local_scaling( collision_shape shape, const vec3& value )
     143{
     144        btCollisionShape* sh = static_cast<btCollisionShape*>( shape.internal );
     145        sh->setLocalScaling( n2b( value ) );
     146}
     147
     148vec3 nv::bullet_world::get_local_scaling( collision_shape shape )
     149{
     150        btCollisionShape* sh = static_cast<btCollisionShape*>( shape.internal );
     151        return b2n( sh->getLocalScaling() );
     152}
     153
    142154constraint nv::bullet_world::create_hinge_constraint( rigid_body a, const transform& ta, rigid_body b, const transform& tb, const vec2& low_high, const vec3& params /*= vec3( 0.9f, 0.3f, 1.0f ) */ )
    143155{
     
    203215        rb->setCcdMotionThreshold( threshold );
    204216        rb->setCcdSweptSphereRadius( radius );
     217}
     218
     219vec3 nv::bullet_world::get_rigid_body_linear_velocity( rigid_body body )
     220{
     221        btRigidBody* rb = static_cast<btRigidBody*>( body.internal );
     222        return b2n( rb->getLinearVelocity() );
     223}
     224
     225void nv::bullet_world::apply_central_impulse( rigid_body body, const vec3& impulse )
     226{
     227        btRigidBody* rb = static_cast<btRigidBody*>( body.internal );
     228        rb->applyCentralImpulse( n2b( impulse ) );
     229        rb->forceActivationState( ACTIVE_TAG );
    205230}
    206231
Note: See TracChangeset for help on using the changeset viewer.