| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
LOG |
| Constructor and Description |
|---|
PhysicWorld() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAction(IAction action) |
boolean |
addCollisionObject(CollisionObject collisionObject) |
boolean |
addConstraint(Constraint constraint) |
boolean |
addController(IController controller) |
static void |
assertIndex(int index,
int length) |
static void |
assertNotNull(long objectId) |
static void |
assertNotNull(java.lang.Object object) |
static void |
assertRange(float value,
float min,
float max) |
static void |
assertRange(int value,
int min,
int max) |
protected static void |
assertResult(java.lang.Object object) |
TestResult |
closestConvexSweepTest(CollisionShape collisionShape,
Transform convexFromWorld,
Transform convexToWorld)
From Bullet
convexTest performs a swept convex cast on all objects in the PhysicWorld, and calls the resultCallback
This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback. |
TestResult |
closestRayTest(Vec3 rayFromWorld,
Vec3 rayToWorld) |
void |
contactPairTest(CollisionObject collisionObjectA,
CollisionObject collisionObjectB,
IContactPointCallback callback)
From Bullet
contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected. |
void |
contactPoints(IContactPointCallback callback) |
void |
contactTest(CollisionObject collisionObject,
IContactPointCallback callback)
From Bullet
contactTest performs a discrete collision test between colObj against all objects in the PhysicWorld, and calls the resultCallback. |
static ConvexDecomposition |
convexDecomposition(GeometryData geometry,
ConvexDecomposition.HACD params)
Convex decomposition using HACD algorithm
|
static ConvexDecomposition |
convexDecomposition(GeometryData geometry,
ConvexDecomposition.VHACD params)
Convex decomposition using VHACD algorithm for manifold closed meshes
|
void |
convexSweepTest(CollisionShape collisionShape,
Transform convexFromWorld,
Transform convexToWorld,
ITestResultCallback callback)
From Bullet
convexTest performs a swept convex cast on all objects in the PhysicWorld, and calls the resultCallback
This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback. |
CollisionShape |
createBoxCollisionShape(Vec3 boxSize) |
CollisionShape |
createBvhTriangleCollisionShape(GeometryData geometry) |
CollisionShape |
createCapsuleCollisionShape(float height,
float radius) |
CollisionShape |
createCompoundShape() |
CollisionShape |
createConvexHullCollisionShape(Vec3Array vertices) |
CollisionShape |
createCylinderCollisionShape(float height,
float radius) |
GhostObject |
createGhostObject(CollisionShape shape) |
CollisionShape |
createPlaneCollisionShape(Plane plane) |
RigidBody |
createRigidBody(CollisionShape shape,
Transform t,
float mass) |
RigidBody |
createRigidBody(CollisionShape shape,
Transform t,
float mass,
boolean inertia) |
SoftBody |
createSoftBody(AsyncModel asyncModel,
Transform modelTransform,
OnLoadListener<SoftBody> onLoadInit)
Restriction on Model used with physic:
Transform: Model/Mesh transform is not usable Hierarchy: child mesh and model is ignored by physic |
SoftBody |
createSoftBody(Model model) |
CollisionShape |
createSphereCollisionShape(float radius) |
void |
destroy()
Destroy this
PhysicWorld |
void |
destroyCollisionObject(CollisionObject collisionObject) |
protected static java.nio.ByteBuffer |
faceBuffer(Faces faces) |
protected void |
finalize() |
protected Constraint[] |
getConstraints(RigidBody rigidBody) |
protected long |
getDynamicsWorldId() |
int |
getPhysicFixedFps() |
SoftBodyWorldInfo |
getSoftBodyWorldInfo() |
static boolean |
isAvailable() |
static GeometryData |
meshDecimator(GeometryData geometry,
int numTrianglesDecimatedMesh) |
static Vec3Array |
optimizeConvexHull(Vec3Array points,
boolean decimation) |
void |
rayTest(Vec3 rayFromWorld,
Vec3 rayToWorld,
ITestResultCallback callback)
From Bullet:
rayTest performs a raycast on all objects in the PhysicWorld, and calls the resultCallback
This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. |
boolean |
removeAction(IAction action) |
boolean |
removeCollisionObject(CollisionObject collisionObject) |
boolean |
removeConstraint(Constraint constraint) |
void |
removeConstraints(CollisionObject collisionObject) |
boolean |
removeController(IController controller) |
void |
setPhysicFixedFps(int physicFps) |
void |
setStepListener(IStepListener stepListener) |
void |
update(long timePassedMS)
Update this
PhysicWorld |
void |
updateBoxCollisionShape(CollisionShape boxShape,
Vec3 boxSize) |
void |
updateCapsuleCollisionShape(CollisionShape capsuleShape,
float height,
float radius) |
void |
updateChilds(CollisionShape compoundShape,
ConvexDecomposition convexDecomposition) |
void |
updateChildTransform(CollisionShape compoundShape,
int index,
Transform src) |
void |
updateCylinderCollisionShape(CollisionShape cylinderShape,
float height,
float radius) |
void |
updateSphereCollisionShape(CollisionShape sphereShape,
float radius) |
protected static java.nio.ByteBuffer |
vertex3Buffer(Vec3Array vec3Array) |
protected static final boolean LOG
public static final boolean isAvailable()
public final void setStepListener(IStepListener stepListener)
public final void destroy()
PhysicWorldprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected final long getDynamicsWorldId()
public final SoftBodyWorldInfo getSoftBodyWorldInfo()
public final CollisionShape createBoxCollisionShape(Vec3 boxSize)
public final CollisionShape createSphereCollisionShape(float radius)
public final CollisionShape createCylinderCollisionShape(float height, float radius)
public final CollisionShape createCapsuleCollisionShape(float height, float radius)
public final CollisionShape createConvexHullCollisionShape(Vec3Array vertices)
vertices - optimizeConvexHull(Vec3Array, boolean)public final CollisionShape createBvhTriangleCollisionShape(GeometryData geometry)
public final CollisionShape createPlaneCollisionShape(Plane plane)
public final CollisionShape createCompoundShape()
public final void updateBoxCollisionShape(CollisionShape boxShape, Vec3 boxSize)
public final void updateSphereCollisionShape(CollisionShape sphereShape, float radius)
public final void updateCylinderCollisionShape(CollisionShape cylinderShape, float height, float radius)
public final void updateCapsuleCollisionShape(CollisionShape capsuleShape, float height, float radius)
public final void updateChildTransform(CollisionShape compoundShape, int index, Transform src)
public final void updateChilds(CollisionShape compoundShape, ConvexDecomposition convexDecomposition)
public final RigidBody createRigidBody(CollisionShape shape, Transform t, float mass)
shape - a CollisionShapet - start transform, required (not null)mass - mass of the rigid body: 0 for static, non 0 for dynamic (body with inertia)addCollisionObject(CollisionObject),
destroyCollisionObject(CollisionObject)public final RigidBody createRigidBody(CollisionShape shape, Transform t, float mass, boolean inertia)
public SoftBody createSoftBody(AsyncModel asyncModel, Transform modelTransform, OnLoadListener<SoftBody> onLoadInit)
asyncModel - an AsyncModel to apply physic onmodelTransform - SoftBody's model instance Transform, optionalonLoadInit - listener called when the SoftBody physic geometry is initialized, optionalSoftBodypublic final GhostObject createGhostObject(CollisionShape shape)
shape - a CollisionShapet - start transform, required (not null)addCollisionObject(CollisionObject),
destroyCollisionObject(CollisionObject)public final boolean addCollisionObject(CollisionObject collisionObject)
collisionObject - CollisionObject to addPhysicWorldremoveCollisionObject(CollisionObject)public final boolean removeCollisionObject(CollisionObject collisionObject)
collisionObject - CollisionObject to removejava.lang.IllegalStateException - if collisionObject is a RigidBody with Constraintpublic final void destroyCollisionObject(CollisionObject collisionObject)
collisionObject - CollisionObject to (removed and) destroypublic final boolean addAction(IAction action) throws java.lang.IllegalArgumentException
action - IAction to addPhysicWorldjava.lang.IllegalArgumentExceptionpublic final boolean removeAction(IAction action)
public final boolean addConstraint(Constraint constraint)
constraint - Constraint to addPhysicWorldjava.lang.IllegalStateException - if a RigidBody of the Constraint was not addedpublic final boolean removeConstraint(Constraint constraint)
public final void removeConstraints(CollisionObject collisionObject)
protected final Constraint[] getConstraints(RigidBody rigidBody)
public final boolean addController(IController controller)
controller - IController to addPhysicWorldpublic final boolean removeController(IController controller)
public final int getPhysicFixedFps()
public final void setPhysicFixedFps(int physicFps)
public final void update(long timePassedMS)
PhysicWorldtimePassedMS - time passed in milli-secondspublic final void rayTest(Vec3 rayFromWorld, Vec3 rayToWorld, ITestResultCallback callback)
PhysicWorld, and calls the resultCallback
This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.dst - destination to store ray test resultrayFromWorld - rayToWorld - public final TestResult closestRayTest(Vec3 rayFromWorld, Vec3 rayToWorld)
#nConvexSweepTest(Array, ConvexShape, Transform, Transform)public final void convexSweepTest(CollisionShape collisionShape, Transform convexFromWorld, Transform convexToWorld, ITestResultCallback callback)
PhysicWorld, and calls the resultCallback
This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.public final TestResult closestConvexSweepTest(CollisionShape collisionShape, Transform convexFromWorld, Transform convexToWorld)
PhysicWorld, and calls the resultCallback
This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.#nConvexSweepTest(Array, ConvexShape, Transform, Transform)public final void contactTest(CollisionObject collisionObject, IContactPointCallback callback)
PhysicWorld, and calls the resultCallback.
it reports one or more contact points for every overlapping object (including the one with deepest penetration)collisionObject - callback - public final void contactPairTest(CollisionObject collisionObjectA, CollisionObject collisionObjectB, IContactPointCallback callback)
collisionObjectA - collisionObjectB - callback - public final void contactPoints(IContactPointCallback callback)
public static final Vec3Array optimizeConvexHull(Vec3Array points, boolean decimation)
points - src set of pointsdecimation - true to apply an additional hull decimationpublic static final GeometryData meshDecimator(GeometryData geometry, int numTrianglesDecimatedMesh)
public static final ConvexDecomposition convexDecomposition(GeometryData geometry, ConvexDecomposition.HACD params)
geometry - a GeometryData to decomposeparams - parameters of the convex decompositionpublic static final ConvexDecomposition convexDecomposition(GeometryData geometry, ConvexDecomposition.VHACD params)
geometry - a GeometryData to decomposeparams - parameters of the convex decompositionprotected static final java.nio.ByteBuffer faceBuffer(Faces faces)
protected static final java.nio.ByteBuffer vertex3Buffer(Vec3Array vec3Array)
public static final void assertNotNull(long objectId)
public static final void assertNotNull(java.lang.Object object)
public static final void assertIndex(int index,
int length)
public static final void assertRange(int value,
int min,
int max)
public static final void assertRange(float value,
float min,
float max)
protected static final void assertResult(java.lang.Object object)
throws java.lang.RuntimeException
java.lang.RuntimeExceptionBonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com