_xiaofang/xiaofang/Assets/Obi/Scripts/Common/DataStructures/CollisionMaterial.cs
杨号敬 bcc74f0465 add
2024-12-18 02:18:45 +08:00

36 lines
1.1 KiB
C#

using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
namespace Obi
{
[StructLayout(LayoutKind.Sequential)]
public struct CollisionMaterial
{
public float dynamicFriction;
public float staticFriction;
public float rollingFriction;
public float stickiness;
public float stickDistance;
public Oni.MaterialCombineMode frictionCombine;
public Oni.MaterialCombineMode stickinessCombine;
public int rollingContacts;
public void FromObiCollisionMaterial(ObiCollisionMaterial material)
{
if (material != null)
{
dynamicFriction = material.dynamicFriction;
staticFriction = material.staticFriction;
stickiness = material.stickiness;
stickDistance = material.stickDistance;
rollingFriction = material.rollingFriction;
frictionCombine = material.frictionCombine;
stickinessCombine = material.stickinessCombine;
rollingContacts = material.rollingContacts ? 1 : 0;
}
}
}
}