Class GenesisWorld

java.lang.Object
org.episteme.nativ.physics.classical.mechanics.collision.backends.genesis.GenesisWorld
All Implemented Interfaces:
PhysicsWorldBridge

public class GenesisWorld extends Object implements PhysicsWorldBridge
Genesis implementation of PhysicsWorldBackend. Specialized for many-body systems. Uses the JDK Vector API (SIMD) to accelerate the Euler-Cromer integration loop over flat double arrays.
  • Constructor Details

    • GenesisWorld

      public GenesisWorld()
  • Method Details

    • addRigidBody

      public void addRigidBody(RigidBody body)
      Description copied from interface: PhysicsWorldBridge
      Adds a rigid body to the simulation.
      Specified by:
      addRigidBody in interface PhysicsWorldBridge
      Parameters:
      body - the body to add
    • removeRigidBody

      public void removeRigidBody(RigidBody body)
      Description copied from interface: PhysicsWorldBridge
      Removes a rigid body from the simulation.
      Specified by:
      removeRigidBody in interface PhysicsWorldBridge
      Parameters:
      body - the body to remove
    • stepSimulation

      public void stepSimulation(Quantity<Time> timeStep)
      Description copied from interface: PhysicsWorldBridge
      Steps the simulation forward in time.
      Specified by:
      stepSimulation in interface PhysicsWorldBridge
      Parameters:
      timeStep - the amount of time to simulate
    • stepSimulation

      public void stepSimulation(Quantity<Time> timeStep, int maxSubSteps, Quantity<Time> fixedTimeStep)
      Description copied from interface: PhysicsWorldBridge
      Steps the simulation with fixed time steps and max substeps.
      Specified by:
      stepSimulation in interface PhysicsWorldBridge
      Parameters:
      timeStep - the amount of time to simulate
      maxSubSteps - maximum number of internal substeps
      fixedTimeStep - the internal fixed time step
    • setGravity

      public void setGravity(double gravityX, double gravityY, double gravityZ)
      Description copied from interface: PhysicsWorldBridge
      Sets the gravity vector for the world.
      Specified by:
      setGravity in interface PhysicsWorldBridge
      Parameters:
      gravityX - gravity in X
      gravityY - gravity in Y
      gravityZ - gravity in Z