more physics api

This commit is contained in:
2016-04-17 23:24:22 +06:00
parent 68ca004cbd
commit 12e944b068
5 changed files with 22 additions and 8 deletions

View File

@@ -44,7 +44,7 @@ namespace IsoTools {
get { return realCollider as BoxCollider; }
}
#if UNITY_EDITOR
#if UNITY_EDITOR
protected override void Reset() {
base.Reset();
var iso_object = GetComponent<IsoObject>();
@@ -71,6 +71,6 @@ namespace IsoTools {
Color.green);
}
}
#endif
#endif
}
}

View File

@@ -62,6 +62,18 @@ namespace IsoTools {
}
}
public float contactOffset {
get {
return realCollider
? realCollider.contactOffset
: 0.0f;
} set {
if ( realCollider ) {
realCollider.contactOffset = value;
}
}
}
public Vector3 ClosestPointOnBounds(Vector3 position) {
return realCollider
? realCollider.ClosestPointOnBounds(position)
@@ -105,7 +117,7 @@ namespace IsoTools {
}
}
#if UNITY_EDITOR
#if UNITY_EDITOR
protected virtual void Reset() {
material = null;
isTrigger = false;
@@ -116,6 +128,6 @@ namespace IsoTools {
material = _material;
isTrigger = _isTrigger;
}
#endif
#endif
}
}

View File

@@ -7,6 +7,7 @@ namespace IsoTools {
public IsoCollider collider { get; private set; }
public IsoContactPoint[] contacts { get; private set; }
public GameObject gameObject { get; private set; }
public Vector3 impulse { get; private set; }
public Vector3 relativeVelocity { get; private set; }
public IsoRigidbody rigidbody { get; private set; }
@@ -14,6 +15,7 @@ namespace IsoTools {
collider = IsoUtils.IsoConvertCollider(collision.collider);
contacts = IsoUtils.IsoConvertContactPoints(collision.contacts);
gameObject = IsoUtils.IsoConvertGameObject(collision.gameObject);
impulse = collision.impulse;
relativeVelocity = collision.relativeVelocity;
rigidbody = IsoUtils.IsoConvertRigidbody(collision.rigidbody);
}

View File

@@ -348,7 +348,7 @@ namespace IsoTools {
}
}
#if UNITY_EDITOR
#if UNITY_EDITOR
void Reset() {
mass = 1.0f;
drag = 0.0f;
@@ -369,6 +369,6 @@ namespace IsoTools {
realRigidbody.collisionDetectionMode = collisionDetectionMode;
}
}
#endif
#endif
}
}

View File

@@ -44,7 +44,7 @@ namespace IsoTools {
get { return realCollider as SphereCollider; }
}
#if UNITY_EDITOR
#if UNITY_EDITOR
protected override void Reset() {
base.Reset();
var iso_object = GetComponent<IsoObject>();
@@ -71,6 +71,6 @@ namespace IsoTools {
Color.green);
}
}
#endif
#endif
}
}