Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 28, 2015, 11:55:18 PM (10 years ago)
Author:
landauf
Message:

added bullet settings for CCD (continuous collision detection) to WorldEntity. initially I thought we need this to avoid the tunneling effect of projectiles at low FPS, but now it turns out that this gets also fixed if projectiles use dynamic physics. I still add the new settings to WorldEntity because we may still need them for very fast objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r10274 r10288  
    9898        this->collisionType_             = None;
    9999        this->collisionTypeSynchronised_ = None;
    100         this->mass_           = 1.0f;
    101         this->childrenMass_   = 0;
     100        this->mass_                 = 1.0f;
     101        this->childrenMass_         = 0;
    102102        // Using bullet default values
    103         this->restitution_    = 0;
    104         this->angularFactor_  = 1;
    105         this->linearDamping_  = 0;
    106         this->angularDamping_ = 0;
    107         this->friction_       = 0.5;
     103        this->restitution_          = 0;
     104        this->angularFactor_        = 1;
     105        this->linearDamping_        = 0;
     106        this->angularDamping_       = 0;
     107        this->friction_             = 0.5;
     108        this->ccdMotionThreshold_   = 0.0;
     109        this->ccdSweptSphereRadius_ = 0.0;
    108110        this->bCollisionCallbackActive_ = false;
    109111        this->bCollisionResponseActive_ = true;
     
    198200        registerVariable(this->angularDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));
    199201        registerVariable(this->friction_,       VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));
     202        registerVariable(this->ccdMotionThreshold_,
     203                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::ccdMotionThresholdChanged));
     204        registerVariable(this->ccdSweptSphereRadius_,
     205                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::ccdSweptSphereRadiusChanged));
    200206        registerVariable(this->bCollisionCallbackActive_,
    201207                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged));
     
    10031009            this->physicalBody_->setDamping(this->linearDamping_, this->angularDamping_);
    10041010            this->physicalBody_->setFriction(this->friction_);
     1011            this->physicalBody_->setCcdMotionThreshold(this->ccdMotionThreshold_);
     1012            this->physicalBody_->setCcdSweptSphereRadius(this->ccdSweptSphereRadius_);
    10051013        }
    10061014    }
Note: See TracChangeset for help on using the changeset viewer.