public static void AlignCenterVerticallyWith(this SCNNode self, SCNNode from, float offset = 0) { var conv = self.ConvertPositionFromNode(SCNVector3.Zero, from); self.Position = new SCNVector3(self.Position.X, conv.Y + offset, self.Position.Z); }
public static void AlignBottomTo(this SCNNode self, SCNNode from, float offset = 0) { var y = self.ConvertPositionFromNode(new SCNVector3(0, -from.Height() * 0.5F, 0), from).Y + (self.Height() * 0.5F) + offset; self.Position = new SCNVector3(self.Position.X, y, self.Position.Z); }
public static void AlignRightTo(this SCNNode self, SCNNode from, float offset = 0) { var x = self.ConvertPositionFromNode(new SCNVector3(from.Width() * 0.5F, 0, 0), from).X - (self.Width() * 0.5F) + offset; self.Position = new SCNVector3(x, self.Position.Y, self.Position.Z); }