mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-11 13:29:41 -05:00
udpate schema
This commit is contained in:
@@ -36,6 +36,16 @@ public static VRMC_node_collider Deserialize(ListTreeNode<JsonValue> parsed)
|
||||
{
|
||||
var key = kv.Key.GetString();
|
||||
|
||||
if(key=="extensions"){
|
||||
value.Extensions = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="extras"){
|
||||
value.Extras = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="shapes"){
|
||||
value.Shapes = Deserialize_Shapes(kv.Value);
|
||||
continue;
|
||||
@@ -63,6 +73,16 @@ public static ColliderShape Deserialize_Shapes_ITEM(ListTreeNode<JsonValue> pars
|
||||
{
|
||||
var key = kv.Key.GetString();
|
||||
|
||||
if(key=="extensions"){
|
||||
value.Extensions = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="extras"){
|
||||
value.Extras = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="sphere"){
|
||||
value.Sphere = Deserialize_Sphere(kv.Value);
|
||||
continue;
|
||||
|
||||
@@ -30,6 +30,12 @@ namespace UniGLTF.Extensions.VRMC_node_collider
|
||||
|
||||
public class ColliderShape
|
||||
{
|
||||
// Dictionary object with extension-specific objects.
|
||||
public glTFExtension Extensions;
|
||||
|
||||
// Application-specific data.
|
||||
public glTFExtension Extras;
|
||||
|
||||
public ColliderShapeSphere Sphere;
|
||||
|
||||
public ColliderShapeCapsule Capsule;
|
||||
@@ -40,6 +46,12 @@ namespace UniGLTF.Extensions.VRMC_node_collider
|
||||
public const string ExtensionName = "VRMC_node_collider";
|
||||
public static readonly Utf8String ExtensionNameUtf8 = Utf8String.From(ExtensionName);
|
||||
|
||||
// Dictionary object with extension-specific objects.
|
||||
public glTFExtension Extensions;
|
||||
|
||||
// Application-specific data.
|
||||
public glTFExtension Extras;
|
||||
|
||||
public List<ColliderShape> Shapes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,16 @@ public static void Serialize(JsonFormatter f, VRMC_node_collider value)
|
||||
f.BeginMap();
|
||||
|
||||
|
||||
if(value.Extensions!=null){
|
||||
f.Key("extensions");
|
||||
value.Extensions.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Extras!=null){
|
||||
f.Key("extras");
|
||||
value.Extras.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Shapes!=null&&value.Shapes.Count()>=0){
|
||||
f.Key("shapes");
|
||||
Serialize_Shapes(f, value.Shapes);
|
||||
@@ -58,6 +68,16 @@ public static void Serialize_Shapes_ITEM(JsonFormatter f, ColliderShape value)
|
||||
f.BeginMap();
|
||||
|
||||
|
||||
if(value.Extensions!=null){
|
||||
f.Key("extensions");
|
||||
value.Extensions.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Extras!=null){
|
||||
f.Key("extras");
|
||||
value.Extras.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Sphere!=null){
|
||||
f.Key("sphere");
|
||||
Serialize_Sphere(f, value.Sphere);
|
||||
|
||||
@@ -36,6 +36,16 @@ public static VRMC_springBone Deserialize(ListTreeNode<JsonValue> parsed)
|
||||
{
|
||||
var key = kv.Key.GetString();
|
||||
|
||||
if(key=="extensions"){
|
||||
value.Extensions = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="extras"){
|
||||
value.Extras = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="springs"){
|
||||
value.Springs = Deserialize_Springs(kv.Value);
|
||||
continue;
|
||||
@@ -100,6 +110,21 @@ public static SpringBoneJoint Deserialize_Joints_ITEM(ListTreeNode<JsonValue> pa
|
||||
{
|
||||
var key = kv.Key.GetString();
|
||||
|
||||
if(key=="extensions"){
|
||||
value.Extensions = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="extras"){
|
||||
value.Extras = new glTFExtensionImport(kv.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="node"){
|
||||
value.Node = kv.Value.GetInt32();
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="hitRadius"){
|
||||
value.HitRadius = kv.Value.GetSingle();
|
||||
continue;
|
||||
@@ -125,6 +150,11 @@ public static SpringBoneJoint Deserialize_Joints_ITEM(ListTreeNode<JsonValue> pa
|
||||
continue;
|
||||
}
|
||||
|
||||
if(key=="exclude"){
|
||||
value.Exclude = kv.Value.GetBoolean();
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -9,22 +9,32 @@ namespace UniGLTF.Extensions.VRMC_springBone
|
||||
|
||||
public class SpringBoneJoint
|
||||
{
|
||||
// Dictionary object with extension-specific objects.
|
||||
public glTFExtension Extensions;
|
||||
|
||||
// Application-specific data.
|
||||
public glTFExtension Extras;
|
||||
|
||||
// The node index.
|
||||
public int? Node;
|
||||
|
||||
// The radius of spring sphere
|
||||
|
||||
// The radius of spring sphere.
|
||||
public float? HitRadius;
|
||||
|
||||
// The force to return to the initial pose
|
||||
// The force to return to the initial pose.
|
||||
public float? Stiffness;
|
||||
|
||||
// Gravitational acceleration
|
||||
// Gravitational acceleration.
|
||||
public float? GravityPower;
|
||||
|
||||
// The direction of gravity. A gravity other than downward direction also works.
|
||||
public float[] GravityDir;
|
||||
|
||||
// Air resistance. Deceleration force
|
||||
// Air resistance. Deceleration force.
|
||||
public float? DragForce;
|
||||
|
||||
// When enabled, this joint will skip Spring processing.
|
||||
public bool? Exclude;
|
||||
}
|
||||
|
||||
public class Spring
|
||||
@@ -44,6 +54,12 @@ namespace UniGLTF.Extensions.VRMC_springBone
|
||||
public const string ExtensionName = "VRMC_springBone";
|
||||
public static readonly Utf8String ExtensionNameUtf8 = Utf8String.From(ExtensionName);
|
||||
|
||||
// Dictionary object with extension-specific objects.
|
||||
public glTFExtension Extensions;
|
||||
|
||||
// Application-specific data.
|
||||
public glTFExtension Extras;
|
||||
|
||||
// An array of springs.
|
||||
public List<Spring> Springs;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,16 @@ public static void Serialize(JsonFormatter f, VRMC_springBone value)
|
||||
f.BeginMap();
|
||||
|
||||
|
||||
if(value.Extensions!=null){
|
||||
f.Key("extensions");
|
||||
value.Extensions.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Extras!=null){
|
||||
f.Key("extras");
|
||||
value.Extras.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Springs!=null&&value.Springs.Count()>=0){
|
||||
f.Key("springs");
|
||||
Serialize_Springs(f, value.Springs);
|
||||
@@ -93,6 +103,21 @@ public static void Serialize_Joints_ITEM(JsonFormatter f, SpringBoneJoint value)
|
||||
f.BeginMap();
|
||||
|
||||
|
||||
if(value.Extensions!=null){
|
||||
f.Key("extensions");
|
||||
value.Extensions.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Extras!=null){
|
||||
f.Key("extras");
|
||||
value.Extras.Serialize(f);
|
||||
}
|
||||
|
||||
if(value.Node.HasValue){
|
||||
f.Key("node");
|
||||
f.Value(value.Node.GetValueOrDefault());
|
||||
}
|
||||
|
||||
if(value.HitRadius.HasValue){
|
||||
f.Key("hitRadius");
|
||||
f.Value(value.HitRadius.GetValueOrDefault());
|
||||
@@ -118,6 +143,11 @@ public static void Serialize_Joints_ITEM(JsonFormatter f, SpringBoneJoint value)
|
||||
f.Value(value.DragForce.GetValueOrDefault());
|
||||
}
|
||||
|
||||
if(value.Exclude.HasValue){
|
||||
f.Key("exclude");
|
||||
f.Value(value.Exclude.GetValueOrDefault());
|
||||
}
|
||||
|
||||
f.EndMap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user