Examples of InertiaMatrix


Examples of jinngine.math.InertiaMatrix

      this.force = new BallInSocketJoint(target, controller, controller.getPosition(), new Vector3(0,1,0));
      this.force.setForceLimit(1.5*target.getMass());
      this.force.setCorrectionVelocityLimit(7);
     
      // copy angular mass properties
      inertia = new InertiaMatrix(target.state.inertia);
      inverse = new InertiaMatrix(target.state.inverseinertia);

      // mute angular movement
      target.state.inverseinertia.assignZero();
     
      // remove current movement
View Full Code Here

Examples of jinngine.math.InertiaMatrix

    // perform approximate mass calculation
    MassProperties masscalculation = new MassProperties( this, 0.05 );
   
    // set propperties
    mass = referenceMass = masscalculation.getMass();
    inertiamatrix = new InertiaMatrix(masscalculation.getInertiaMatrix());
    centreOfMass = masscalculation.getCentreOfMass();

    // align all vertices and faces to centre of mass coordinates
    for ( Vector3 p: vertices)
      Vector3.add( p, centreOfMass.multiply(-1) );
View Full Code Here

Examples of jinngine.math.InertiaMatrix

  }

  @Override
  public InertiaMatrix getInertialMatrix() {
    // scale the inertia matrix in the specified mass and reference mass ratio
    return new InertiaMatrix(inertiamatrix.multiply( mass / referenceMass ));
  }
View Full Code Here

Examples of jinngine.math.InertiaMatrix

//        if(testInclusion(xmax, xmin, ymax, ymin, zmax, zmin) || depth > 3 ) {
          //        System.out.println("small or included");
          totalmass = totalmass + localmass;

        // inertia matrix for this local box
        InertiaMatrix localinertia = new InertiaMatrix();
        localinertia.assignScale(
                                        (1.0f / 12.0f) * localmass * (yl * yl + zl * zl),
                                        (1.0f / 12.0f) * localmass * (xl * xl + zl * zl),
                                        (1.0f / 12.0f) * localmass * (yl * yl + xl * xl));

          // translate inertia matrix
View Full Code Here

Examples of jinngine.math.InertiaMatrix

   
//    System.out.println("capsule mass="+uniformmass);

    // angular inertia (for a cylinder for now) TODO
    final double Ixx = uniformmass*(1/12.0)*(3*radius*radius+length*length);
    this.inertia = new InertiaMatrix();
    this.inertia.assignScale( Ixx, Ixx, 0.5*uniformmass*radius*radius);
  }
View Full Code Here

Examples of jinngine.math.InertiaMatrix

  }
 
  @Override
  public InertiaMatrix getInertialMatrix() {
    //Inertia tensor for the sphere.
    InertiaMatrix I = new InertiaMatrix();
                I.assignScale((2/5f)*mass*radius*radius);
    return I;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.