fromDict static method
Restore this object from the dictionary.
src
: A dictionary made with toDict of this class.
Implementation
static Sp3dFragment fromDict(Map<String, dynamic> src) {
List<Sp3dFace> f = [];
for (var i in src['faces']) {
f.add(Sp3dFace.fromDict(i));
}
// after version 5.
bool mIsTouchable = true;
if (src.containsKey('is_touchable')) {
mIsTouchable = src['is_touchable'];
}
// after version 9.
String? mName;
if (src.containsKey('name')) {
mName = src['name'];
}
return Sp3dFragment(f,
isParticle: src['is_particle'],
r: src['r'],
physics: src.containsKey('physics')
? src['physics'] != null
? Sp3dPhysics.fromDict(src['physics'])
: null
: null,
isTouchable: mIsTouchable,
name: mName,
option: src['option']);
}