/// <summary> /// Changes this transform from local to global space by iteratively progressing to parent objects transforms. /// </summary> /// <param name="t"></param> /// <param name="sceneAccess"></param> /// <returns></returns> public static MTransform LocalToGlobal(this MTransform t, MSceneAccess.Iface sceneAccess) { MTransform newT = t; if (t.Parent != null) { MSceneObject o = sceneAccess.GetSceneObjectByID(t.Parent); if (o != null) { newT = t.Multiply(o.Transform); if (o.Transform.Parent != null) { newT.Parent = o.Transform.Parent; newT = newT.LocalToGlobal(sceneAccess); } } } return(newT); }
/// <summary> /// Constructor to create a new server /// </summary> /// <param name="address"></param> /// <param name="port"></param> /// <param name="implementation"></param> public RemoteSceneAccessServer(MIPAddress address, MIPAddress registerAddress, MSceneAccess.Iface implementation) { //Add the address to the description this.description.Addresses = new List <MIPAddress>() { address }; //Create a new controller this.controller = new ServiceController(description, registerAddress, new MSceneAccess.Processor(implementation)); }
/// <summary> /// Returns the global rotation of the specified constraint /// </summary> /// <param name="constraint"></param> /// <param name="sceneAccess"></param> /// <returns></returns> public static MQuaternion GetGlobalRotation(this MGeometryConstraint constraint, MSceneAccess.Iface sceneAccess) { MTransform parentTransform = sceneAccess.GetTransformByID(constraint.ParentObjectID); if (parentTransform != null) { if (constraint.ParentToConstraint != null) { return(parentTransform.TransformRotation(constraint.ParentToConstraint.Rotation)); } else { return(parentTransform.Rotation); } } //No parent defined else { if (constraint.ParentToConstraint != null) { return(constraint.ParentToConstraint.Rotation); } } return(null); }
/// <summary> /// Default constructor /// </summary> public ConstraintManager(MSceneAccess.Iface sceneAccess) { this.sceneAccess = sceneAccess; }
/// <summary> /// Copies the full scene of the reference scene access /// </summary> /// <param name="original"></param> public virtual void CopyScene(MSceneAccess.Iface original) { this.Apply(original.GetFullScene(), true); }