添加插件
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Obi.Samples
|
||||
{
|
||||
public class ActorCOMTransform : MonoBehaviour
|
||||
{
|
||||
|
||||
public Vector3 offset;
|
||||
public ObiActor actor;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (actor != null && actor.isLoaded)
|
||||
{
|
||||
Vector3 com;
|
||||
actor.GetMass(out com);
|
||||
transform.position = actor.solver.transform.TransformPoint(com) + offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user