Game Development Reference
In-Depth Information
final btRigidBodyConstructionInfo bodyInfo;
public UserData(ModelInstance instance, btMotionState
motionState, btRigidBodyConstructionInfo bodyInfo,
btRigidBody body) {
this.instance = instance;
this.motionState = motionState;
this.bodyInfo = bodyInfo;
this.body = body;
data.add(this);
}
public btRigidBody getBody() {
return body;
}
public ModelInstance getInstance() {
return this.instance;
}
public boolean isVisible(Camera cam) {
return
cam.frustum.pointInFrustum(instance.transform.
getTranslation(temp));
}
@Override
public void dispose() {
if (motionState != null) {
motionState.dispose();
}
bodyInfo.dispose();
body.dispose();
data.removeValue(this, true);
Gdx.app.log(this.getClass().getName(), " Rigid
body removed and disposed.");
}
}
All the user data created is stored in the static array data declared at the beginning of
this class.
 
Search WWH ::




Custom Search