APIdia Launch Partner
Top Inners Fields Constructors Methods
com.badlogic.gdx.physics.bullet

public Class Bullet

extends Object
Class Inheritance
Imports
java.util.Arrays, com.badlogic.gdx.graphics.g3d.model.MeshPart, .Node, com.badlogic.gdx.math.Matrix4, com.badlogic.gdx.physics.bullet.collision.btBvhTriangleMeshShape, .btCollisionShape, .btCompoundShape, com.badlogic.gdx.physics.bullet.linearmath.LinearMath, .LinearMathConstants, com.badlogic.gdx.utils.Array, .GdxRuntimeException, .Pool, .SharedLibraryLoader

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
protected static boolean
private static final Matrix4
private static final Array<Bullet.ShapePart>
private static final Pool<Bullet.ShapePart>
private static final Matrix4
protected static boolean
public static final int
VERSION

The version of the Bullet library used by this wrapper.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
getShapeParts(final Node node, final boolean applyTransform, final Array<Bullet.ShapePart> out, final int offset, final Pool<Bullet.ShapePart> pool)

public static <T extends Node> void
getShapeParts(final Iterable<T> nodes, final Array<Bullet.ShapePart> out, final int offset, final Pool<Bullet.ShapePart> pool)

public static void
init()

Loads the native Bullet native library and initializes the gdx-bullet extension.

public static void
init(boolean
Whether to use reference counting, causing object to be destroyed when no longer referenced. You must use BulletBase#obtain() and BulletBase#release() when using reference counting.
useRefCounting
)

Loads the native Bullet native library and initializes the gdx-bullet extension.

public static void
init(boolean
Whether to use reference counting, causing object to be destroyed when no longer referenced. You must use BulletBase#obtain() and BulletBase#release() when using reference counting.
useRefCounting
,
boolean
Whether to log an error on potential errors in the application.
logging
)

Loads the native Bullet native library and initializes the gdx-bullet extension.

public static btCollisionShape
obtainStaticNodeShape(final Node node, final boolean applyTransform)

public static btCollisionShape

Returns:

The obtained shape, if you're using reference counting then you can release the shape when no longer needed.
obtainStaticNodeShape
(final Array<Node>
The nodes for which to obtain a node, typically this would be: `model.nodes`.
nodes
)

Obtain a btCollisionShape based on the specified nodes, which can be used for a static body but not for a dynamic body.

public static btCollisionShape
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

enableLoggingback to summary
protected static boolean enableLogging
idtback to summary
private static final Matrix4 idt
shapePartArrayback to summary
private static final Array<Bullet.ShapePart> shapePartArray
shapePartPoolback to summary
private static final Pool<Bullet.ShapePart> shapePartPool
tmpMback to summary
private static final Matrix4 tmpM
useRefCountingback to summary
protected static boolean useRefCounting
VERSIONback to summary
public static final int VERSION

The version of the Bullet library used by this wrapper.

Constructor Detail

Bulletback to summary
public Bullet()

Method Detail

getShapePartsback to summary
public static void getShapeParts(final Node node, final boolean applyTransform, final Array<Bullet.ShapePart> out, final int offset, final Pool<Bullet.ShapePart> pool)
getShapePartsback to summary
public static <T extends Node> void getShapeParts(final Iterable<T> nodes, final Array<Bullet.ShapePart> out, final int offset, final Pool<Bullet.ShapePart> pool)
initback to summary
public static void init()

Loads the native Bullet native library and initializes the gdx-bullet extension. Must be called before any of the bullet classes/methods can be used.

initback to summary
public static void init(boolean useRefCounting)

Loads the native Bullet native library and initializes the gdx-bullet extension. Must be called before any of the bullet classes/methods can be used.

Parameters
useRefCounting:boolean

Whether to use reference counting, causing object to be destroyed when no longer referenced. You must use BulletBase#obtain() and BulletBase#release() when using reference counting.

initback to summary
public static void init(boolean useRefCounting, boolean logging)

Loads the native Bullet native library and initializes the gdx-bullet extension. Must be called before any of the bullet classes/methods can be used.

Parameters
useRefCounting:boolean

Whether to use reference counting, causing object to be destroyed when no longer referenced. You must use BulletBase#obtain() and BulletBase#release() when using reference counting.

logging:boolean

Whether to log an error on potential errors in the application.

obtainStaticNodeShapeback to summary
public static btCollisionShape obtainStaticNodeShape(final Node node, final boolean applyTransform)
obtainStaticNodeShapeback to summary
public static btCollisionShape obtainStaticNodeShape(final Array<Node> nodes)

Obtain a btCollisionShape based on the specified nodes, which can be used for a static body but not for a dynamic body. Depending on the specified nodes the result will be either a btBvhTriangleMeshShape or a btCompoundShape of multiple btBvhTriangleMeshShape's. Where possible, the same btBvhTriangleMeshShape will be reused if multiple nodes use the same (mesh) part. The node transformation (translation and rotation) will be included, but scaling will be ignored.

Parameters
nodes:Array<Node>

The nodes for which to obtain a node, typically this would be: `model.nodes`.

Returns:btCollisionShape

The obtained shape, if you're using reference counting then you can release the shape when no longer needed.

obtainStaticShapeback to summary
public static btCollisionShape obtainStaticShape(final Array<Bullet.ShapePart> parts)
com.badlogic.gdx.physics.bullet back to summary

protected Class Bullet.ShapePart

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public Array<MeshPart>
public Matrix4

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

partsback to summary
public Array<MeshPart> parts
transformback to summary
public Matrix4 transform

Constructor Detail

ShapePartback to summary
protected ShapePart()