/** Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCapsule (float radius, float height, int divisions, final Material material, final long attributes) { return createCapsule(radius, height, divisions, GL20.GL_TRIANGLES, material, attributes); }
/** Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCapsule (float radius, float height, int divisions, final Material material, final long attributes) { return createCapsule(radius, height, divisions, GL20.GL_TRIANGLES, material, attributes); }
protected Model createCapsuleModel (float radius, float height) { final Model result = modelBuilder.createCapsule(radius, height + radius * 2f, 16, new Material(ColorAttribute.createDiffuse(Color.WHITE), ColorAttribute.createSpecular(Color.WHITE)), Usage.Position | Usage.Normal); disposables.add(result); return result; } }
final Material material = new Material(TextureAttribute.createDiffuse(texture), ColorAttribute.createSpecular(1,1,1,1), FloatAttribute.createShininess(8f)); final long attributes = Usage.Position | Usage.Normal | Usage.TextureCoordinates; final Model capsule = modelBuilder.createCapsule(2f, 6f, 16, material, attributes); disposables.add(capsule); world.addConstructor("capsule", new BulletConstructor(capsule, null));
world.addConstructor("cylinder", new BulletConstructor(cylinder, 10f, new btCylinderShape(tmpV1.set(2f, 3f, 2f)))); final Model capsule = modelBuilder.createCapsule(2f, 6f, 16, material, attributes); disposables.add(capsule); world.addConstructor("capsule", new BulletConstructor(capsule, 10f, new btCapsuleShape(2f, 2f)));
/** Convenience method to create a model with a single node containing a capsule shape. The resources the Material might contain * are not managed, use {@link Model#manageDisposable(Disposable)} to add those to the model. * @param attributes bitwise mask of the {@link com.badlogic.gdx.graphics.VertexAttributes.Usage}, only Position, Color, Normal * and TextureCoordinates is supported. */ public Model createCapsule (float radius, float height, int divisions, final Material material, final long attributes) { return createCapsule(radius, height, divisions, GL20.GL_TRIANGLES, material, attributes); }