public class BodyImage extends Object
Body
.
The same image can be shared by multiple bodies.
An image is attached to a body by creating an AttachedImage
,
which provides the ability to scale, translate, rotate and flip images.
By default the image is displayed in full, which usually requires
an image having a transparent background, with the visible part
approximating the shape of the simulated body; alternatively,
a body may be configured to clip images to its outline.Body.setClipped(boolean)
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_HEIGHT
Default height of an image: 1 metre.
|
Constructor and Description |
---|
BodyImage(String fileName)
Create a new image from an image file with the default height.
|
BodyImage(String fileName,
float height)
Create a new image from an image file.
|
BodyImage(URL url)
Create a new image from an image file with the default height.
|
BodyImage(URL url,
float height)
Create a new image from an image file.
|
public static final float DEFAULT_HEIGHT
public BodyImage(String fileName)
fileName
- the image file namepublic BodyImage(String fileName, float height)
fileName
- the image file nameheight
- height of the image (in metres)public BodyImage(URL url)
url
- the image file urlpublic BodyImage(URL url, float height)
url
- the image file urlheight
- height of the image (in metres)