private Node GetOrCreateObserverFrame(agx.ObserverFrame observerFrame) { return(GetOrCreateNode(NodeType.ObserverFrame, observerFrame.getUuid(), true, () => m_observerFrames.Add(observerFrame.getUuid(), observerFrame))); }
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); }
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(); }