add Physics support

This commit is contained in:
1605296300@qq.com
2022-08-10 16:54:20 +08:00
parent 33c8d35c84
commit f797fbb2fd
855 changed files with 649609 additions and 98 deletions
@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;
namespace RootMotion.Dynamics {
/// <summary>
/// The sub-behaviours take care of behaviour code reusability.
/// While there can be only one active Puppet Behaviour at a time, that active behaviour can use multiple independent and reusable sub-behaviours simultaneously.
/// For example the SubBehaviourCOM is responsible for calculating everything about the center of mass and can be used by any behaviour or even other sub-behaviours that need CoM calculations.
/// This is the base abstract class for all sub-behaviours.
/// </summary>
[System.Serializable]
public abstract class SubBehaviourBase {
protected BehaviourBase behaviour;
protected static Vector2 XZ(Vector3 v) {
return new Vector2(v.x, v.z);
}
protected static Vector3 XYZ(Vector2 v) {
return new Vector3(v.x, 0f, v.y);
}
protected static Vector3 Flatten(Vector3 v) {
return new Vector3(v.x, 0f, v.z);
}
protected static Vector3 SetY(Vector3 v, float y) {
return new Vector3(v.x, y, v.z);
}
}
}