All Downloads are FREE. Search and download functionalities are using the official Maven repository.

us.ihmc.simulationconstructionset.physics.CollisionShapeDescription Maven / Gradle / Ivy

There is a newer version: 0.25.2
Show newest version
package us.ihmc.simulationconstructionset.physics;

import us.ihmc.euclid.geometry.BoundingBox3D;
import us.ihmc.euclid.transform.RigidBodyTransform;
import us.ihmc.euclid.tuple3D.Point3D;
import us.ihmc.euclid.tuple3D.Vector3D;

/**
 * Description of the collision shape. The same description can be linked to multiple objects
 * ({@link us.ihmc.simulationconstructionset.Link}) to conserve memory. For example, you could
 * create a description for a standard brick then add 10000 of them to the scene.
 */
public interface CollisionShapeDescription>
{
   public abstract void setFrom(T collisionShapeDescription);

   public abstract void applyTransform(RigidBodyTransform transformToWorld);

   public abstract CollisionShapeDescription copy();

   public abstract void getBoundingBox(BoundingBox3D boundingBoxToPack);

   public abstract boolean isPointInside(Point3D pointInWorld);

   /**
    * Moves the given pointToRoll to where it would be if this shape was rolling over a surface with
    * the given surfaceNormal.
    * 
    * @param surfaceNormal Surface normal of the surface this shape is rolling over.
    * @param pointToRoll   Point to move to account for rolling.
    * @return true if the shape did roll. Else return false.
    */
   public abstract boolean rollContactIfRolling(Vector3D surfaceNormal, Point3D pointToRoll);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy