示例#1
0
 private Node GetOrCreateObserverFrame(agx.ObserverFrame observerFrame)
 {
     return(GetOrCreateNode(NodeType.ObserverFrame,
                            observerFrame.getUuid(),
                            true,
                            () => m_observerFrames.Add(observerFrame.getUuid(), observerFrame)));
 }
示例#2
0
        protected override bool Initialize()
        {
            Native = new agx.ObserverFrame();

            var rb = gameObject.GetInitializedComponentInParent <RigidBody>();

            Native.attachWithWorldTransform(rb != null ? rb.Native : null,
                                            new agx.AffineMatrix4x4(transform.rotation.ToHandedQuat(),
                                                                    transform.position.ToHandedVec3()));

            return(true);
        }
示例#3
0
 public void RestoreLocalDataFrom(agx.ObserverFrame native, GameObject parent)
 {
     transform.SetParent(parent != null ? parent.transform : null);
     transform.position = native.getPosition().ToHandedVector3();
     transform.rotation = native.getRotation().ToHandedQuaternion();
 }