Package com.bulletphysics.collision.dispatch

Examples of com.bulletphysics.collision.dispatch.CollisionObject


  @Override
  public void clearForces() {
    // todo: iterate over awake simulation islands!
    for (int i = 0; i < collisionObjects.size(); i++) {
      CollisionObject colObj = collisionObjects.getQuick(i);

      RigidBody body = RigidBody.upcast(colObj);
      if (body != null) {
        body.clearForces();
      }
View Full Code Here


   * Apply gravity, call this once per timestep.
   */
  public void applyGravity() {
    // todo: iterate over awake simulation islands!
    for (int i = 0; i < collisionObjects.size(); i++) {
      CollisionObject colObj = collisionObjects.getQuick(i);

      RigidBody body = RigidBody.upcast(colObj);
      if (body != null && body.isActive()) {
        body.applyGravity();
      }
View Full Code Here

    Vector3f tmpLinVel = Stack.alloc(Vector3f.class);
    Vector3f tmpAngVel = Stack.alloc(Vector3f.class);

    // todo: iterate over awake simulation islands!
    for (int i = 0; i < collisionObjects.size(); i++) {
      CollisionObject colObj = collisionObjects.getQuick(i);

      RigidBody body = RigidBody.upcast(colObj);
      if (body != null && body.getMotionState() != null && !body.isStaticOrKinematicObject()) {
        // we need to call the update at least once, even for sleeping objects
        // otherwise the 'graphics' transform never updates properly
View Full Code Here

  @Override
  public void setGravity(Vector3f gravity) {
    this.gravity.set(gravity);
    for (int i = 0; i < collisionObjects.size(); i++) {
      CollisionObject colObj = collisionObjects.getQuick(i);
      RigidBody body = RigidBody.upcast(colObj);
      if (body != null) {
        body.setGravity(gravity);
      }
    }
View Full Code Here

    BulletStats.pushProfile("updateActivationState");
    try {
      Vector3f tmp = Stack.alloc(Vector3f.class);

      for (int i=0; i<collisionObjects.size(); i++) {
        CollisionObject colObj = collisionObjects.getQuick(i);
        RigidBody body = RigidBody.upcast(colObj);
        if (body != null) {
          body.updateDeactivation(timeStep);

          if (body.wantsSleeping()) {
View Full Code Here

  }
 
  private static int getConstraintIslandId(TypedConstraint lhs) {
    int islandId;

    CollisionObject rcolObj0 = lhs.getRigidBodyA();
    CollisionObject rcolObj1 = lhs.getRigidBodyB();
    islandId = rcolObj0.getIslandTag() >= 0 ? rcolObj0.getIslandTag() : rcolObj1.getIslandTag();
    return islandId;
  }
View Full Code Here

      Vector3f tmp = Stack.alloc(Vector3f.class);
      Transform tmpTrans = Stack.alloc(Transform.class);

      Transform predictedTrans = Stack.alloc(Transform.class);
      for (int i=0; i<collisionObjects.size(); i++) {
        CollisionObject colObj = collisionObjects.getQuick(i);
        RigidBody body = RigidBody.upcast(colObj);
        if (body != null) {
          body.setHitFraction(1f);

          if (body.isActive() && (!body.isStaticOrKinematicObject())) {
View Full Code Here

    BulletStats.pushProfile("predictUnconstraintMotion");
    try {
      Transform tmpTrans = Stack.alloc(Transform.class);
     
      for (int i = 0; i < collisionObjects.size(); i++) {
        CollisionObject colObj = collisionObjects.getQuick(i);
        RigidBody body = RigidBody.upcast(colObj);
        if (body != null) {
          if (!body.isStaticOrKinematicObject()) {
            if (body.isActive()) {
              body.integrateVelocities(timeStep);
View Full Code Here

      // don't do CCD when the collision filters are not matching
      if (!super.needsCollision(proxy0)) {
        return false;
      }

      CollisionObject otherObj = (CollisionObject)proxy0.clientObject;

      // call needsResponse, see http://code.google.com/p/bullet/issues/detail?id=179
      if (dispatcher.needsResponse(me, otherObj)) {
        // don't do CCD when there are already contact points (touching contact/penetration)
        ObjectArrayList<PersistentManifold> manifoldArray = new ObjectArrayList<PersistentManifold>();
View Full Code Here

  protected void predictUnconstraintMotion(float timeStep) {
    Transform tmpTrans = Stack.alloc(Transform.class);
   
    for (int i = 0; i < collisionObjects.size(); i++) {
      CollisionObject colObj = collisionObjects.getQuick(i);
      RigidBody body = RigidBody.upcast(colObj);
      if (body != null) {
        if (!body.isStaticObject()) {
          if (body.isActive()) {
            body.applyGravity();
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.dispatch.CollisionObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.