36 lines
1.1 KiB
C#
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;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|