Cubism SDK‎ > ‎Frameworks‎ > ‎

A Setting File of the Physics Computation


This is an explanation about how to embed the physics computation automatically using the setting file.
Refer to the library tutorial video about the physics computation.

L2DPhysics class

This is a wrapper class to treat the physics computation of the Live2D library easily.
You can set the physics computation without using it.
Load the JSON file by the load method of the L2DPhysics class.
The Motion Parameter will be applied to the model if you invoke the update method when updating.

static L2DPhysics load( byte[] buf )
It loads the setting file and return the setting instance.
It basically loads from the byte array, however it may be overloaded to be used by each platform easily.
For example, you can load it from the InputStream pattern in the same method with Java version.

void updateParam( ALive2DModel model )
Apply the change for the model.
Change the Motion Parameter according to the setting.
You need to invoke it for each frame.

JSON setting files

The setting file is written in JSON format.
Therefore, it is easy to check it using a text editor or to expand the specification.


サブページ (2): json sample