Merge main into net8.0.
This commit is contained in:
Коммит
a88d7e6745
|
@ -10,10 +10,12 @@
|
|||
<clear />
|
||||
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
|
||||
<!-- Begin: Package sources from dotnet-emsdk -->
|
||||
<add key="darc-pub-dotnet-emsdk-3a6c724" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-3a6c724f/nuget/v3/index.json" />
|
||||
<!-- End: Package sources from dotnet-emsdk -->
|
||||
<!-- Begin: Package sources from dotnet-aspnetcore -->
|
||||
<!-- End: Package sources from dotnet-aspnetcore -->
|
||||
<!-- Begin: Package sources from dotnet-runtime -->
|
||||
<add key="darc-pub-dotnet-runtime-12b1873" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-12b1873d/nuget/v3/index.json" />
|
||||
<!-- End: Package sources from dotnet-runtime -->
|
||||
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
|
||||
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" protocolVersion="3" />
|
||||
|
|
|
@ -75,6 +75,7 @@ DIRECTORIES += \
|
|||
$(TMP_PKG_DIR) \
|
||||
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/Sdk) \
|
||||
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(DOTNET_DESTDIR)/Microsoft.$(platform).Windows.Sdk/targets) \
|
||||
$(foreach platform,$(DOTNET_PLATFORMS),Workloads/Microsoft.NET.Sdk.$(platform)) \
|
||||
|
||||
$(DIRECTORIES):
|
||||
$(Q) mkdir -p $@
|
||||
|
@ -169,13 +170,12 @@ endef
|
|||
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SharedAfterTargetsTemplate,$(platform),$(NET6_$(platform)_NUGET_VERSION_NO_METADATA),$(NET7_$(platform)_NUGET_VERSION_NO_METADATA))))
|
||||
|
||||
define WorkloadTargets
|
||||
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp
|
||||
$$(Q) mkdir -p Workloads/Microsoft.NET.Sdk.$(1)/
|
||||
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp | Workloads/Microsoft.NET.Sdk.$(1)
|
||||
$$(Q) rm -f $$@.tmp
|
||||
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(4)" "$(6)" "$$(DOTNET_$(5)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)"
|
||||
$$(Q) mv $$@.tmp $$@
|
||||
|
||||
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index
|
||||
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index | Workloads/Microsoft.NET.Sdk.$(1)
|
||||
$$(Q_GEN) sed \
|
||||
-e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \
|
||||
$$< > $$@.tmp
|
||||
|
|
|
@ -120,6 +120,7 @@ namespace Xamarin.iOS.Tasks {
|
|||
{
|
||||
var name = Path.GetFileNameWithoutExtension (path);
|
||||
var info = Path.Combine (path, "Info.plist");
|
||||
var isSingleProject = false;
|
||||
if (!File.Exists (info)) {
|
||||
Log.LogError (7014, path, MSBStrings.E7014, name);
|
||||
return;
|
||||
|
@ -162,18 +163,23 @@ namespace Xamarin.iOS.Tasks {
|
|||
Log.LogError (7019, info, MSBStrings.E7019, name, wkCompanionAppBundleIdentifier, mainBundleIdentifier);
|
||||
|
||||
PBoolean watchKitApp;
|
||||
if (!plist.TryGetValue ("WKWatchKitApp", out watchKitApp) || !watchKitApp.Value)
|
||||
if (plist.TryGetValue ("WKWatchKitApp", out watchKitApp)) {
|
||||
if (!watchKitApp.Value)
|
||||
Log.LogError (7020, info, MSBStrings.E7020, name);
|
||||
} else {
|
||||
isSingleProject = true;
|
||||
}
|
||||
|
||||
if (plist.ContainsKey ("LSRequiresIPhoneOS"))
|
||||
Log.LogError (7021, info, MSBStrings.E7021, name);
|
||||
|
||||
var pluginsDir = Path.Combine (path, "PlugIns");
|
||||
if (!Directory.Exists (pluginsDir)) {
|
||||
if (!Directory.Exists (pluginsDir) && !isSingleProject) {
|
||||
Log.LogError (7022, path, MSBStrings.E7022, name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isSingleProject) {
|
||||
int count = 0;
|
||||
foreach (var plugin in Directory.EnumerateDirectories (pluginsDir, "*.appex")) {
|
||||
ValidateWatchExtension (plugin, bundleIdentifier, shortVersionString, version);
|
||||
|
@ -183,6 +189,7 @@ namespace Xamarin.iOS.Tasks {
|
|||
if (count == 0)
|
||||
Log.LogError (7022, pluginsDir, MSBStrings.E7022_A, name);
|
||||
}
|
||||
}
|
||||
|
||||
void ValidateWatchExtension (string path, string watchAppBundleIdentifier, string mainShortVersionString, string mainVersion)
|
||||
{
|
||||
|
|
|
@ -255,6 +255,7 @@
|
|||
"MonoProfileThreadFunc", "end"
|
||||
) {
|
||||
XamarinRuntime = RuntimeMode.MonoVM,
|
||||
Mode = DotNetMode.OnlyLegacy,
|
||||
},
|
||||
|
||||
new Export ("void", "mono_profiler_install_gc",
|
||||
|
|
|
@ -235,6 +235,7 @@ xamarin_get_runtime_class ()
|
|||
* and create a pool that spans the thread's entire lifetime.
|
||||
*/
|
||||
|
||||
#if !DOTNET
|
||||
static CFMutableDictionaryRef xamarin_thread_hash = NULL;
|
||||
static pthread_mutex_t thread_hash_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
|
@ -296,14 +297,18 @@ thread_end (MonoProfiler *prof, uintptr_t tid)
|
|||
// COOP: no managed memory access: any mode.
|
||||
xamarin_thread_finish (NULL);
|
||||
}
|
||||
#endif // !DOTNET
|
||||
|
||||
void
|
||||
xamarin_install_nsautoreleasepool_hooks ()
|
||||
{
|
||||
// No need to do anything here for CoreCLR.
|
||||
#if !DOTNET
|
||||
// COOP: executed at startup (and no managed memory access): any mode.
|
||||
xamarin_thread_hash = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, NULL, NULL);
|
||||
|
||||
mono_profiler_install_thread (thread_start, thread_end);
|
||||
#endif // !DOTNET
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -51,9 +51,14 @@ namespace CoreFoundation {
|
|||
data = CFData.FromData ((IntPtr) ptr, buffer.Length);
|
||||
}
|
||||
|
||||
public CFDataBuffer (IntPtr ptr)
|
||||
public CFDataBuffer (IntPtr ptr) : this (ptr, false)
|
||||
{
|
||||
data = new CFData (ptr, false);
|
||||
}
|
||||
|
||||
|
||||
public CFDataBuffer (IntPtr ptr, bool owns)
|
||||
{
|
||||
data = new CFData (ptr, owns);
|
||||
buffer = data.GetBuffer ();
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ using System.Net;
|
|||
using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Threading;
|
||||
|
||||
using CoreFoundation;
|
||||
using Foundation;
|
||||
|
@ -184,9 +185,12 @@ namespace CoreFoundation {
|
|||
{
|
||||
}
|
||||
|
||||
internal static IPEndPoint EndPointFromAddressPtr (IntPtr address)
|
||||
internal static IPEndPoint? EndPointFromAddressPtr (IntPtr address, bool owns)
|
||||
{
|
||||
using (var buffer = new CFDataBuffer (address)) {
|
||||
if (address == IntPtr.Zero)
|
||||
return null;
|
||||
|
||||
using (var buffer = new CFDataBuffer (address, owns)) {
|
||||
if (buffer [1] == 30) { // AF_INET6
|
||||
int port = (buffer [2] << 8) + buffer [3];
|
||||
var bytes = new byte [16];
|
||||
|
@ -230,6 +234,69 @@ namespace CoreFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
struct CFSocketContext {
|
||||
nint Version; // CFIndex
|
||||
public /* void*/ IntPtr Info;
|
||||
#if NET
|
||||
unsafe delegate* unmanaged<IntPtr, IntPtr> Retain;
|
||||
unsafe delegate* unmanaged<IntPtr, void> Release;
|
||||
#else
|
||||
IntPtr Retain;
|
||||
IntPtr Release;
|
||||
#endif
|
||||
IntPtr CopyDescription;
|
||||
|
||||
public CFSocketContext (IntPtr info) : this ()
|
||||
{
|
||||
Info = info;
|
||||
#if NET
|
||||
unsafe {
|
||||
Retain = &OnContextRetain;
|
||||
Release = &OnContextRelease;
|
||||
}
|
||||
#else
|
||||
Retain = Marshal.GetFunctionPointerForDelegate (retainCallback);
|
||||
Release = Marshal.GetFunctionPointerForDelegate (releaseCallback);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !NET
|
||||
delegate IntPtr RetainCallback (IntPtr ptr);
|
||||
static readonly RetainCallback retainCallback = OnContextRetain;
|
||||
#endif
|
||||
|
||||
#if NET
|
||||
[UnmanagedCallersOnly]
|
||||
#else
|
||||
[MonoPInvokeCallback (typeof (RetainCallback))]
|
||||
#endif
|
||||
static IntPtr OnContextRetain (IntPtr ptr)
|
||||
{
|
||||
var gch = GCHandle.FromIntPtr (ptr);
|
||||
var socket = (CFSocket?) gch.Target;
|
||||
socket?.RetainContext ();
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if !NET
|
||||
delegate void ReleaseCallback (IntPtr ptr);
|
||||
static readonly ReleaseCallback releaseCallback = OnContextRelease;
|
||||
#endif
|
||||
|
||||
#if NET
|
||||
[UnmanagedCallersOnly]
|
||||
#else
|
||||
[MonoPInvokeCallback (typeof (ReleaseCallback))]
|
||||
#endif
|
||||
static void OnContextRelease (IntPtr ptr)
|
||||
{
|
||||
var gch = GCHandle.FromIntPtr (ptr);
|
||||
var socket = (CFSocket?) gch.Target;
|
||||
socket?.ReleaseContext (gch);
|
||||
}
|
||||
}
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
|
@ -237,14 +304,25 @@ namespace CoreFoundation {
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
public class CFSocket : CFType {
|
||||
GCHandle gch;
|
||||
int contextRetainCount;
|
||||
|
||||
internal void RetainContext ()
|
||||
{
|
||||
Interlocked.Increment (ref contextRetainCount);
|
||||
}
|
||||
|
||||
unsafe internal void ReleaseContext (GCHandle gch)
|
||||
{
|
||||
var postRC = Interlocked.Decrement (ref contextRetainCount);
|
||||
if (postRC == 0 && gch.IsAllocated) {
|
||||
gch.Free ();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if (gch.IsAllocated)
|
||||
gch.Free ();
|
||||
}
|
||||
if (Handle != NativeHandle.Zero)
|
||||
CFSocketInvalidate (Handle);
|
||||
base.Dispose (disposing);
|
||||
}
|
||||
|
||||
|
@ -258,11 +336,11 @@ namespace CoreFoundation {
|
|||
return;
|
||||
CFSocketCallBackType cbType = (CFSocketCallBackType) (ulong) type;
|
||||
|
||||
if (cbType == CFSocketCallBackType.AcceptCallBack) {
|
||||
var ep = CFSocketAddress.EndPointFromAddressPtr (address);
|
||||
if (cbType == CFSocketCallBackType.AcceptCallBack && socket.AcceptEvent is not null) {
|
||||
var ep = CFSocketAddress.EndPointFromAddressPtr (address, false)!;
|
||||
var handle = new CFSocketNativeHandle (Marshal.ReadInt32 (data));
|
||||
socket.OnAccepted (new CFSocketAcceptEventArgs (handle, ep));
|
||||
} else if (cbType == CFSocketCallBackType.ConnectCallBack) {
|
||||
} else if (cbType == CFSocketCallBackType.ConnectCallBack && socket.ConnectEvent is not null) {
|
||||
CFSocketError result;
|
||||
if (data == IntPtr.Zero)
|
||||
result = CFSocketError.Success;
|
||||
|
@ -272,28 +350,31 @@ namespace CoreFoundation {
|
|||
result = (CFSocketError) Marshal.ReadInt32 (data);
|
||||
}
|
||||
socket.OnConnect (new CFSocketConnectEventArgs (result));
|
||||
} else if (cbType == CFSocketCallBackType.DataCallBack) {
|
||||
var ep = CFSocketAddress.EndPointFromAddressPtr (address);
|
||||
using (var cfdata = new CFData (data, false))
|
||||
} else if (cbType == CFSocketCallBackType.DataCallBack && socket.DataEvent is not null) {
|
||||
using (var cfdata = new CFData (data, false)) {
|
||||
if (cfdata.Length > 0) {
|
||||
var ep = CFSocketAddress.EndPointFromAddressPtr (address, false)!;
|
||||
socket.OnData (new CFSocketDataEventArgs (ep, cfdata.GetBuffer ()));
|
||||
}
|
||||
}
|
||||
} else if (cbType == CFSocketCallBackType.NoCallBack) {
|
||||
// nothing to do
|
||||
} else if (cbType == CFSocketCallBackType.ReadCallBack) {
|
||||
} else if (cbType == CFSocketCallBackType.ReadCallBack && socket.ReadEvent is not null) {
|
||||
socket.OnRead (new CFSocketReadEventArgs ());
|
||||
} else if (cbType == CFSocketCallBackType.WriteCallBack) {
|
||||
} else if (cbType == CFSocketCallBackType.WriteCallBack && socket.WriteEvent is not null) {
|
||||
socket.OnWrite (new CFSocketWriteEventArgs ());
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
extern static IntPtr CFSocketCreate (IntPtr allocator, int /*SInt32*/ family, int /*SInt32*/ type, int /*SInt32*/ proto,
|
||||
unsafe extern static IntPtr CFSocketCreate (IntPtr allocator, int /*SInt32*/ family, int /*SInt32*/ type, int /*SInt32*/ proto,
|
||||
nuint /*CFOptionFlags*/ callBackTypes,
|
||||
CFSocketCallBack callout, ref CFStreamClientContext ctx);
|
||||
CFSocketCallBack callout, CFSocketContext* ctx);
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
extern static IntPtr CFSocketCreateWithNative (IntPtr allocator, CFSocketNativeHandle sock,
|
||||
unsafe extern static IntPtr CFSocketCreateWithNative (IntPtr allocator, CFSocketNativeHandle sock,
|
||||
nuint /*CFOptionFlags*/ callBackTypes,
|
||||
CFSocketCallBack callout, ref CFStreamClientContext ctx);
|
||||
CFSocketCallBack callout, CFSocketContext* ctx);
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
extern static IntPtr CFSocketCreateRunLoopSource (IntPtr allocator, IntPtr socket, nint order);
|
||||
|
@ -315,57 +396,57 @@ namespace CoreFoundation {
|
|||
{
|
||||
}
|
||||
|
||||
unsafe delegate IntPtr CreateSocket (CFSocketContext* ctx);
|
||||
|
||||
const CFSocketCallBackType defaultCallbackTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.ConnectCallBack;
|
||||
CFSocket (int family, int type, int proto, CFRunLoop loop)
|
||||
{
|
||||
var cbTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.ConnectCallBack;
|
||||
|
||||
gch = GCHandle.Alloc (this);
|
||||
try {
|
||||
var ctx = new CFStreamClientContext ();
|
||||
ctx.Info = GCHandle.ToIntPtr (gch);
|
||||
|
||||
var handle = CFSocketCreate (IntPtr.Zero, family, type, proto, (nuint) (ulong) cbTypes, OnCallback, ref ctx);
|
||||
InitializeHandle (handle);
|
||||
|
||||
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true);
|
||||
loop.AddSource (source, CFRunLoop.ModeDefault);
|
||||
} catch {
|
||||
gch.Free ();
|
||||
throw;
|
||||
unsafe {
|
||||
Initialize (
|
||||
loop,
|
||||
(CFSocketContext* ctx) => CFSocketCreate (IntPtr.Zero, family, type, proto, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CFSocket (CFSocketNativeHandle sock)
|
||||
{
|
||||
var cbTypes = CFSocketCallBackType.DataCallBack | CFSocketCallBackType.WriteCallBack;
|
||||
|
||||
gch = GCHandle.Alloc (this);
|
||||
try {
|
||||
var ctx = new CFStreamClientContext ();
|
||||
ctx.Info = GCHandle.ToIntPtr (gch);
|
||||
|
||||
var handle = CFSocketCreateWithNative (IntPtr.Zero, sock, (nuint) (ulong) cbTypes, OnCallback, ref ctx);
|
||||
InitializeHandle (handle);
|
||||
|
||||
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true);
|
||||
var loop = CFRunLoop.Current;
|
||||
loop.AddSource (source, CFRunLoop.ModeDefault);
|
||||
} catch {
|
||||
gch.Free ();
|
||||
throw;
|
||||
unsafe {
|
||||
Initialize (
|
||||
CFRunLoop.Current,
|
||||
(CFSocketContext* ctx) => CFSocketCreateWithNative (IntPtr.Zero, sock, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
[Preserve (Conditional = true)]
|
||||
CFSocket (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
internal CFSocket (CFSocketSignature sig, double timeout)
|
||||
{
|
||||
gch = GCHandle.Alloc (this);
|
||||
unsafe {
|
||||
Initialize (
|
||||
CFRunLoop.Current,
|
||||
(CFSocketContext* ctx) => CFSocketCreateConnectedToSocketSignature (IntPtr.Zero, ref sig, (nuint) (ulong) defaultCallbackTypes, OnCallback, ctx, timeout)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void Initialize (CFRunLoop runLoop, CreateSocket createSocket)
|
||||
{
|
||||
var gch = GCHandle.Alloc (this);
|
||||
try {
|
||||
var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true);
|
||||
var loop = CFRunLoop.Current;
|
||||
loop.AddSource (source, CFRunLoop.ModeDefault);
|
||||
var ctx = new CFSocketContext ((IntPtr) gch);
|
||||
IntPtr handle;
|
||||
unsafe {
|
||||
CFSocketContext* pctx = &ctx;
|
||||
handle = createSocket (pctx);
|
||||
}
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new CFSocketException (CFSocketError.Error);
|
||||
|
||||
using (var source = new CFRunLoopSource (CFSocketCreateRunLoopSource (IntPtr.Zero, handle, 0), true)) {
|
||||
runLoop.AddSource (source, CFRunLoop.ModeDefault);
|
||||
}
|
||||
|
||||
this.Handle = handle;
|
||||
} catch {
|
||||
gch.Free ();
|
||||
throw;
|
||||
|
@ -373,24 +454,18 @@ namespace CoreFoundation {
|
|||
}
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
extern static IntPtr CFSocketCreateConnectedToSocketSignature (IntPtr allocator, ref CFSocketSignature signature,
|
||||
unsafe extern static IntPtr CFSocketCreateConnectedToSocketSignature (IntPtr allocator, ref CFSocketSignature signature,
|
||||
nuint /*CFOptionFlags*/ callBackTypes,
|
||||
CFSocketCallBack callout,
|
||||
IntPtr context, double timeout);
|
||||
CFSocketContext* context, double timeout);
|
||||
|
||||
public static CFSocket CreateConnectedToSocketSignature (AddressFamily family, SocketType type,
|
||||
ProtocolType proto, IPEndPoint endpoint,
|
||||
double timeout)
|
||||
{
|
||||
var cbTypes = CFSocketCallBackType.ConnectCallBack | CFSocketCallBackType.DataCallBack;
|
||||
using (var address = new CFSocketAddress (endpoint)) {
|
||||
var sig = new CFSocketSignature (family, type, proto, address);
|
||||
var handle = CFSocketCreateConnectedToSocketSignature (
|
||||
IntPtr.Zero, ref sig, (nuint) (ulong) cbTypes, OnCallback, IntPtr.Zero, timeout);
|
||||
if (handle == IntPtr.Zero)
|
||||
throw new CFSocketException (CFSocketError.Error);
|
||||
|
||||
return new CFSocket (handle, true);
|
||||
return new CFSocket (sig, timeout);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -413,6 +488,7 @@ namespace CoreFoundation {
|
|||
public void SetAddress (IPEndPoint endpoint)
|
||||
{
|
||||
EnableCallBacks (CFSocketCallBackType.AcceptCallBack);
|
||||
|
||||
var flags = GetSocketFlags ();
|
||||
flags |= CFSocketFlags.AutomaticallyReenableAcceptCallBack;
|
||||
SetSocketFlags (flags);
|
||||
|
@ -423,6 +499,26 @@ namespace CoreFoundation {
|
|||
}
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
static extern IntPtr CFSocketCopyAddress (IntPtr socket);
|
||||
|
||||
public IPEndPoint? Address {
|
||||
get {
|
||||
var data = CFSocketCopyAddress (Handle);
|
||||
return CFSocketAddress.EndPointFromAddressPtr (data, true);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
static extern IntPtr CFSocketCopyPeerAddress (IntPtr socket);
|
||||
|
||||
public IPEndPoint? RemoteAddress {
|
||||
get {
|
||||
var data = CFSocketCopyPeerAddress (Handle);
|
||||
return CFSocketAddress.EndPointFromAddressPtr (data, true);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
extern static CFSocketFlags CFSocketGetSocketFlags (IntPtr handle);
|
||||
|
||||
|
@ -620,5 +716,13 @@ namespace CoreFoundation {
|
|||
throw new CFSocketException (error);
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport (Constants.CoreFoundationLibrary)]
|
||||
extern static void CFSocketInvalidate (IntPtr handle);
|
||||
|
||||
public void Invalidate ()
|
||||
{
|
||||
Dispose ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using CoreFoundation;
|
||||
using CoreText;
|
||||
|
@ -36,13 +38,13 @@ using UIKit;
|
|||
namespace Foundation {
|
||||
public partial class NSAttributedString {
|
||||
|
||||
public string Value {
|
||||
public string? Value {
|
||||
get {
|
||||
return CFString.FromHandle (LowLevelValue);
|
||||
}
|
||||
}
|
||||
|
||||
public NSDictionary GetAttributes (nint location, out NSRange effectiveRange)
|
||||
public NSDictionary? GetAttributes (nint location, out NSRange effectiveRange)
|
||||
{
|
||||
return Runtime.GetNSObject<NSDictionary> (LowLevelGetAttributes (location, out effectiveRange));
|
||||
}
|
||||
|
@ -58,21 +60,21 @@ namespace Foundation {
|
|||
}
|
||||
#endif
|
||||
|
||||
public NSAttributedString (string str, CTStringAttributes attributes)
|
||||
: this (str, attributes != null ? attributes.Dictionary : null)
|
||||
public NSAttributedString (string str, CTStringAttributes? attributes)
|
||||
: this (str, attributes?.Dictionary)
|
||||
{
|
||||
}
|
||||
|
||||
public CTStringAttributes GetCoreTextAttributes (nint location, out NSRange effectiveRange)
|
||||
public CTStringAttributes? GetCoreTextAttributes (nint location, out NSRange effectiveRange)
|
||||
{
|
||||
var attr = GetAttributes (location, out effectiveRange);
|
||||
return attr == null ? null : new CTStringAttributes (attr);
|
||||
return attr is null ? null : new CTStringAttributes (attr);
|
||||
}
|
||||
|
||||
public CTStringAttributes GetCoreTextAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
|
||||
public CTStringAttributes? GetCoreTextAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
|
||||
{
|
||||
var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
|
||||
return attr == null ? null : new CTStringAttributes (attr);
|
||||
return attr is null ? null : new CTStringAttributes (attr);
|
||||
}
|
||||
|
||||
public NSAttributedString Substring (nint start, nint len)
|
||||
|
@ -81,52 +83,52 @@ namespace Foundation {
|
|||
}
|
||||
|
||||
#if !MONOMAC
|
||||
public NSAttributedString (string str, UIStringAttributes attributes)
|
||||
: this (str, attributes != null ? attributes.Dictionary : null)
|
||||
public NSAttributedString (string str, UIStringAttributes? attributes)
|
||||
: this (str, attributes?.Dictionary)
|
||||
{
|
||||
}
|
||||
|
||||
public UIStringAttributes GetUIKitAttributes (nint location, out NSRange effectiveRange)
|
||||
public UIStringAttributes? GetUIKitAttributes (nint location, out NSRange effectiveRange)
|
||||
{
|
||||
var attr = GetAttributes (location, out effectiveRange);
|
||||
return attr == null ? null : new UIStringAttributes (attr);
|
||||
return attr is null ? null : new UIStringAttributes (attr);
|
||||
}
|
||||
|
||||
public UIStringAttributes GetUIKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
|
||||
public UIStringAttributes? GetUIKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
|
||||
{
|
||||
var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
|
||||
return attr == null ? null : new UIStringAttributes (attr);
|
||||
return attr is null ? null : new UIStringAttributes (attr);
|
||||
}
|
||||
|
||||
static internal NSDictionary ToDictionary (
|
||||
UIFont font,
|
||||
UIColor foregroundColor,
|
||||
UIColor backgroundColor,
|
||||
UIColor strokeColor,
|
||||
NSParagraphStyle paragraphStyle,
|
||||
static internal NSDictionary? ToDictionary (
|
||||
UIFont? font,
|
||||
UIColor? foregroundColor,
|
||||
UIColor? backgroundColor,
|
||||
UIColor? strokeColor,
|
||||
NSParagraphStyle? paragraphStyle,
|
||||
NSLigatureType ligature,
|
||||
float kerning,
|
||||
NSUnderlineStyle underlineStyle,
|
||||
#if !WATCH
|
||||
NSShadow shadow,
|
||||
NSShadow? shadow,
|
||||
#endif
|
||||
float strokeWidth,
|
||||
NSUnderlineStyle strikethroughStyle)
|
||||
{
|
||||
var attr = new UIStringAttributes ();
|
||||
if (font != null) {
|
||||
if (font is not null) {
|
||||
attr.Font = font;
|
||||
}
|
||||
if (foregroundColor != null) {
|
||||
if (foregroundColor is not null) {
|
||||
attr.ForegroundColor = foregroundColor;
|
||||
}
|
||||
if (backgroundColor != null) {
|
||||
if (backgroundColor is not null) {
|
||||
attr.BackgroundColor = backgroundColor;
|
||||
}
|
||||
if (strokeColor != null) {
|
||||
if (strokeColor is not null) {
|
||||
attr.StrokeColor = strokeColor;
|
||||
}
|
||||
if (paragraphStyle != null) {
|
||||
if (paragraphStyle is not null) {
|
||||
attr.ParagraphStyle = paragraphStyle;
|
||||
}
|
||||
if (ligature != NSLigatureType.Default) {
|
||||
|
@ -139,7 +141,7 @@ namespace Foundation {
|
|||
attr.UnderlineStyle = underlineStyle;
|
||||
}
|
||||
#if !WATCH
|
||||
if (shadow != null) {
|
||||
if (shadow is not null) {
|
||||
attr.Shadow = shadow;
|
||||
}
|
||||
#endif
|
||||
|
@ -154,16 +156,16 @@ namespace Foundation {
|
|||
}
|
||||
|
||||
public NSAttributedString (string str,
|
||||
UIFont font = null,
|
||||
UIColor foregroundColor = null,
|
||||
UIColor backgroundColor = null,
|
||||
UIColor strokeColor = null,
|
||||
NSParagraphStyle paragraphStyle = null,
|
||||
UIFont? font = null,
|
||||
UIColor? foregroundColor = null,
|
||||
UIColor? backgroundColor = null,
|
||||
UIColor? strokeColor = null,
|
||||
NSParagraphStyle? paragraphStyle = null,
|
||||
NSLigatureType ligatures = NSLigatureType.Default,
|
||||
float kerning = 0,
|
||||
NSUnderlineStyle underlineStyle = NSUnderlineStyle.None,
|
||||
#if !WATCH
|
||||
NSShadow shadow = null,
|
||||
NSShadow? shadow = null,
|
||||
#endif
|
||||
float strokeWidth = 0,
|
||||
NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None)
|
||||
|
@ -183,7 +185,7 @@ namespace Foundation {
|
|||
// note: we cannot reuse the same method name - as it would break compilation of existing apps
|
||||
public static NSAttributedString CreateFrom (NSTextAttachment attachment)
|
||||
{
|
||||
return (null as NSAttributedString).FromTextAttachment (attachment);
|
||||
return (null as NSAttributedString)!.FromTextAttachment (attachment);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
|
||||
using ObjCRuntime;
|
||||
|
@ -39,7 +41,7 @@ namespace Foundation {
|
|||
|
||||
#if !MONOMAC && !COREBUILD
|
||||
public partial class NSAttributedString {
|
||||
static NSDictionary ignore;
|
||||
static NSDictionary? ignore;
|
||||
|
||||
public NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error)
|
||||
: this (url, documentAttributes, out ignore, ref error) { }
|
||||
|
@ -48,14 +50,14 @@ namespace Foundation {
|
|||
: this (data, documentAttributes, out ignore, ref error) { }
|
||||
|
||||
public NSAttributedString (NSUrl url, ref NSError error)
|
||||
: this (url, (NSDictionary) null, out ignore, ref error) { }
|
||||
: this (url, new NSDictionary (), out ignore, ref error) { }
|
||||
|
||||
public NSAttributedString (NSData data, ref NSError error)
|
||||
: this (data, (NSDictionary) null, out ignore, ref error) { }
|
||||
: this (data, new NSDictionary (), out ignore, ref error) { }
|
||||
|
||||
#if IOS // not TVOS or WATCH
|
||||
// use the best selector based on the OS version
|
||||
public NSAttributedString (NSUrl url, NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error)
|
||||
public NSAttributedString (NSUrl url, NSDictionary? options, out NSDictionary resultDocumentAttributes, ref NSError error)
|
||||
{
|
||||
if (SystemVersion.CheckiOS (9,0))
|
||||
Handle = InitWithURL (url, options, out resultDocumentAttributes, ref error);
|
||||
|
@ -73,12 +75,12 @@ namespace Foundation {
|
|||
public partial class NSAttributedStringDocumentAttributes : DictionaryContainer {
|
||||
#if !MONOMAC && !COREBUILD
|
||||
public NSAttributedStringDocumentAttributes () : base (new NSMutableDictionary ()) { }
|
||||
public NSAttributedStringDocumentAttributes (NSDictionary dictionary) : base (dictionary) { }
|
||||
public NSAttributedStringDocumentAttributes (NSDictionary? dictionary) : base (dictionary) { }
|
||||
|
||||
public NSStringEncoding? StringEncoding {
|
||||
get {
|
||||
var value = GetInt32Value (UIStringAttributeKey.NSCharacterEncodingDocumentAttribute);
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
return null;
|
||||
else
|
||||
return (NSStringEncoding) value.Value;
|
||||
|
@ -88,7 +90,7 @@ namespace Foundation {
|
|||
}
|
||||
}
|
||||
|
||||
public NSString WeakDocumentType {
|
||||
public NSString? WeakDocumentType {
|
||||
get {
|
||||
return GetNSStringValue (UIStringAttributeKey.NSDocumentTypeDocumentAttribute);
|
||||
}
|
||||
|
@ -139,7 +141,7 @@ namespace Foundation {
|
|||
return null;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSPaperSizeDocumentAttribute);
|
||||
else
|
||||
Dictionary [UIStringAttributeKey.NSPaperSizeDocumentAttribute] = NSValue.FromCGSize (value.Value);
|
||||
|
@ -156,7 +158,7 @@ namespace Foundation {
|
|||
return null;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSPaperMarginDocumentAttribute);
|
||||
else
|
||||
Dictionary [UIStringAttributeKey.NSPaperMarginDocumentAttribute] = NSValue.FromUIEdgeInsets (value.Value);
|
||||
|
@ -173,7 +175,7 @@ namespace Foundation {
|
|||
return null;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSViewSizeDocumentAttribute);
|
||||
else
|
||||
Dictionary [UIStringAttributeKey.NSViewSizeDocumentAttribute] = NSValue.FromCGSize (value.Value);
|
||||
|
@ -185,7 +187,7 @@ namespace Foundation {
|
|||
return GetFloatValue (UIStringAttributeKey.NSViewZoomDocumentAttribute);
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSViewZoomDocumentAttribute);
|
||||
else
|
||||
SetNumberValue (UIStringAttributeKey.NSViewZoomDocumentAttribute, value);
|
||||
|
@ -195,13 +197,13 @@ namespace Foundation {
|
|||
public NSDocumentViewMode? ViewMode {
|
||||
get {
|
||||
var value = GetInt32Value (UIStringAttributeKey.NSViewModeDocumentAttribute);
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
return null;
|
||||
else
|
||||
return (NSDocumentViewMode) value.Value;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSViewModeDocumentAttribute);
|
||||
else
|
||||
SetNumberValue (UIStringAttributeKey.NSViewModeDocumentAttribute, (int) value.Value);
|
||||
|
@ -211,7 +213,7 @@ namespace Foundation {
|
|||
public bool ReadOnly {
|
||||
get {
|
||||
var value = GetInt32Value (UIStringAttributeKey.NSReadOnlyDocumentAttribute);
|
||||
if (value == null || value.Value <= 0)
|
||||
if (value is null || value.Value <= 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -220,14 +222,14 @@ namespace Foundation {
|
|||
}
|
||||
}
|
||||
|
||||
public UIColor BackgroundColor {
|
||||
public UIColor? BackgroundColor {
|
||||
get {
|
||||
NSObject value;
|
||||
NSObject? value;
|
||||
Dictionary.TryGetValue (UIStringAttributeKey.NSBackgroundColorDocumentAttribute, out value);
|
||||
return value as UIColor;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSBackgroundColorDocumentAttribute);
|
||||
else
|
||||
Dictionary [UIStringAttributeKey.NSBackgroundColorDocumentAttribute] = value;
|
||||
|
@ -239,7 +241,7 @@ namespace Foundation {
|
|||
return GetFloatValue (UIStringAttributeKey.NSReadOnlyDocumentAttribute);
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSReadOnlyDocumentAttribute);
|
||||
else {
|
||||
if (value < 0 || value > 1.0f)
|
||||
|
@ -254,7 +256,7 @@ namespace Foundation {
|
|||
return GetFloatValue (UIStringAttributeKey.NSDefaultTabIntervalDocumentAttribute);
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSDefaultTabIntervalDocumentAttribute);
|
||||
else {
|
||||
if (value < 0 || value > 1.0f)
|
||||
|
@ -264,14 +266,14 @@ namespace Foundation {
|
|||
}
|
||||
}
|
||||
|
||||
public NSDictionary WeakDefaultAttributes {
|
||||
public NSDictionary? WeakDefaultAttributes {
|
||||
get {
|
||||
NSObject value;
|
||||
NSObject? value;
|
||||
Dictionary.TryGetValue (UIStringAttributeKey.NSDefaultAttributesDocumentAttribute, out value);
|
||||
return value as NSDictionary;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (UIStringAttributeKey.NSDefaultAttributesDocumentAttribute);
|
||||
else
|
||||
Dictionary [UIStringAttributeKey.NSDefaultAttributesDocumentAttribute] = value;
|
||||
|
@ -290,13 +292,13 @@ namespace Foundation {
|
|||
[Mac (10, 15)]
|
||||
[iOS (13, 0)]
|
||||
#endif
|
||||
public NSUrl ReadAccessUrl {
|
||||
public NSUrl? ReadAccessUrl {
|
||||
get {
|
||||
Dictionary.TryGetValue (NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey, out var value);
|
||||
return value as NSUrl;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey);
|
||||
else
|
||||
Dictionary [NSAttributedStringDocumentReadingOptionKeys.ReadAccessUrlKey] = value;
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
//
|
||||
// Copyright 2013 Xamarin Inc
|
||||
|
||||
#nullable enable
|
||||
|
||||
#if MONOMAC
|
||||
|
||||
using System;
|
||||
|
@ -18,39 +20,39 @@ namespace Foundation
|
|||
{
|
||||
public partial class NSAttributedString
|
||||
{
|
||||
public NSAttributedString (string str, NSStringAttributes attributes)
|
||||
: this (str, attributes != null ? attributes.Dictionary : null)
|
||||
public NSAttributedString (string str, NSStringAttributes? attributes)
|
||||
: this (str, attributes?.Dictionary)
|
||||
{
|
||||
}
|
||||
|
||||
public NSAttributedString (string str,
|
||||
NSFont font = null,
|
||||
NSColor foregroundColor = null,
|
||||
NSColor backgroundColor = null,
|
||||
NSColor strokeColor = null,
|
||||
NSColor underlineColor = null,
|
||||
NSColor strikethroughColor = null,
|
||||
NSFont? font = null,
|
||||
NSColor? foregroundColor = null,
|
||||
NSColor? backgroundColor = null,
|
||||
NSColor? strokeColor = null,
|
||||
NSColor? underlineColor = null,
|
||||
NSColor? strikethroughColor = null,
|
||||
NSUnderlineStyle underlineStyle = NSUnderlineStyle.None,
|
||||
NSUnderlineStyle strikethroughStyle = NSUnderlineStyle.None,
|
||||
NSParagraphStyle paragraphStyle = null,
|
||||
NSParagraphStyle? paragraphStyle = null,
|
||||
float strokeWidth = 0,
|
||||
NSShadow shadow = null,
|
||||
NSUrl link = null,
|
||||
NSShadow? shadow = null,
|
||||
NSUrl? link = null,
|
||||
bool superscript = false,
|
||||
NSTextAttachment attachment = null,
|
||||
NSTextAttachment? attachment = null,
|
||||
NSLigatureType ligature = NSLigatureType.Default,
|
||||
float baselineOffset = 0,
|
||||
float kerningAdjustment = 0,
|
||||
float obliqueness = 0,
|
||||
float expansion = 0,
|
||||
NSCursor cursor = null,
|
||||
string toolTip = null,
|
||||
NSCursor? cursor = null,
|
||||
string? toolTip = null,
|
||||
int characterShape = 0,
|
||||
NSGlyphInfo glyphInfo = null,
|
||||
NSArray writingDirection = null,
|
||||
NSGlyphInfo? glyphInfo = null,
|
||||
NSArray? writingDirection = null,
|
||||
bool markedClauseSegment = false,
|
||||
NSTextLayoutOrientation verticalGlyphForm = NSTextLayoutOrientation.Horizontal,
|
||||
NSTextAlternatives textAlternatives = null,
|
||||
NSTextAlternatives? textAlternatives = null,
|
||||
NSSpellingState spellingState = NSSpellingState.None) : this (str, NSStringAttributes.ToDictionary (
|
||||
font: font,
|
||||
foregroundColor: foregroundColor,
|
||||
|
@ -127,16 +129,16 @@ namespace Foundation
|
|||
return new NSAttributedString (wordDocFormat, NSAttributedStringDataType.DocFormat, out docAttributes);
|
||||
}
|
||||
|
||||
public NSStringAttributes GetAppKitAttributes (nint location, out NSRange effectiveRange)
|
||||
public NSStringAttributes? GetAppKitAttributes (nint location, out NSRange effectiveRange)
|
||||
{
|
||||
var attr = GetAttributes (location, out effectiveRange);
|
||||
return attr == null ? null : new NSStringAttributes (attr);
|
||||
return attr is null ? null : new NSStringAttributes (attr);
|
||||
}
|
||||
|
||||
public NSStringAttributes GetAppKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
|
||||
public NSStringAttributes? GetAppKitAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit)
|
||||
{
|
||||
var attr = GetAttributes (location, out longestEffectiveRange, rangeLimit);
|
||||
return attr == null ? null : new NSStringAttributes (attr);
|
||||
return attr is null ? null : new NSStringAttributes (attr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,27 +146,27 @@ namespace Foundation
|
|||
public NSAttributedStringDocumentAttributes () : base (new NSMutableDictionary ()) {}
|
||||
public NSAttributedStringDocumentAttributes (NSDictionary dictionary) : base (dictionary) {}
|
||||
|
||||
public WebPreferences WebPreferences {
|
||||
public WebPreferences? WebPreferences {
|
||||
get {
|
||||
NSObject value;
|
||||
Dictionary.TryGetValue (NSStringAttributeKey.NSWebPreferencesDocumentOption, out value);
|
||||
return value as WebPreferences;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (NSStringAttributeKey.NSWebPreferencesDocumentOption);
|
||||
else
|
||||
Dictionary [NSStringAttributeKey.NSWebPreferencesDocumentOption] = value;
|
||||
}
|
||||
}
|
||||
public NSObject WebResourceLoadDelegate {
|
||||
public NSObject? WebResourceLoadDelegate {
|
||||
get {
|
||||
NSObject value;
|
||||
Dictionary.TryGetValue (NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption, out value);
|
||||
return value;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption);
|
||||
else
|
||||
Dictionary [NSStringAttributeKey.NSWebResourceLoadDelegateDocumentOption] = value;
|
||||
|
@ -174,7 +176,7 @@ namespace Foundation
|
|||
public NSStringEncoding? StringEncoding {
|
||||
get {
|
||||
var value = GetInt32Value (NSStringAttributeKey.NSCharacterEncodingDocumentOption);
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
return null;
|
||||
else
|
||||
return (NSStringEncoding) value.Value;
|
||||
|
@ -184,7 +186,7 @@ namespace Foundation
|
|||
}
|
||||
}
|
||||
|
||||
public NSString WeakDocumentType {
|
||||
public NSString? WeakDocumentType {
|
||||
get {
|
||||
return GetNSStringValue (NSStringAttributeKey.NSDocumentTypeDocumentOption);
|
||||
}
|
||||
|
@ -256,21 +258,21 @@ namespace Foundation
|
|||
}
|
||||
}
|
||||
|
||||
public NSDictionary WeakDefaultAttributes {
|
||||
public NSDictionary? WeakDefaultAttributes {
|
||||
get {
|
||||
NSObject value;
|
||||
Dictionary.TryGetValue (NSStringAttributeKey.NSDefaultAttributesDocumentOption, out value);
|
||||
return value as NSDictionary;
|
||||
}
|
||||
set {
|
||||
if (value == null)
|
||||
if (value is null)
|
||||
RemoveValue (NSStringAttributeKey.NSDefaultAttributesDocumentOption);
|
||||
else
|
||||
Dictionary [NSStringAttributeKey.NSDefaultAttributesDocumentOption] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public NSUrl BaseUrl {
|
||||
public NSUrl? BaseUrl {
|
||||
get {
|
||||
return GetNativeValue <NSUrl> (NSStringAttributeKey.NSBaseURLDocumentOption);
|
||||
}
|
||||
|
@ -279,7 +281,7 @@ namespace Foundation
|
|||
}
|
||||
}
|
||||
|
||||
public string TextEncodingName {
|
||||
public string? TextEncodingName {
|
||||
get {
|
||||
return (string)GetNSStringValue (NSStringAttributeKey.NSTextEncodingNameDocumentOption);
|
||||
}
|
||||
|
|
|
@ -137,11 +137,11 @@ namespace GLKit {
|
|||
[ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
|
||||
[ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'Metal' instead.")]
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct GLKVertexAttributeParameters {
|
||||
|
|
|
@ -162,14 +162,14 @@ namespace GLKit {
|
|||
[ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
|
||||
[ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'Metal' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
|
||||
#endif
|
||||
public class GLKTextureOperations : DictionaryContainer {
|
||||
public GLKTextureOperations () : base (new NSMutableDictionary ()) {}
|
||||
public GLKTextureOperations () : base (new NSMutableDictionary ()) { }
|
||||
|
||||
public GLKTextureOperations (NSDictionary options) : base (options) {}
|
||||
public GLKTextureOperations (NSDictionary options) : base (options) { }
|
||||
|
||||
public bool? ApplyPremultiplication {
|
||||
get {
|
||||
|
@ -219,7 +219,7 @@ namespace GLKit {
|
|||
[ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
|
||||
[ObsoletedOSPlatform ("ios12.0", "Use 'Metal' instead.")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public bool? SRGB {
|
||||
get {
|
||||
|
|
|
@ -17,47 +17,43 @@ namespace GameController {
|
|||
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
[Native]
|
||||
public enum GCExtendedGamepadSnapshotDataVersion : long
|
||||
{
|
||||
public enum GCExtendedGamepadSnapshotDataVersion : long {
|
||||
Version1 = 0x0100,
|
||||
Version2 = 0x0101,
|
||||
}
|
||||
|
||||
[Native]
|
||||
public enum GCMicroGamepadSnapshotDataVersion : long
|
||||
{
|
||||
public enum GCMicroGamepadSnapshotDataVersion : long {
|
||||
Version1 = 0x0100,
|
||||
}
|
||||
|
||||
[TV (14,0), Mac (11,0), iOS (14,0)]
|
||||
[TV (14, 0), Mac (11, 0), iOS (14, 0)]
|
||||
[Native]
|
||||
public enum GCTouchState : long
|
||||
{
|
||||
public enum GCTouchState : long {
|
||||
Up,
|
||||
Down,
|
||||
Moving,
|
||||
}
|
||||
|
||||
[TV (14,0), Mac (11,0), iOS (14,0)]
|
||||
[TV (14, 0), Mac (11, 0), iOS (14, 0)]
|
||||
[Native]
|
||||
public enum GCDeviceBatteryState : long
|
||||
{
|
||||
public enum GCDeviceBatteryState : long {
|
||||
Unknown = -1,
|
||||
Discharging,
|
||||
Charging,
|
||||
Full,
|
||||
}
|
||||
|
||||
[TV (14,0), Mac (11,0), iOS (14,0)]
|
||||
[TV (14, 0), Mac (11, 0), iOS (14, 0)]
|
||||
[Native]
|
||||
public enum GCSystemGestureState : long
|
||||
{
|
||||
public enum GCSystemGestureState : long {
|
||||
Enabled = 0,
|
||||
AlwaysReceive,
|
||||
Disabled,
|
||||
}
|
||||
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
public enum GCControllerPlayerIndex : long {
|
||||
Unset = -1,
|
||||
|
@ -67,10 +63,9 @@ namespace GameController {
|
|||
Index4,
|
||||
}
|
||||
|
||||
[iOS (16,0), Mac (13,0), NoWatch, TV (16,0), MacCatalyst (16,0)]
|
||||
[iOS (16, 0), Mac (13, 0), NoWatch, TV (16, 0), MacCatalyst (16, 0)]
|
||||
[Native]
|
||||
public enum GCDevicePhysicalInputElementChange : long
|
||||
{
|
||||
public enum GCDevicePhysicalInputElementChange : long {
|
||||
UnknownChange = -1,
|
||||
NoChange = 0,
|
||||
Changed = 1,
|
||||
|
|
|
@ -30,8 +30,8 @@ namespace GameController {
|
|||
[ObsoletedOSPlatform ("tvos12.2", "Use 'GCExtendedGamepadSnapshotData' instead.")]
|
||||
[ObsoletedOSPlatform ("ios12.2", "Use 'GCExtendedGamepadSnapshotData' instead.")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
[Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCExtendedGamepadSnapshotData' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCExtendedGamepadSnapshotData' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCExtendedGamepadSnapshotData' instead.")]
|
||||
|
|
|
@ -32,8 +32,8 @@ namespace GameController {
|
|||
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'GCExtendedGamepad' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'GCExtendedGamepad' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'GCExtendedGamepad' instead.")]
|
||||
[iOS (7,0)]
|
||||
[Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential, Pack = 1)]
|
||||
public struct GCGamepadSnapShotDataV100 {
|
||||
|
|
|
@ -26,8 +26,8 @@ namespace GameController {
|
|||
[ObsoletedOSPlatform ("tvos12.2", "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
[ObsoletedOSPlatform ("ios12.2", "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[Deprecated (PlatformName.iOS, 12, 2, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 14, 4, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12, 2, message: "Use 'GCController.GetMicroGamepadController()' instead.")]
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace GameKit {
|
|||
public partial class GKMatchRequest {
|
||||
|
||||
#if !NET
|
||||
[iOS (8,0), Mac (10,10)]
|
||||
[iOS (8, 0), Mac (10, 10)]
|
||||
[Obsolete ("Use 'RecipientResponseHandler' property.")]
|
||||
#else
|
||||
[Obsolete ("Use 'RecipientResponseHandler' property.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
|
||||
|
@ -50,22 +50,22 @@ namespace GameKit {
|
|||
public partial class GKGameSession {
|
||||
|
||||
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
|
||||
public static void DidAddPlayer (GKGameSession session, GKCloudPlayer player) {}
|
||||
public static void DidAddPlayer (GKGameSession session, GKCloudPlayer player) { }
|
||||
|
||||
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
|
||||
public static void DidChangeConnectionState (GKGameSession session, GKCloudPlayer player, GKConnectionState newState) {}
|
||||
public static void DidChangeConnectionState (GKGameSession session, GKCloudPlayer player, GKConnectionState newState) { }
|
||||
|
||||
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
|
||||
public static void DidReceiveData (GKGameSession session, Foundation.NSData data, GKCloudPlayer player) {}
|
||||
public static void DidReceiveData (GKGameSession session, Foundation.NSData data, GKCloudPlayer player) { }
|
||||
|
||||
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
|
||||
public static void DidReceiveMessage (GKGameSession session, string message, Foundation.NSData data, GKCloudPlayer player) {}
|
||||
public static void DidReceiveMessage (GKGameSession session, string message, Foundation.NSData data, GKCloudPlayer player) { }
|
||||
|
||||
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
|
||||
public static void DidRemovePlayer (GKGameSession session, GKCloudPlayer player) {}
|
||||
public static void DidRemovePlayer (GKGameSession session, GKCloudPlayer player) { }
|
||||
|
||||
[Obsolete ("Empty stub (GKGameSessionEventListenerPrivate category members are not public API).")]
|
||||
public static void DidSaveData (GKGameSession session, GKCloudPlayer player, Foundation.NSData data) {}
|
||||
public static void DidSaveData (GKGameSession session, GKCloudPlayer player, Foundation.NSData data) { }
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace GameKit {
|
|||
// GKInviteEventListener and GKTurnBasedEventListener both export same selector
|
||||
// but generator changes now catch this. Stub it out to prevent API break
|
||||
[Obsolete ("Use 'DidRequestMatch (GKPlayer player, GKPlayer[] recipientPlayers)' instead.")]
|
||||
public virtual void DidRequestMatchWithPlayers (GKPlayer player, string[] playerIDsToInvite)
|
||||
public virtual void DidRequestMatchWithPlayers (GKPlayer player, string [] playerIDsToInvite)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,27 +146,27 @@ namespace GameKit {
|
|||
FriendRequestNotAvailable = 103,
|
||||
}
|
||||
|
||||
[iOS (10,0)]
|
||||
[Mac (10,12)]
|
||||
[TV (10,0)]
|
||||
[iOS (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[TV (10, 0)]
|
||||
[Native]
|
||||
public enum GKConnectionState : long {
|
||||
NotConnected,
|
||||
Connected,
|
||||
}
|
||||
|
||||
[iOS (10,0)]
|
||||
[Mac (10,12)]
|
||||
[TV (10,0)]
|
||||
[iOS (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[TV (10, 0)]
|
||||
[Native]
|
||||
public enum GKTransportType : long {
|
||||
Unreliable,
|
||||
Reliable,
|
||||
}
|
||||
|
||||
[Deprecated (PlatformName.MacOSX, 10,14)]
|
||||
[Deprecated (PlatformName.TvOS, 12,0)]
|
||||
[Deprecated (PlatformName.iOS, 12,0)]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 14)]
|
||||
[Deprecated (PlatformName.TvOS, 12, 0)]
|
||||
[Deprecated (PlatformName.iOS, 12, 0)]
|
||||
[Native]
|
||||
#if WATCH
|
||||
// removed in Xcode 10 but a breaking change (for us) to remove
|
||||
|
@ -244,7 +244,7 @@ namespace GameKit {
|
|||
}
|
||||
|
||||
// NSInteger -> GKChallenge.h
|
||||
[Mac (10,9)]
|
||||
[Mac (10, 9)]
|
||||
[Native]
|
||||
public enum GKChallengeState : long {
|
||||
Invalid = 0,
|
||||
|
@ -258,27 +258,26 @@ namespace GameKit {
|
|||
[Native]
|
||||
public enum GKGameCenterViewControllerState : long {
|
||||
Default = -1,
|
||||
Leaderboards ,
|
||||
Leaderboards,
|
||||
Achievements,
|
||||
Challenges,
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
LocalPlayerProfile = 3,
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
Dashboard = 4,
|
||||
[iOS (15,0)]
|
||||
[Mac (12,0)]
|
||||
[MacCatalyst (15,0)]
|
||||
[TV (15,0)]
|
||||
[iOS (15, 0)]
|
||||
[Mac (12, 0)]
|
||||
[MacCatalyst (15, 0)]
|
||||
[TV (15, 0)]
|
||||
[NoWatch]
|
||||
LocalPlayerFriendsList = 5,
|
||||
}
|
||||
|
||||
// NSInteger -> GKMatchmaker.h
|
||||
[Native]
|
||||
public enum GKInviteeResponse : long
|
||||
{
|
||||
public enum GKInviteeResponse : long {
|
||||
Accepted = 0,
|
||||
Declined = 1,
|
||||
Failed = 2,
|
||||
|
@ -289,17 +288,15 @@ namespace GameKit {
|
|||
|
||||
// NSUInteger -> GKMatchmaker.h
|
||||
[Native]
|
||||
public enum GKMatchType : ulong
|
||||
{
|
||||
public enum GKMatchType : ulong {
|
||||
PeerToPeer,
|
||||
Hosted,
|
||||
TurnBased
|
||||
}
|
||||
|
||||
// uint8_t -> GKTurnBasedMatch.h
|
||||
[iOS (7,0)]
|
||||
public enum GKTurnBasedExchangeStatus : sbyte
|
||||
{
|
||||
[iOS (7, 0)]
|
||||
public enum GKTurnBasedExchangeStatus : sbyte {
|
||||
Unknown,
|
||||
Active,
|
||||
Complete,
|
||||
|
@ -318,9 +315,12 @@ namespace GameKit {
|
|||
}
|
||||
|
||||
#if !NET
|
||||
[iOS (11,3)][Deprecated (PlatformName.iOS, 14,0, message: "Do not use; this API was removed.")]
|
||||
[Mac (10,13,4)][Deprecated (PlatformName.MacOSX, 11,0, message: "Do not use; this API was removed.")]
|
||||
[TV (11,3)][Deprecated (PlatformName.TvOS, 14,0, message: "Do not use; this API was removed.")]
|
||||
[iOS (11, 3)]
|
||||
[Deprecated (PlatformName.iOS, 14, 0, message: "Do not use; this API was removed.")]
|
||||
[Mac (10, 13, 4)]
|
||||
[Deprecated (PlatformName.MacOSX, 11, 0, message: "Do not use; this API was removed.")]
|
||||
[TV (11, 3)]
|
||||
[Deprecated (PlatformName.TvOS, 14, 0, message: "Do not use; this API was removed.")]
|
||||
[Native]
|
||||
public enum GKAuthenticationType : ulong {
|
||||
WithoutUI = 0,
|
||||
|
@ -329,51 +329,48 @@ namespace GameKit {
|
|||
}
|
||||
#endif
|
||||
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14,0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[iOS (14, 0)]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
public enum GKAccessPointLocation : long
|
||||
{
|
||||
public enum GKAccessPointLocation : long {
|
||||
TopLeading,
|
||||
TopTrailing,
|
||||
BottomLeading,
|
||||
BottomTrailing,
|
||||
}
|
||||
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14,0)]
|
||||
[Watch (7,0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[iOS (14, 0)]
|
||||
[Watch (7, 0)]
|
||||
[Native]
|
||||
public enum GKLeaderboardType : long
|
||||
{
|
||||
public enum GKLeaderboardType : long {
|
||||
Classic,
|
||||
Recurring,
|
||||
}
|
||||
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14,0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[iOS (14, 0)]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
public enum GKMatchmakingMode : long
|
||||
{
|
||||
public enum GKMatchmakingMode : long {
|
||||
Default = 0,
|
||||
NearbyOnly = 1,
|
||||
AutomatchOnly = 2,
|
||||
[TV (15,0)]
|
||||
[Mac (12,0)]
|
||||
[iOS (15,0)]
|
||||
[MacCatalyst (15,0)]
|
||||
[TV (15, 0)]
|
||||
[Mac (12, 0)]
|
||||
[iOS (15, 0)]
|
||||
[MacCatalyst (15, 0)]
|
||||
InviteOnly = 3,
|
||||
}
|
||||
|
||||
[Watch (7,4)]
|
||||
[TV (14,5)]
|
||||
[Mac (11,3)]
|
||||
[iOS (14,5)]
|
||||
[Watch (7, 4)]
|
||||
[TV (14, 5)]
|
||||
[Mac (11, 3)]
|
||||
[iOS (14, 5)]
|
||||
[Native]
|
||||
public enum GKFriendsAuthorizationStatus : long {
|
||||
NotDetermined = 0,
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace GameKit {
|
|||
ReceiverObject? receiver;
|
||||
public event EventHandler<GKDataReceivedEventArgs>? ReceiveData {
|
||||
add {
|
||||
if (receiver is null){
|
||||
if (receiver is null) {
|
||||
receiver = new ReceiverObject ();
|
||||
_SetDataReceiveHandler (receiver, IntPtr.Zero);
|
||||
MarkDirty ();
|
||||
|
@ -82,7 +82,7 @@ namespace GameKit {
|
|||
Mono_GKSessionDelegate EnsureDelegate ()
|
||||
{
|
||||
var del = WeakDelegate;
|
||||
if (del is null || (!(del is Mono_GKSessionDelegate))){
|
||||
if (del is null || (!(del is Mono_GKSessionDelegate))) {
|
||||
del = new Mono_GKSessionDelegate ();
|
||||
WeakDelegate = del;
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ namespace GameplayKit {
|
|||
return new GKQuadTree (min, max, minCellSize);
|
||||
}
|
||||
|
||||
[Deprecated (PlatformName.iOS, 10,0, message: "Empty stub (always return 'false') as this API is now rejected).")]
|
||||
[Deprecated (PlatformName.TvOS, 10,0, message: "Empty stub (always return 'false') as this API is now rejected).")]
|
||||
[Deprecated (PlatformName.iOS, 10, 0, message: "Empty stub (always return 'false') as this API is now rejected).")]
|
||||
[Deprecated (PlatformName.TvOS, 10, 0, message: "Empty stub (always return 'false') as this API is now rejected).")]
|
||||
public virtual bool RemoveData (NSObject data)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -36,9 +36,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
[Register ("GKObstacleGraph", SkipRegistration = true)]
|
||||
public partial class GKObstacleGraph<NodeType> : GKObstacleGraph where NodeType : GKGraphNode2D {
|
||||
|
@ -58,7 +58,7 @@ namespace GameplayKit {
|
|||
|
||||
public static new GKObstacleGraph<NodeType>? FromObstacles (GKPolygonObstacle [] obstacles, float bufferRadius)
|
||||
{
|
||||
return Runtime.GetNSObject <GKObstacleGraph<NodeType>> (GraphWithObstacles (obstacles, bufferRadius, new Class (typeof (NodeType))));
|
||||
return Runtime.GetNSObject<GKObstacleGraph<NodeType>> (GraphWithObstacles (obstacles, bufferRadius, new Class (typeof (NodeType))));
|
||||
}
|
||||
|
||||
public new NodeType [] GetNodes (GKPolygonObstacle obstacle)
|
||||
|
|
|
@ -25,7 +25,7 @@ using System.Runtime.InteropServices;
|
|||
namespace GameplayKit {
|
||||
public partial class GKPath {
|
||||
|
||||
public static GKPath FromPoints (Vector2[] points, float radius, bool cyclical)
|
||||
public static GKPath FromPoints (Vector2 [] points, float radius, bool cyclical)
|
||||
{
|
||||
if (points is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
|
||||
|
@ -34,7 +34,7 @@ namespace GameplayKit {
|
|||
try {
|
||||
PrepareBuffer (out buffer, ref points);
|
||||
|
||||
return FromPoints (buffer, (nuint)points.Length, radius, cyclical);
|
||||
return FromPoints (buffer, (nuint) points.Length, radius, cyclical);
|
||||
} finally {
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
|
@ -51,7 +51,7 @@ namespace GameplayKit {
|
|||
try {
|
||||
PrepareBuffer (out buffer, ref points);
|
||||
|
||||
Handle = InitWithPoints (buffer, (nuint)points.Length, radius, cyclical);
|
||||
Handle = InitWithPoints (buffer, (nuint) points.Length, radius, cyclical);
|
||||
} finally {
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
|
@ -64,9 +64,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
public static GKPath FromPoints (Vector3 [] points, float radius, bool cyclical)
|
||||
{
|
||||
|
@ -78,8 +78,7 @@ namespace GameplayKit {
|
|||
PrepareBuffer (out buffer, ref points);
|
||||
|
||||
return FromFloat3Points (buffer, (nuint) points.Length, radius, cyclical);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
}
|
||||
|
@ -91,9 +90,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
public GKPath (Vector3 [] points, float radius, bool cyclical)
|
||||
{
|
||||
|
@ -105,14 +104,13 @@ namespace GameplayKit {
|
|||
PrepareBuffer (out buffer, ref points);
|
||||
|
||||
Handle = InitWithFloat3Points (buffer, (nuint) points.Length, radius, cyclical);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
}
|
||||
}
|
||||
|
||||
static void PrepareBuffer<T> (out IntPtr buffer, ref T[] points) where T : struct
|
||||
static void PrepareBuffer<T> (out IntPtr buffer, ref T [] points) where T : struct
|
||||
{
|
||||
var type = typeof (T);
|
||||
// Vector3 is 12 bytes but vector_float3 is 16
|
||||
|
|
|
@ -33,9 +33,9 @@ namespace GameplayKit {
|
|||
|
||||
try {
|
||||
for (int i = 0; i < points.Length; i++)
|
||||
Marshal.StructureToPtr (points[i], IntPtr.Add (buffer, i * size), false);
|
||||
Marshal.StructureToPtr (points [i], IntPtr.Add (buffer, i * size), false);
|
||||
|
||||
return FromPoints (buffer, (nuint)points.Length);
|
||||
return FromPoints (buffer, (nuint) points.Length);
|
||||
} finally {
|
||||
if (buffer != IntPtr.Zero)
|
||||
Marshal.FreeHGlobal (buffer);
|
||||
|
@ -45,7 +45,7 @@ namespace GameplayKit {
|
|||
[ThreadStatic]
|
||||
static IntPtr ctor_pointer;
|
||||
|
||||
static unsafe IntPtr GetPointer (Vector2[] points)
|
||||
static unsafe IntPtr GetPointer (Vector2 [] points)
|
||||
{
|
||||
if (points is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (points));
|
||||
|
@ -61,7 +61,7 @@ namespace GameplayKit {
|
|||
var buffer = Marshal.AllocHGlobal (length);
|
||||
|
||||
for (int i = 0; i < points.Length; i++)
|
||||
Marshal.StructureToPtr (points[i], IntPtr.Add (buffer, i * size), false);
|
||||
Marshal.StructureToPtr (points [i], IntPtr.Add (buffer, i * size), false);
|
||||
|
||||
ctor_pointer = buffer;
|
||||
return ctor_pointer = buffer;
|
||||
|
|
|
@ -29,9 +29,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct GKBox {
|
||||
|
@ -45,9 +45,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct GKQuad {
|
||||
|
@ -61,9 +61,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct GKTriangle {
|
||||
|
|
|
@ -21,9 +21,9 @@ namespace GameplayKit {
|
|||
[SupportedOSPlatform ("macos10.12")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
public static class NSArray_GameplayKit {
|
||||
|
||||
|
|
|
@ -3,12 +3,11 @@ using ObjCRuntime;
|
|||
using Foundation;
|
||||
using System;
|
||||
|
||||
namespace HealthKit
|
||||
{
|
||||
namespace HealthKit {
|
||||
// NSInteger -> HKDefines.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKUpdateFrequency : long {
|
||||
Immediate = 1,
|
||||
|
@ -18,9 +17,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKDefines.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKAuthorizationStatus : long {
|
||||
NotDetermined = 0,
|
||||
|
@ -29,22 +28,22 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKDefines.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKBiologicalSex : long {
|
||||
NotSet = 0,
|
||||
Female,
|
||||
Male,
|
||||
[iOS (8,2)]
|
||||
[iOS (8, 2)]
|
||||
Other
|
||||
}
|
||||
|
||||
// NSInteger -> HKDefines.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKBloodType : long {
|
||||
NotSet = 0,
|
||||
|
@ -59,9 +58,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKMetadata.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKBodyTemperatureSensorLocation : long {
|
||||
Other = 0,
|
||||
|
@ -79,9 +78,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKMetadata.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKHeartRateSensorLocation : long {
|
||||
Other = 0,
|
||||
|
@ -94,9 +93,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKObjectType.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKQuantityAggregationStyle : long {
|
||||
Cumulative = 0,
|
||||
|
@ -112,27 +111,27 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKObjectType.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueSleepAnalysis : long {
|
||||
InBed,
|
||||
Asleep,
|
||||
[Watch (3,0), iOS (10,0)]
|
||||
[Watch (3, 0), iOS (10, 0)]
|
||||
Awake,
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
AsleepCore = 3,
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
AsleepDeep = 4,
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
AsleepREM = 5,
|
||||
}
|
||||
|
||||
// NSUInteger -> HKQuery.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum HKQueryOptions : ulong {
|
||||
|
@ -142,9 +141,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSUInteger -> HKStatistics.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum HKStatisticsOptions : ulong {
|
||||
|
@ -161,9 +160,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
// NSInteger -> HKUnit.h
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKMetricPrefix : long {
|
||||
None = 0,
|
||||
|
@ -184,9 +183,9 @@ namespace HealthKit
|
|||
}
|
||||
|
||||
[Native]
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
public enum HKWorkoutActivityType : ulong {
|
||||
AmericanFootball = 1,
|
||||
Archery,
|
||||
|
@ -249,35 +248,35 @@ namespace HealthKit
|
|||
WaterSports,
|
||||
Wrestling,
|
||||
Yoga,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Barre,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
CoreTraining,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
CrossCountrySkiing,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
DownhillSkiing,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Flexibility,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
HighIntensityIntervalTraining,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
JumpRope,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Kickboxing,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Pilates,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Snowboarding,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Stairs,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
StepTraining,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
WheelchairWalkPace,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
WheelchairRunPace,
|
||||
[iOS (11,0), Watch (4,0)]
|
||||
[iOS (11, 0), Watch (4, 0)]
|
||||
TaiChi,
|
||||
[iOS (11, 0), Watch (4, 0)]
|
||||
MixedCardio,
|
||||
|
@ -287,36 +286,40 @@ namespace HealthKit
|
|||
DiscSports,
|
||||
[iOS (13, 0), Watch (6, 0)]
|
||||
FitnessGaming,
|
||||
[iOS (14,0)][Watch (7,0)]
|
||||
[iOS (14, 0)]
|
||||
[Watch (7, 0)]
|
||||
CardioDance = 77,
|
||||
[iOS (14,0)][Watch (7,0)]
|
||||
[iOS (14, 0)]
|
||||
[Watch (7, 0)]
|
||||
SocialDance = 78,
|
||||
[iOS (14,0)][Watch (7,0)]
|
||||
[iOS (14, 0)]
|
||||
[Watch (7, 0)]
|
||||
Pickleball = 79,
|
||||
[iOS (14,0)][Watch (7,0)]
|
||||
[iOS (14, 0)]
|
||||
[Watch (7, 0)]
|
||||
Cooldown = 80,
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
SwimBikeRun = 82,
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
Transition = 83,
|
||||
[iOS (8,2)]
|
||||
[iOS (8, 2)]
|
||||
Other = 3000
|
||||
}
|
||||
|
||||
[Native]
|
||||
[Watch (2,0)]
|
||||
[iOS (8,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (13, 0)]
|
||||
public enum HKWorkoutEventType : long {
|
||||
Pause = 1,
|
||||
Resume,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Lap,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
Marker,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
MotionPaused,
|
||||
[iOS (10,0), Watch (3,0)]
|
||||
[iOS (10, 0), Watch (3, 0)]
|
||||
MotionResumed,
|
||||
[iOS (11, 0), Watch (4, 0)]
|
||||
Segment,
|
||||
|
@ -324,17 +327,17 @@ namespace HealthKit
|
|||
PauseOrResumeRequest,
|
||||
}
|
||||
|
||||
[Watch (2,0)]
|
||||
[iOS (9,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValue : long {
|
||||
NotApplicable = 0
|
||||
}
|
||||
|
||||
[Watch (2,0)]
|
||||
[iOS (9,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueCervicalMucusQuality : long {
|
||||
NotApplicable = 0,
|
||||
|
@ -345,9 +348,9 @@ namespace HealthKit
|
|||
EggWhite
|
||||
}
|
||||
|
||||
[Watch (2,0)]
|
||||
[iOS (9,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueMenstrualFlow : long {
|
||||
NotApplicable = 0,
|
||||
|
@ -355,13 +358,14 @@ namespace HealthKit
|
|||
Light,
|
||||
Medium,
|
||||
Heavy,
|
||||
[iOS (12,0)][Watch (5,0)]
|
||||
[iOS (12, 0)]
|
||||
[Watch (5, 0)]
|
||||
None,
|
||||
}
|
||||
|
||||
[Watch (2,0)]
|
||||
[iOS (9,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueOvulationTestResult : long {
|
||||
NotApplicable = 0,
|
||||
|
@ -376,26 +380,26 @@ namespace HealthKit
|
|||
EstrogenSurge = 4,
|
||||
}
|
||||
|
||||
[Watch (2,0)]
|
||||
[iOS (9,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueAppleStandHour : long {
|
||||
Stood = 0,
|
||||
Idle
|
||||
}
|
||||
|
||||
[iOS (13,0)]
|
||||
[Watch (6,0)]
|
||||
[Mac (13,0)]
|
||||
[iOS (13, 0)]
|
||||
[Watch (6, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueAudioExposureEvent : long {
|
||||
LoudEnvironment = 1,
|
||||
}
|
||||
|
||||
[Watch (2,0)]
|
||||
[iOS (9,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (2, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKFitzpatrickSkinType : long {
|
||||
NotSet = 0,
|
||||
|
@ -407,7 +411,7 @@ namespace HealthKit
|
|||
VI
|
||||
}
|
||||
|
||||
[Watch (3,0), iOS (10,0), Mac (13,0)]
|
||||
[Watch (3, 0), iOS (10, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKWheelchairUse : long {
|
||||
NotSet = 0,
|
||||
|
@ -415,7 +419,7 @@ namespace HealthKit
|
|||
Yes,
|
||||
}
|
||||
|
||||
[Watch (3,0), iOS (10,0), Mac (13,0)]
|
||||
[Watch (3, 0), iOS (10, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKWeatherCondition : long {
|
||||
None = 0,
|
||||
|
@ -448,7 +452,7 @@ namespace HealthKit
|
|||
Tornado,
|
||||
}
|
||||
|
||||
[Watch (3,0), iOS (10,0), Mac (13,0)]
|
||||
[Watch (3, 0), iOS (10, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKWorkoutSwimmingLocationType : long {
|
||||
Unknown = 0,
|
||||
|
@ -456,7 +460,7 @@ namespace HealthKit
|
|||
OpenWater,
|
||||
}
|
||||
|
||||
[Watch (3,0), iOS (10,0), Mac (13,0)]
|
||||
[Watch (3, 0), iOS (10, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKSwimmingStrokeStyle : long {
|
||||
Unknown = 0,
|
||||
|
@ -465,7 +469,7 @@ namespace HealthKit
|
|||
Backstroke,
|
||||
Breaststroke,
|
||||
Butterfly,
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
Kickboard = 6,
|
||||
}
|
||||
|
||||
|
@ -503,7 +507,7 @@ namespace HealthKit
|
|||
PredictionNonExercise,
|
||||
}
|
||||
|
||||
[NoWatch, iOS (12, 0), Mac (13,0)]
|
||||
[NoWatch, iOS (12, 0), Mac (13, 0)]
|
||||
public enum HKFhirResourceType {
|
||||
[Field ("HKFHIRResourceTypeAllergyIntolerance")]
|
||||
AllergyIntolerance,
|
||||
|
@ -551,16 +555,15 @@ namespace HealthKit
|
|||
CoverageRecord,
|
||||
}
|
||||
|
||||
[Watch (5,0), iOS (12,0), Mac (13,0)]
|
||||
[Watch (5, 0), iOS (12, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKAuthorizationRequestStatus : long
|
||||
{
|
||||
public enum HKAuthorizationRequestStatus : long {
|
||||
Unknown = 0,
|
||||
ShouldRequest,
|
||||
Unnecessary,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (13,6), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (13, 6), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueAppetiteChanges : long {
|
||||
Unspecified = 0,
|
||||
|
@ -569,27 +572,27 @@ namespace HealthKit
|
|||
Increased,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (14,0), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (14, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKAppleEcgAlgorithmVersion : long {
|
||||
Version1 = 1,
|
||||
Version2 = 2,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (14,0), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (14, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueEnvironmentalAudioExposureEvent : long {
|
||||
MomentaryLimit = 1,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (13,6), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (13, 6), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValuePresence : long {
|
||||
Present = 0,
|
||||
NotPresent,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (13,6), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (13, 6), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKCategoryValueSeverity : long {
|
||||
Unspecified = 0,
|
||||
|
@ -599,7 +602,7 @@ namespace HealthKit
|
|||
Severe,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (14,0), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (14, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKDevicePlacementSide : long {
|
||||
Unknown = 0,
|
||||
|
@ -608,7 +611,7 @@ namespace HealthKit
|
|||
Central,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (14,0), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (14, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKElectrocardiogramClassification : long {
|
||||
NotSet = 0,
|
||||
|
@ -621,13 +624,13 @@ namespace HealthKit
|
|||
Unrecognized = 100,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (14,0), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (14, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKElectrocardiogramLead : long {
|
||||
AppleWatchSimilarToLeadI = 1,
|
||||
}
|
||||
|
||||
[Watch (7,0), iOS (14,0), Mac (13,0)]
|
||||
[Watch (7, 0), iOS (14, 0), Mac (13, 0)]
|
||||
[Native]
|
||||
public enum HKElectrocardiogramSymptomsStatus : long {
|
||||
NotSet = 0,
|
||||
|
@ -645,19 +648,17 @@ namespace HealthKit
|
|||
Unknown,
|
||||
}
|
||||
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
[Native]
|
||||
public enum HKHeartRateRecoveryTestType : long
|
||||
{
|
||||
public enum HKHeartRateRecoveryTestType : long {
|
||||
MaxExercise = 1,
|
||||
PredictionSubMaxExercise,
|
||||
PredictionNonExercise,
|
||||
}
|
||||
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
[Native]
|
||||
public enum HKPrismBase : long
|
||||
{
|
||||
public enum HKPrismBase : long {
|
||||
None = 0,
|
||||
Up,
|
||||
Down,
|
||||
|
@ -665,27 +666,24 @@ namespace HealthKit
|
|||
Out,
|
||||
}
|
||||
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
[Native]
|
||||
public enum HKUserMotionContext : long
|
||||
{
|
||||
public enum HKUserMotionContext : long {
|
||||
NotSet = 0,
|
||||
Stationary,
|
||||
Active,
|
||||
}
|
||||
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
[Native]
|
||||
public enum HKVisionEye : long
|
||||
{
|
||||
public enum HKVisionEye : long {
|
||||
Left = 1,
|
||||
Right,
|
||||
}
|
||||
|
||||
[Watch (9,0), MacCatalyst (16,0), Mac (13,0), iOS (16,0), NoTV]
|
||||
[Watch (9, 0), MacCatalyst (16, 0), Mac (13, 0), iOS (16, 0), NoTV]
|
||||
[Native]
|
||||
public enum HKVisionPrescriptionType : ulong
|
||||
{
|
||||
public enum HKVisionPrescriptionType : ulong {
|
||||
Glasses = 1,
|
||||
Contacts,
|
||||
}
|
||||
|
|
|
@ -14,12 +14,11 @@ namespace HealthKit {
|
|||
[SupportedOSPlatform ("maccatalyst15.0")]
|
||||
[SupportedOSPlatform ("macos13.0")]
|
||||
#else
|
||||
[Watch (8,0)]
|
||||
[iOS (15,0)]
|
||||
[Mac (13,0)]
|
||||
[Watch (8, 0)]
|
||||
[iOS (15, 0)]
|
||||
[Mac (13, 0)]
|
||||
#endif
|
||||
public static class HKAppleWalkingSteadiness
|
||||
{
|
||||
public static class HKAppleWalkingSteadiness {
|
||||
|
||||
[DllImport (Constants.HealthKitLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
|
|
|
@ -23,8 +23,7 @@ using System.Collections.Generic;
|
|||
using NativeHandle = System.IntPtr;
|
||||
#endif
|
||||
|
||||
namespace HealthKit
|
||||
{
|
||||
namespace HealthKit {
|
||||
public partial class HKCategoryValueSleepAnalysisAsleep {
|
||||
|
||||
#if NET
|
||||
|
@ -33,7 +32,7 @@ namespace HealthKit
|
|||
[SupportedOSPlatform ("maccatalyst16.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)]
|
||||
[iOS (16, 0), Mac (13, 0), Watch (9, 0), NoTV, MacCatalyst (16, 0)]
|
||||
#endif // NET
|
||||
[DllImport (Constants.HealthKitLibrary)]
|
||||
static extern NativeHandle HKCategoryValueSleepAnalysisAsleepValues ();
|
||||
|
@ -44,14 +43,14 @@ namespace HealthKit
|
|||
[SupportedOSPlatform ("maccatalyst16.0")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)]
|
||||
[iOS (16, 0), Mac (13, 0), Watch (9, 0), NoTV, MacCatalyst (16, 0)]
|
||||
#endif // NET
|
||||
public static HashSet<HKCategoryValueSleepAnalysis> GetAsleepValues ()
|
||||
{
|
||||
using var values = Runtime.GetNSObject<NSSet<NSNumber>> (HKCategoryValueSleepAnalysisAsleepValues ())!;
|
||||
var hashSet = new HashSet<HKCategoryValueSleepAnalysis> ();
|
||||
foreach (NSNumber value in values) {
|
||||
hashSet.Add ((HKCategoryValueSleepAnalysis) (int)value);
|
||||
hashSet.Add ((HKCategoryValueSleepAnalysis) (int) value);
|
||||
}
|
||||
return hashSet;
|
||||
}
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
|
||||
using System;
|
||||
using Foundation;
|
||||
namespace HealthKit
|
||||
{
|
||||
namespace HealthKit {
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
public partial class HKQuantityType {
|
||||
public static HKQuantityType? Create (HKQuantityTypeIdentifier kind)
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace HealthKit
|
||||
{
|
||||
public partial class HKUnit
|
||||
{
|
||||
namespace HealthKit {
|
||||
public partial class HKUnit {
|
||||
public const double MolarMassBloodGlucose = 180.15588000005408;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace HomeKit {
|
|||
[SupportedOSPlatform ("tvos10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst14.0")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[iOS (9, 0)]
|
||||
#endif
|
||||
public HMActionSetType ActionSetType {
|
||||
get {
|
||||
|
|
|
@ -6,11 +6,10 @@ using Foundation;
|
|||
|
||||
namespace HomeKit {
|
||||
|
||||
partial class HMCharacteristic
|
||||
{
|
||||
partial class HMCharacteristic {
|
||||
public bool SupportsEventNotification {
|
||||
get {
|
||||
foreach (var p in Properties){
|
||||
foreach (var p in Properties) {
|
||||
if (p == HMCharacteristicPropertyInternal.SupportsEventNotification)
|
||||
return true;
|
||||
}
|
||||
|
@ -20,7 +19,7 @@ namespace HomeKit {
|
|||
|
||||
public bool Readable {
|
||||
get {
|
||||
foreach (var p in Properties){
|
||||
foreach (var p in Properties) {
|
||||
if (p == HMCharacteristicPropertyInternal.Readable)
|
||||
return true;
|
||||
}
|
||||
|
@ -30,7 +29,7 @@ namespace HomeKit {
|
|||
|
||||
public bool Writable {
|
||||
get {
|
||||
foreach (var p in Properties){
|
||||
foreach (var p in Properties) {
|
||||
if (p == HMCharacteristicPropertyInternal.Writable)
|
||||
return true;
|
||||
}
|
||||
|
@ -43,8 +42,8 @@ namespace HomeKit {
|
|||
[SupportedOSPlatform ("tvos10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst14.0")]
|
||||
#else
|
||||
[iOS (9,3)]
|
||||
[Watch (2,2)]
|
||||
[iOS (9, 3)]
|
||||
[Watch (2, 2)]
|
||||
#endif
|
||||
public bool Hidden {
|
||||
get {
|
||||
|
|
|
@ -7,8 +7,7 @@ using Foundation;
|
|||
|
||||
namespace HomeKit {
|
||||
|
||||
public partial class HMCharacteristicMetadata
|
||||
{
|
||||
public partial class HMCharacteristicMetadata {
|
||||
public HMCharacteristicMetadataUnits Units {
|
||||
get {
|
||||
var u = _Units;
|
||||
|
|
|
@ -12,8 +12,8 @@ namespace HomeKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos10.0")]
|
||||
#else
|
||||
[iOS (8,0)]
|
||||
[TV (10,0)]
|
||||
[iOS (8, 0)]
|
||||
[TV (10, 0)]
|
||||
#endif
|
||||
public class HMCharacteristicProperties {
|
||||
|
||||
|
|
|
@ -56,16 +56,16 @@ namespace HomeKit {
|
|||
protected HMChipServiceTopology (IntPtr handle) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public HMChipServiceTopology (NSCoder coder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
protected HMChipServiceTopology (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public HMChipServiceTopology (HMChipServiceHome[] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public HMChipServiceTopology (HMChipServiceHome [] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual HMChipServiceHome[] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual HMChipServiceHome [] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
} /* class HMChipServiceTopology */
|
||||
|
||||
[Obsolete ("This class is removed, use 'HMMatterRoom' instead.")]
|
||||
[Register("HMCHIPServiceRoom", SkipRegistration = true)]
|
||||
[Register ("HMCHIPServiceRoom", SkipRegistration = true)]
|
||||
public class HMChipServiceRoom : NSObject, INSCoding, INSCopying, INSSecureCoding {
|
||||
|
||||
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
@ -75,7 +75,7 @@ namespace HomeKit {
|
|||
protected HMChipServiceRoom (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public HMChipServiceRoom (NSUuid uuid, string name) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
@ -83,7 +83,7 @@ namespace HomeKit {
|
|||
} /* class HMChipServiceRoom */
|
||||
|
||||
[Obsolete ("This class is removed.")]
|
||||
[Register("HMCHIPServiceHome", SkipRegistration = true)]
|
||||
[Register ("HMCHIPServiceHome", SkipRegistration = true)]
|
||||
public partial class HMChipServiceHome : NSObject, INSCoding, INSCopying, INSSecureCoding {
|
||||
|
||||
public override IntPtr ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
@ -157,7 +157,7 @@ namespace HomeKit {
|
|||
public virtual string Name => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual NSUuid Uuid => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ namespace HomeKit {
|
|||
[UnsupportedOSPlatform ("maccatalyst16.1")]
|
||||
[UnsupportedOSPlatform ("macos13.0")]
|
||||
#endif
|
||||
[Register("HMMatterHome", SkipRegistration = true)]
|
||||
[Register ("HMMatterHome", SkipRegistration = true)]
|
||||
public partial class HMMatterHome : NSObject, INSCoding, INSCopying, INSSecureCoding {
|
||||
|
||||
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
@ -196,7 +196,7 @@ namespace HomeKit {
|
|||
[UnsupportedOSPlatform ("maccatalyst16.1")]
|
||||
[UnsupportedOSPlatform ("macos13.0")]
|
||||
#endif
|
||||
[Register("HMMatterTopology", SkipRegistration = true)]
|
||||
[Register ("HMMatterTopology", SkipRegistration = true)]
|
||||
public partial class HMMatterTopology : NSObject, INSCoding, INSCopying, INSSecureCoding {
|
||||
|
||||
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
@ -208,7 +208,7 @@ namespace HomeKit {
|
|||
public HMMatterTopology (HMMatterHome [] homes) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
public virtual HMMatterHome [] Homes => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual NSObject Copy (NSZone? zone)=> throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual NSObject Copy (NSZone? zone) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual void EncodeTo (NSCoder encoder) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ namespace HomeKit {
|
|||
[UnsupportedOSPlatform ("maccatalyst16.1")]
|
||||
[UnsupportedOSPlatform ("macos13.0")]
|
||||
#endif
|
||||
[Register("HMMatterRequestHandler", SkipRegistration = true)]
|
||||
[Register ("HMMatterRequestHandler", SkipRegistration = true)]
|
||||
public partial class HMMatterRequestHandler : NSObject, INSExtensionRequestHandling {
|
||||
public override NativeHandle ClassHandle => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
|
@ -231,7 +231,7 @@ namespace HomeKit {
|
|||
protected HMMatterRequestHandler (NSObjectFlag t) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
public virtual void FetchRooms (HMMatterHome home, HMFetchRoomHandler completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual Task<HMMatterRoom[]> FetchRoomsAsync (HMMatterHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual Task<HMMatterRoom []> FetchRoomsAsync (HMMatterHome home) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
||||
public virtual void PairAccessory (HMMatterHome home, string onboardingPayload, Action<NSError> completion) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
public virtual Task PairAccessoryAsync (HMMatterHome home, string onboardingPayload) => throw new InvalidOperationException (Constants.RemovedFromHomeKit);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -8,8 +8,7 @@ using Foundation;
|
|||
|
||||
namespace HomeKit {
|
||||
|
||||
public partial class HMHome
|
||||
{
|
||||
public partial class HMHome {
|
||||
public HMService []? GetServices (HMServiceType serviceTypes)
|
||||
{
|
||||
var arr = new ServiceTypeList<NSString> ();
|
||||
|
@ -96,8 +95,9 @@ namespace HomeKit {
|
|||
#if (WATCH || TVOS)
|
||||
[Obsolete ("This API is not available on this platform.")]
|
||||
#endif // WATCH || TVOS
|
||||
[Obsoleted (PlatformName.iOS, 9,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")]
|
||||
public virtual void RemoveUser (HMUser user, Action<NSError> completion) {
|
||||
[Obsoleted (PlatformName.iOS, 9, 0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")]
|
||||
public virtual void RemoveUser (HMUser user, Action<NSError> completion)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,9 @@ namespace HomeKit {
|
|||
#if (WATCH || TVOS)
|
||||
[Obsolete ("This API is not available on this platform.")]
|
||||
#endif // WATCH || TVOS
|
||||
[Obsoleted (PlatformName.iOS, 9,0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")]
|
||||
public virtual Task RemoveUserAsync (HMUser user) {
|
||||
[Obsoleted (PlatformName.iOS, 9, 0, PlatformArchitecture.All, message: "This API in now prohibited on iOS. Use 'ManageUsers' instead.")]
|
||||
public virtual Task RemoveUserAsync (HMUser user)
|
||||
{
|
||||
throw new NotSupportedException ();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace IOSurface {
|
|||
public int Lock (IOSurfaceLockOptions options, ref int seed)
|
||||
{
|
||||
unsafe {
|
||||
fixed (int *p = &seed){
|
||||
fixed (int* p = &seed) {
|
||||
return _Lock (options, (IntPtr) p);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace IOSurface {
|
|||
public int Unlock (IOSurfaceLockOptions options, ref int seed)
|
||||
{
|
||||
unsafe {
|
||||
fixed (int *p = &seed){
|
||||
fixed (int* p = &seed) {
|
||||
return _Unlock (options, (IntPtr) p);
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ namespace IOSurface {
|
|||
public int SetPurgeable (IOSurfacePurgeabilityState newState, ref IOSurfacePurgeabilityState oldState)
|
||||
{
|
||||
unsafe {
|
||||
fixed (IOSurfacePurgeabilityState *p = &oldState){
|
||||
fixed (IOSurfacePurgeabilityState* p = &oldState) {
|
||||
return _SetPurgeable (newState, (IntPtr) p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace IOSurface {
|
|||
#elif TVOS || IOS
|
||||
return SystemVersion.CheckiOS (12, 0);
|
||||
#else
|
||||
#error Unknown platform
|
||||
#error Unknown platform
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ using CoreGraphics;
|
|||
using Foundation;
|
||||
using ObjCRuntime;
|
||||
|
||||
namespace ImageIO
|
||||
{
|
||||
namespace ImageIO {
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios")]
|
||||
|
@ -25,8 +24,7 @@ namespace ImageIO
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
public static class CGImageAnimation
|
||||
{
|
||||
public static class CGImageAnimation {
|
||||
|
||||
public delegate void CGImageSourceAnimationHandler (nint index, CGImage image, out bool stop);
|
||||
|
||||
|
@ -127,8 +125,7 @@ namespace ImageIO
|
|||
//
|
||||
// This class bridges native block invocations that call into C#
|
||||
//
|
||||
static internal class SDCGImageSourceAnimationBlock
|
||||
{
|
||||
static internal class SDCGImageSourceAnimationBlock {
|
||||
static internal readonly DCGImageSourceAnimationBlock Handler = Invoke;
|
||||
|
||||
[MonoPInvokeCallback (typeof (DCGImageSourceAnimationBlock))]
|
||||
|
@ -142,12 +139,11 @@ namespace ImageIO
|
|||
}
|
||||
} /* class SDCGImageSourceAnimationBlock */
|
||||
|
||||
internal sealed class NIDCGImageSourceAnimationBlock : TrampolineBlockBase
|
||||
{
|
||||
internal sealed class NIDCGImageSourceAnimationBlock : TrampolineBlockBase {
|
||||
DCGImageSourceAnimationBlock invoker;
|
||||
|
||||
[BindingImpl (BindingImplOptions.Optimizable)]
|
||||
public unsafe NIDCGImageSourceAnimationBlock (BlockLiteral * block) : base (block)
|
||||
public unsafe NIDCGImageSourceAnimationBlock (BlockLiteral* block) : base (block)
|
||||
{
|
||||
invoker = block->GetDelegateForBlock<DCGImageSourceAnimationBlock> ();
|
||||
}
|
||||
|
@ -159,7 +155,7 @@ namespace ImageIO
|
|||
if (block == IntPtr.Zero)
|
||||
return null;
|
||||
var del = (CGImageSourceAnimationHandler) GetExistingManagedDelegate (block);
|
||||
return del ?? new NIDCGImageSourceAnimationBlock ( (BlockLiteral *) block).Invoke;
|
||||
return del ?? new NIDCGImageSourceAnimationBlock ((BlockLiteral*) block).Invoke;
|
||||
}
|
||||
|
||||
[BindingImpl (BindingImplOptions.Optimizable)]
|
||||
|
|
|
@ -41,8 +41,7 @@ using NativeHandle = System.IntPtr;
|
|||
|
||||
namespace ImageIO {
|
||||
|
||||
public partial class CGImageDestinationOptions
|
||||
{
|
||||
public partial class CGImageDestinationOptions {
|
||||
CGColor? destinationBackgroundColor;
|
||||
public CGColor? DestinationBackgroundColor {
|
||||
get { return destinationBackgroundColor; }
|
||||
|
@ -58,15 +57,14 @@ namespace ImageIO {
|
|||
}
|
||||
}
|
||||
|
||||
public partial class CGCopyImageSourceOptions
|
||||
{
|
||||
public partial class CGCopyImageSourceOptions {
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios7.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public CGImageMetadata? Metadata { get; set; }
|
||||
|
||||
|
@ -76,7 +74,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public bool MergeMetadata { get; set; }
|
||||
|
||||
|
@ -86,7 +84,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public bool ShouldExcludeXMP { get; set; }
|
||||
|
||||
|
@ -107,7 +105,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public DateTime? DateTime { get; set; }
|
||||
|
||||
|
@ -117,7 +115,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public int? Orientation { get; set; }
|
||||
|
||||
|
@ -178,13 +176,13 @@ namespace ImageIO {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional=true)]
|
||||
[Preserve (Conditional = true)]
|
||||
internal CGImageDestination (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
}
|
||||
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageDestinationGetTypeID")]
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageDestinationGetTypeID")]
|
||||
public extern static /* CFTypeID */ nint GetTypeID ();
|
||||
|
||||
[DllImport (Constants.ImageIOLibrary)]
|
||||
|
@ -332,7 +330,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.ImageIOLibrary)]
|
||||
extern static void CGImageDestinationAddImageAndMetadata (/* CGImageDestinationRef __nonnull */ IntPtr idst,
|
||||
|
@ -345,7 +343,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, NSDictionary? options)
|
||||
|
@ -361,7 +359,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public void AddImageAndMetadata (CGImage image, CGImageMetadata meta, CGImageDestinationOptions? options)
|
||||
{
|
||||
|
@ -375,7 +373,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.ImageIOLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
|
@ -389,7 +387,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
public bool CopyImageSource (CGImageSource image, NSDictionary? options, out NSError? error)
|
||||
|
@ -407,7 +405,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public bool CopyImageSource (CGImageSource image, CGCopyImageSourceOptions? options, out NSError? error)
|
||||
{
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public partial class CGImageMetadataEnumerateOptions {
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public partial class CGImageMetadata : NativeObject {
|
||||
#if !NET
|
||||
|
@ -80,7 +80,7 @@ namespace ImageIO {
|
|||
{
|
||||
}
|
||||
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageMetadataGetTypeID")]
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageMetadataGetTypeID")]
|
||||
public extern static /* CFTypeID */ nint GetTypeID ();
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public class CGImageMetadataTag : NativeObject {
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace ImageIO {
|
|||
}
|
||||
#endif
|
||||
|
||||
[Preserve (Conditional=true)]
|
||||
[Preserve (Conditional = true)]
|
||||
internal CGImageMetadataTag (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ namespace ImageIO {
|
|||
InitializeHandle (CGImageMetadataTagCreate (xmlns.Handle, prefix.GetHandle (), name.Handle, type, value));
|
||||
}
|
||||
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageMetadataTagGetTypeID")]
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageMetadataTagGetTypeID")]
|
||||
public extern static nint GetTypeID ();
|
||||
|
||||
|
||||
|
@ -141,7 +141,7 @@ namespace ImageIO {
|
|||
extern static /* CFArrayRef __nullable */ IntPtr CGImageMetadataTagCopyQualifiers (
|
||||
/* CGImageMetadataTagRef __nonnull */ IntPtr tag);
|
||||
|
||||
public CGImageMetadataTag?[]? GetQualifiers ()
|
||||
public CGImageMetadataTag? []? GetQualifiers ()
|
||||
{
|
||||
IntPtr result = CGImageMetadataTagCopyQualifiers (Handle);
|
||||
return CFArray.ArrayFromHandle<CGImageMetadataTag> (result, true);
|
||||
|
|
|
@ -71,8 +71,8 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
public bool ShouldCacheImmediately { get; set; }
|
||||
|
||||
|
@ -108,8 +108,8 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
#endif
|
||||
public int? SubsampleFactor { get; set; }
|
||||
|
||||
|
@ -134,10 +134,9 @@ namespace ImageIO {
|
|||
}
|
||||
#endif
|
||||
|
||||
public partial class CGImageSource : NativeObject
|
||||
{
|
||||
public partial class CGImageSource : NativeObject {
|
||||
#if !COREBUILD
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint="CGImageSourceGetTypeID")]
|
||||
[DllImport (Constants.ImageIOLibrary, EntryPoint = "CGImageSourceGetTypeID")]
|
||||
public extern static nint GetTypeID ();
|
||||
|
||||
[DllImport (Constants.ImageIOLibrary)]
|
||||
|
@ -150,7 +149,7 @@ namespace ImageIO {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
[Preserve (Conditional=true)]
|
||||
[Preserve (Conditional = true)]
|
||||
internal CGImageSource (NativeHandle handle, bool owns)
|
||||
: base (handle, owns)
|
||||
{
|
||||
|
@ -410,10 +409,10 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Mac (10,14)]
|
||||
[iOS (12,0)]
|
||||
[TV (12,0)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 14)]
|
||||
[iOS (12, 0)]
|
||||
[TV (12, 0)]
|
||||
[Watch (5, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.ImageIOLibrary)]
|
||||
extern static nuint CGImageSourceGetPrimaryImageIndex (IntPtr /* CGImageSource */ src);
|
||||
|
@ -424,10 +423,10 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("tvos12.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Mac (10,14)]
|
||||
[iOS (12,0)]
|
||||
[TV (12,0)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 14)]
|
||||
[iOS (12, 0)]
|
||||
[TV (12, 0)]
|
||||
[Watch (5, 0)]
|
||||
#endif
|
||||
public nuint GetPrimaryImageIndex ()
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
[EditorBrowsable (EditorBrowsableState.Advanced)]
|
||||
public CGImageMetadata? CopyMetadata (nint index, NSDictionary? options)
|
||||
|
@ -47,7 +47,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public CGImageMetadata? CopyMetadata (nint index, CGImageOptions? options)
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.ImageIOLibrary)]
|
||||
extern static void CGImageSourceRemoveCacheAtIndex (/* CGImageSourceRef __nonnull */ IntPtr isrc,
|
||||
|
@ -74,7 +74,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
[UnsupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public void RemoveCache (nint index)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace ImageIO {
|
|||
[SupportedOSPlatform ("macos")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public class CGMutableImageMetadata : CGImageMetadata {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace ImageIO {
|
|||
|
||||
// untyped enum -> CGImageMetadata.h
|
||||
// note: not used in any API
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
[ErrorDomain ("kCFErrorDomainCGImageMetadata")]
|
||||
public enum CGImageMetadataErrors {
|
||||
Unknown = 0,
|
||||
|
@ -26,7 +26,7 @@ namespace ImageIO {
|
|||
}
|
||||
|
||||
// untyped enum -> CGImageMetadata.h
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
public enum CGImageMetadataType {
|
||||
Invalid = -1,
|
||||
Default = 0,
|
||||
|
@ -51,7 +51,8 @@ namespace ImageIO {
|
|||
|
||||
// untyped enum / #defines
|
||||
// used with kCGImagePropertyPNGCompressionFilter
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Flags]
|
||||
public enum CGImagePropertyPngFilters {
|
||||
No = 0,
|
||||
|
@ -63,8 +64,7 @@ namespace ImageIO {
|
|||
}
|
||||
|
||||
[Mac (10, 15), iOS (13, 0), TV (13, 0), Watch (6, 0)]
|
||||
public enum CGImageAnimationStatus
|
||||
{
|
||||
public enum CGImageAnimationStatus {
|
||||
Ok = 0,
|
||||
ParameterError = -22140,
|
||||
CorruptInputImage = -22141,
|
||||
|
@ -74,7 +74,7 @@ namespace ImageIO {
|
|||
}
|
||||
|
||||
// Yes, no [Native] here
|
||||
[Mac (11,0), iOS (14,1), TV (14,2), Watch (7,1)]
|
||||
[Mac (11, 0), iOS (14, 1), TV (14, 2), Watch (7, 1)]
|
||||
public enum CGImagePropertyTgaCompression : uint {
|
||||
None = 0,
|
||||
Rle,
|
||||
|
|
|
@ -26,12 +26,11 @@ namespace Intents {
|
|||
[iOS (10, 0)]
|
||||
[Mac (10, 12, 0, PlatformArchitecture.Arch64)]
|
||||
[Watch (3, 2)]
|
||||
[TV (14,0)]
|
||||
[TV (14, 0)]
|
||||
#endif
|
||||
[Register ("INIntentResolutionResult", SkipRegistration = true)]
|
||||
public sealed partial class INIntentResolutionResult<ObjectType> : INIntentResolutionResult
|
||||
where ObjectType : class, INativeObject
|
||||
{
|
||||
where ObjectType : class, INativeObject {
|
||||
internal INIntentResolutionResult (NativeHandle handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
@ -63,9 +62,9 @@ namespace Intents {
|
|||
[SupportedOSPlatform ("tvos14.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (6,0)]
|
||||
[iOS (13,0)]
|
||||
[Mac (11,0)]
|
||||
[Watch (6, 0)]
|
||||
[iOS (13, 0)]
|
||||
[Mac (11, 0)]
|
||||
#endif
|
||||
public static INIntentResolutionResult GetUnsupported (nint reason) => throw new NotImplementedException ("All subclasses of INIntentResolutionResult must re-implement this method");
|
||||
|
||||
|
@ -75,9 +74,9 @@ namespace Intents {
|
|||
[SupportedOSPlatform ("tvos14.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (6,0)]
|
||||
[iOS (13,0)]
|
||||
[Mac (11,0)]
|
||||
[Watch (6, 0)]
|
||||
[iOS (13, 0)]
|
||||
[Mac (11, 0)]
|
||||
#endif
|
||||
public static INIntentResolutionResult GetConfirmationRequired (NSObject itemToConfirm, nint reason) => throw new NotImplementedException ("All subclasses of INIntentResolutionResult must re-implement this method");
|
||||
|
||||
|
|
|
@ -5,12 +5,10 @@ using ObjCRuntime;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace Intents
|
||||
{
|
||||
namespace Intents {
|
||||
|
||||
#if !TVOS
|
||||
public partial class INPerson
|
||||
{
|
||||
public partial class INPerson {
|
||||
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios15.0")]
|
||||
|
@ -18,9 +16,9 @@ namespace Intents
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Introduced (PlatformName.iOS, 15,0)]
|
||||
[Introduced (PlatformName.MacOSX, 12,0)]
|
||||
[Introduced (PlatformName.WatchOS, 8,0)]
|
||||
[Introduced (PlatformName.iOS, 15, 0)]
|
||||
[Introduced (PlatformName.MacOSX, 12, 0)]
|
||||
[Introduced (PlatformName.WatchOS, 8, 0)]
|
||||
#endif
|
||||
public enum INPersonType {
|
||||
Me = 0,
|
||||
|
@ -33,9 +31,9 @@ namespace Intents
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Introduced (PlatformName.iOS, 15,0)]
|
||||
[Introduced (PlatformName.MacOSX, 12,0)]
|
||||
[Introduced (PlatformName.WatchOS, 8,0)]
|
||||
[Introduced (PlatformName.iOS, 15, 0)]
|
||||
[Introduced (PlatformName.MacOSX, 12, 0)]
|
||||
[Introduced (PlatformName.WatchOS, 8, 0)]
|
||||
#endif
|
||||
public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType) :
|
||||
this (personHandle, nameComponents, displayName, image, contactIdentifier, customIdentifier, isMe, suggestionType, INPersonType.Me)
|
||||
|
@ -48,9 +46,9 @@ namespace Intents
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Introduced (PlatformName.iOS, 15,0)]
|
||||
[Introduced (PlatformName.MacOSX, 12,0)]
|
||||
[Introduced (PlatformName.WatchOS, 8,0)]
|
||||
[Introduced (PlatformName.iOS, 15, 0)]
|
||||
[Introduced (PlatformName.MacOSX, 12, 0)]
|
||||
[Introduced (PlatformName.WatchOS, 8, 0)]
|
||||
#endif
|
||||
public INPerson (INPersonHandle personHandle, NSPersonNameComponents? nameComponents, string? displayName, INImage? image, string? contactIdentifier, string? customIdentifier, bool isMe, INPersonSuggestionType suggestionType, INPersonType personType) : base (NSObjectFlag.Empty)
|
||||
{
|
||||
|
|
|
@ -19,7 +19,8 @@ namespace JavaScriptCore {
|
|||
Number,
|
||||
String,
|
||||
Object,
|
||||
[iOS (13,0)][Mac (10,15)]
|
||||
[iOS (13, 0)]
|
||||
[Mac (10, 15)]
|
||||
Symbol,
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace JavaScriptCore {
|
|||
|
||||
public partial class JSContext {
|
||||
|
||||
public JSValue this[NSObject key] {
|
||||
public JSValue this [NSObject key] {
|
||||
get { return _GetObject (key); }
|
||||
set { _SetObject (value, key); }
|
||||
}
|
||||
|
@ -31,16 +31,16 @@ namespace JavaScriptCore {
|
|||
static public JSValue From (string value, JSContext context)
|
||||
{
|
||||
using (var str = new NSString (value)) {
|
||||
return From ((NSObject)str, context);
|
||||
return From ((NSObject) str, context);
|
||||
}
|
||||
}
|
||||
|
||||
public JSValue this[nuint index] {
|
||||
public JSValue this [nuint index] {
|
||||
get { return _ObjectAtIndexedSubscript (index); }
|
||||
set { _SetObject (value, index); }
|
||||
}
|
||||
|
||||
public JSValue this[NSObject key] {
|
||||
public JSValue this [NSObject key] {
|
||||
get { return _ObjectForKeyedSubscript (key); }
|
||||
set { _SetObject (value, key); }
|
||||
}
|
||||
|
|
|
@ -4,26 +4,32 @@ using Foundation;
|
|||
|
||||
namespace LocalAuthentication {
|
||||
|
||||
[iOS (8,0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (10, 10)]
|
||||
[NoTV]
|
||||
[Native]
|
||||
public enum LAPolicy : long {
|
||||
[Mac (10,12,2), NoWatch]
|
||||
[Mac (10, 12, 2), NoWatch]
|
||||
DeviceOwnerAuthenticationWithBiometrics = 1,
|
||||
DeviceOwnerAuthentication = 2,
|
||||
[NoiOS][Mac (10,15)][NoWatch]
|
||||
[NoiOS]
|
||||
[Mac (10, 15)]
|
||||
[NoWatch]
|
||||
DeviceOwnerAuthenticationWithWatch = 3,
|
||||
[NoiOS][Mac (10,15)][NoWatch]
|
||||
[NoiOS]
|
||||
[Mac (10, 15)]
|
||||
[NoWatch]
|
||||
DeviceOwnerAuthenticationWithBiometricsOrWatch = 4,
|
||||
[Obsolete ("Use DeviceOwnerAuthenticationWithBiometricsOrWatch enum value instead.")]
|
||||
[NoiOS][Mac (10,15)][NoWatch]
|
||||
[NoiOS]
|
||||
[Mac (10, 15)]
|
||||
[NoWatch]
|
||||
OwnerAuthenticationWithBiometricsOrWatch = DeviceOwnerAuthenticationWithBiometricsOrWatch,
|
||||
[NoMac, NoiOS, NoMacCatalyst, Watch (9,0)]
|
||||
[NoMac, NoiOS, NoMacCatalyst, Watch (9, 0)]
|
||||
DeviceOwnerAuthenticationWithWristDetection = 5,
|
||||
}
|
||||
|
||||
[iOS (8,0)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (10, 10)]
|
||||
[NoTV]
|
||||
[Native ("LAError")]
|
||||
|
@ -43,17 +49,17 @@ namespace LocalAuthentication {
|
|||
|
||||
#if !NET
|
||||
/// Authentication could not start, because Touch ID is not available on the device.
|
||||
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryNotAvailable' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryNotAvailable' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'BiometryNotAvailable' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'BiometryNotAvailable' instead.")]
|
||||
TouchIDNotAvailable = BiometryNotAvailable,
|
||||
|
||||
/// Authentication could not start, because Touch ID has no enrolled fingers.
|
||||
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryNotEnrolled' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryNotEnrolled' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'BiometryNotEnrolled' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'BiometryNotEnrolled' instead.")]
|
||||
TouchIDNotEnrolled = BiometryNotEnrolled,
|
||||
|
||||
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'BiometryLockout' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'BiometryLockout' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'BiometryLockout' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'BiometryLockout' instead.")]
|
||||
TouchIDLockout = BiometryLockout,
|
||||
#endif
|
||||
AppCancel = -9,
|
||||
|
@ -75,16 +81,16 @@ namespace LocalAuthentication {
|
|||
NotInteractive = -1004,
|
||||
}
|
||||
|
||||
[iOS (9,0), Mac (10,11), Watch (3,0), NoTV]
|
||||
[iOS (9, 0), Mac (10, 11), Watch (3, 0), NoTV]
|
||||
[Native]
|
||||
public enum LACredentialType : long {
|
||||
ApplicationPassword = 0,
|
||||
[iOS (13,4), Mac (10,15,4), NoWatch, NoTV]
|
||||
[iOS (13, 4), Mac (10, 15, 4), NoWatch, NoTV]
|
||||
SmartCardPin = -3,
|
||||
}
|
||||
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[NoTV]
|
||||
[Native]
|
||||
public enum LAAccessControlOperation : long {
|
||||
|
@ -92,16 +98,17 @@ namespace LocalAuthentication {
|
|||
UseItem,
|
||||
CreateKey,
|
||||
UseKeySign,
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
UseKeyDecrypt,
|
||||
[iOS (10,0)][Mac (10,12)]
|
||||
[iOS (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
UseKeyKeyExchange,
|
||||
}
|
||||
|
||||
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV]
|
||||
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum LARightState : long
|
||||
{
|
||||
public enum LARightState : long {
|
||||
Unknown = 0,
|
||||
Authorizing = 1,
|
||||
Authorized = 2,
|
||||
|
|
|
@ -15,9 +15,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCActivationTypeExtensions {
|
||||
|
@ -37,9 +37,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCArithmeticOperationExtensions {
|
||||
|
@ -59,9 +59,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCPaddingPolicyExtensions {
|
||||
|
@ -81,9 +81,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCLossTypeExtensions {
|
||||
|
@ -103,9 +103,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCReductionTypeExtensions {
|
||||
|
@ -125,9 +125,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCPaddingTypeExtensions {
|
||||
|
@ -147,9 +147,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCConvolutionTypeExtensions {
|
||||
|
@ -169,9 +169,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCPoolingTypeExtensions {
|
||||
|
@ -191,9 +191,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCSoftmaxOperationExtensions {
|
||||
|
@ -213,9 +213,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCSampleModeExtensions {
|
||||
|
@ -235,9 +235,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("macos11.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (14,0)]
|
||||
[TV (14,0)]
|
||||
[Mac (11,0)]
|
||||
[iOS (14, 0)]
|
||||
[TV (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCLstmResultModeExtensions {
|
||||
|
@ -257,9 +257,9 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("ios14.5")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (14,5)]
|
||||
[Mac (11,3)]
|
||||
[iOS (14,5)]
|
||||
[TV (14, 5)]
|
||||
[Mac (11, 3)]
|
||||
[iOS (14, 5)]
|
||||
[NoWatch]
|
||||
#endif
|
||||
public static class MLCComparisonOperationExtensions {
|
||||
|
@ -280,10 +280,10 @@ namespace MLCompute {
|
|||
[SupportedOSPlatform ("maccatalyst15.0")]
|
||||
#else
|
||||
[NoWatch]
|
||||
[TV (15,0)]
|
||||
[Mac (12,0)]
|
||||
[iOS (15,0)]
|
||||
[MacCatalyst (15,0)]
|
||||
[TV (15, 0)]
|
||||
[Mac (12, 0)]
|
||||
[iOS (15, 0)]
|
||||
[MacCatalyst (15, 0)]
|
||||
#endif
|
||||
public static class MLCGradientClippingTypeExtensions {
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ namespace MapKit {
|
|||
// NSUInteger -> MKDirectionsTypes.h
|
||||
[NoWatch]
|
||||
[Native]
|
||||
[TV (9,2)]
|
||||
[iOS (7,0)]
|
||||
[TV (9, 2)]
|
||||
[iOS (7, 0)]
|
||||
public enum MKDirectionsTransportType : ulong {
|
||||
Automobile = 1 << 0,
|
||||
Walking = 1 << 1,
|
||||
|
@ -32,7 +32,7 @@ namespace MapKit {
|
|||
}
|
||||
|
||||
// NSUInteger -> MKTypes.h
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
public enum MKMapType : ulong {
|
||||
|
@ -41,14 +41,16 @@ namespace MapKit {
|
|||
Hybrid,
|
||||
SatelliteFlyover,
|
||||
HybridFlyover,
|
||||
[iOS (11,0)][TV (11,0)][Mac (10,13)]
|
||||
[iOS (11, 0)]
|
||||
[TV (11, 0)]
|
||||
[Mac (10, 13)]
|
||||
MutedStandard,
|
||||
}
|
||||
|
||||
// NSUInteger -> MKDistanceFormatter.h
|
||||
[Native]
|
||||
[TV (9,2)]
|
||||
[iOS (7,0)]
|
||||
[TV (9, 2)]
|
||||
[iOS (7, 0)]
|
||||
public enum MKDistanceFormatterUnits : ulong {
|
||||
Default,
|
||||
Metric,
|
||||
|
@ -58,8 +60,8 @@ namespace MapKit {
|
|||
|
||||
// NSUInteger -> MKDistanceFormatter.h
|
||||
[Native]
|
||||
[TV (9,2)]
|
||||
[iOS (7,0)]
|
||||
[TV (9, 2)]
|
||||
[iOS (7, 0)]
|
||||
public enum MKDistanceFormatterUnitStyle : ulong {
|
||||
Default = 0,
|
||||
Abbreviated,
|
||||
|
@ -67,17 +69,17 @@ namespace MapKit {
|
|||
}
|
||||
|
||||
// NSInteger -> MKMapView.h
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
public enum MKOverlayLevel : long {
|
||||
AboveRoads = 0,
|
||||
AboveLabels,
|
||||
}
|
||||
|
||||
// NSUInteger -> MKTypes.h
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
[ErrorDomain ("MKErrorDomain")]
|
||||
|
@ -102,13 +104,13 @@ namespace MapKit {
|
|||
[NoTV]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'MKPinAnnotationView.PinTintColor' instead.")]
|
||||
[Deprecated (PlatformName.iOS, 9, 0, message: "Use 'MKPinAnnotationView.PinTintColor' instead.")]
|
||||
public enum MKPinAnnotationColor : ulong {
|
||||
Red, Green, Purple
|
||||
}
|
||||
|
||||
// NSUInteger -> MKTypes.h
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
[NoWatch]
|
||||
[Native]
|
||||
public enum MKUserTrackingMode : ulong {
|
||||
|
@ -122,7 +124,9 @@ namespace MapKit {
|
|||
#endif
|
||||
}
|
||||
|
||||
[TV (9,2)][NoWatch][iOS (9,3)]
|
||||
[TV (9, 2)]
|
||||
[NoWatch]
|
||||
[iOS (9, 3)]
|
||||
[Native]
|
||||
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'MKLocalSearchCompleterResultType' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'MKLocalSearchCompleterResultType' instead.")]
|
||||
|
@ -132,23 +136,34 @@ namespace MapKit {
|
|||
Only
|
||||
}
|
||||
|
||||
[TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13)]
|
||||
[TV (11, 0)]
|
||||
[NoWatch]
|
||||
[iOS (11, 0)]
|
||||
[Mac (10, 13)]
|
||||
[Native]
|
||||
public enum MKAnnotationViewCollisionMode : long {
|
||||
Rectangle,
|
||||
Circle,
|
||||
[TV (14,0)][iOS (14,0)][Mac (11,0)]
|
||||
[TV (14, 0)]
|
||||
[iOS (14, 0)]
|
||||
[Mac (11, 0)]
|
||||
None,
|
||||
}
|
||||
|
||||
[TV (11,0)][NoWatch][iOS (11,0)][NoMac]
|
||||
[TV (11, 0)]
|
||||
[NoWatch]
|
||||
[iOS (11, 0)]
|
||||
[NoMac]
|
||||
[Native]
|
||||
public enum MKScaleViewAlignment : long {
|
||||
Leading,
|
||||
Trailing,
|
||||
}
|
||||
|
||||
[TV (11,0)][NoWatch][iOS (11,0)][Mac (10,13)]
|
||||
[TV (11, 0)]
|
||||
[NoWatch]
|
||||
[iOS (11, 0)]
|
||||
[Mac (10, 13)]
|
||||
[Native]
|
||||
public enum MKFeatureVisibility : long {
|
||||
Adaptive,
|
||||
|
@ -157,72 +172,64 @@ namespace MapKit {
|
|||
}
|
||||
|
||||
[Flags]
|
||||
[TV (13,0), NoWatch, Mac (10,15), iOS (13,0)]
|
||||
[TV (13, 0), NoWatch, Mac (10, 15), iOS (13, 0)]
|
||||
[Native]
|
||||
public enum MKLocalSearchCompleterResultType : ulong
|
||||
{
|
||||
public enum MKLocalSearchCompleterResultType : ulong {
|
||||
Address = 1 << 0,
|
||||
PointOfInterest = 1 << 1,
|
||||
Query = 1 << 2,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
[TV (13,0), NoWatch, Mac (10,15), iOS (13,0)]
|
||||
[TV (13, 0), NoWatch, Mac (10, 15), iOS (13, 0)]
|
||||
[Native]
|
||||
public enum MKLocalSearchResultType : ulong
|
||||
{
|
||||
public enum MKLocalSearchResultType : ulong {
|
||||
Address = 1 << 0,
|
||||
PointOfInterest = 1 << 1,
|
||||
}
|
||||
|
||||
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)]
|
||||
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
|
||||
[Native]
|
||||
public enum MKDirectionsRoutePreference : long
|
||||
{
|
||||
public enum MKDirectionsRoutePreference : long {
|
||||
Any = 0,
|
||||
Avoid,
|
||||
}
|
||||
|
||||
[Flags]
|
||||
[NoMac, iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV]
|
||||
[NoMac, iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum MKMapFeatureOptions : long
|
||||
{
|
||||
PointsOfInterest = 1 << (int)MKMapFeatureType.PointOfInterest,
|
||||
Territories = 1 << (int)MKMapFeatureType.Territory,
|
||||
PhysicalFeatures = 1 << (int)MKMapFeatureType.PhysicalFeature,
|
||||
public enum MKMapFeatureOptions : long {
|
||||
PointsOfInterest = 1 << (int) MKMapFeatureType.PointOfInterest,
|
||||
Territories = 1 << (int) MKMapFeatureType.Territory,
|
||||
PhysicalFeatures = 1 << (int) MKMapFeatureType.PhysicalFeature,
|
||||
}
|
||||
|
||||
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV]
|
||||
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum MKLookAroundBadgePosition : long
|
||||
{
|
||||
public enum MKLookAroundBadgePosition : long {
|
||||
TopLeading = 0,
|
||||
TopTrailing,
|
||||
BottomTrailing,
|
||||
}
|
||||
|
||||
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)]
|
||||
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
|
||||
[Native]
|
||||
public enum MKMapElevationStyle : long
|
||||
{
|
||||
public enum MKMapElevationStyle : long {
|
||||
Flat = 0,
|
||||
Realistic,
|
||||
}
|
||||
|
||||
[NoMac, iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV]
|
||||
[NoMac, iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
|
||||
[Native]
|
||||
public enum MKMapFeatureType : long
|
||||
{
|
||||
public enum MKMapFeatureType : long {
|
||||
PointOfInterest = 0,
|
||||
Territory,
|
||||
PhysicalFeature,
|
||||
}
|
||||
|
||||
[Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)]
|
||||
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (16, 0)]
|
||||
[Native]
|
||||
public enum MKStandardMapEmphasisStyle : long
|
||||
{
|
||||
public enum MKStandardMapEmphasisStyle : long {
|
||||
Default = 0,
|
||||
Muted,
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("macos10.13")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (11,0)]
|
||||
[TV (11, 0)]
|
||||
[NoWatch]
|
||||
[iOS (11,0)]
|
||||
[Mac (10,13)]
|
||||
[iOS (11, 0)]
|
||||
[Mac (10, 13)]
|
||||
#endif
|
||||
#if WATCH && !NET
|
||||
[Obsolete ("This API is not available on this platform.")]
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace MapKit {
|
|||
if (points.Length == 0)
|
||||
return PolylineWithPoints (IntPtr.Zero, 0);
|
||||
|
||||
fixed (MKMapPoint *first = &points [0]){
|
||||
fixed (MKMapPoint* first = &points [0]) {
|
||||
return PolylineWithPoints ((IntPtr) first, points.Length);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace MapKit {
|
|||
if (coords.Length == 0)
|
||||
return PolylineWithCoordinates (IntPtr.Zero, 0);
|
||||
|
||||
fixed (CLLocationCoordinate2D *first = &coords [0]){
|
||||
fixed (CLLocationCoordinate2D* first = &coords [0]) {
|
||||
return PolylineWithCoordinates ((IntPtr) first, coords.Length);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,13 +45,13 @@ namespace MapKit {
|
|||
tcs.SetCanceled ();
|
||||
} else {
|
||||
var tcr = token.Register (() => { this.Cancel (); tcs.TrySetCanceled (); });
|
||||
Start((response, error) => {
|
||||
Start ((response, error) => {
|
||||
tcr.Dispose ();
|
||||
if (token.IsCancellationRequested) {
|
||||
tcs.TrySetCanceled ();
|
||||
} else {
|
||||
if (error is not null)
|
||||
tcs.SetException (new NSErrorException(error));
|
||||
tcs.SetException (new NSErrorException (error));
|
||||
else
|
||||
tcs.SetResult (response);
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[UnsupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
[NoTV]
|
||||
[Watch (3,0)]
|
||||
[Mac (10,12)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 12)]
|
||||
#endif
|
||||
Default
|
||||
}
|
||||
|
@ -39,8 +39,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#endif
|
||||
public class MKLaunchOptions
|
||||
{
|
||||
public class MKLaunchOptions {
|
||||
public MKDirectionsMode? DirectionsMode { get; set; }
|
||||
#if !WATCH // MapType: __WATCHOS_PROHIBITED
|
||||
public MKMapType? MapType { get; set; }
|
||||
|
@ -58,7 +57,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[iOS (7, 0)]
|
||||
#endif
|
||||
public MKMapCamera? Camera { get; set; }
|
||||
#endif
|
||||
|
@ -82,10 +81,10 @@ namespace MapKit {
|
|||
var keys = new NSObject [n];
|
||||
var values = new NSObject [n];
|
||||
int i = 0;
|
||||
if (DirectionsMode.HasValue){
|
||||
if (DirectionsMode.HasValue) {
|
||||
keys [i] = MKMapItem.MKLaunchOptionsDirectionsModeKey;
|
||||
NSString v = MKMapItem.MKLaunchOptionsDirectionsModeDriving;
|
||||
switch (DirectionsMode.Value){
|
||||
switch (DirectionsMode.Value) {
|
||||
case MKDirectionsMode.Driving:
|
||||
v = MKMapItem.MKLaunchOptionsDirectionsModeDriving;
|
||||
break;
|
||||
|
@ -105,21 +104,21 @@ namespace MapKit {
|
|||
}
|
||||
|
||||
#if !WATCH // MapType: __WATCHOS_PROHIBITED
|
||||
if (MapType.HasValue){
|
||||
if (MapType.HasValue) {
|
||||
keys [i] = MKMapItem.MKLaunchOptionsMapTypeKey;
|
||||
values [i++] = new NSNumber ((int) MapType.Value);
|
||||
}
|
||||
#endif
|
||||
if (MapCenter.HasValue){
|
||||
if (MapCenter.HasValue) {
|
||||
keys [i] = MKMapItem.MKLaunchOptionsMapCenterKey;
|
||||
values [i++] = NSValue.FromMKCoordinate (MapCenter.Value);
|
||||
}
|
||||
if (MapSpan.HasValue){
|
||||
if (MapSpan.HasValue) {
|
||||
keys [i] = MKMapItem.MKLaunchOptionsMapSpanKey;
|
||||
values [i++] = NSValue.FromMKCoordinateSpan (MapSpan.Value);
|
||||
}
|
||||
#if !WATCH // ShowsTraffic: __WATCHOS_PROHIBITED
|
||||
if (ShowTraffic.HasValue){
|
||||
if (ShowTraffic.HasValue) {
|
||||
keys [i] = MKMapItem.MKLaunchOptionsShowsTrafficKey;
|
||||
values [i++] = new NSNumber (ShowTraffic.Value);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace MapKit {
|
|||
public partial class MKMultiPoint {
|
||||
public unsafe MKMapPoint [] Points {
|
||||
get {
|
||||
var source = (MKMapPoint *) _Points;
|
||||
var source = (MKMapPoint*) _Points;
|
||||
nint n = PointCount;
|
||||
var result = new MKMapPoint [n];
|
||||
for (int i = 0; i < n; i++)
|
||||
|
@ -26,7 +26,7 @@ namespace MapKit {
|
|||
{
|
||||
var range = new NSRange (first, count);
|
||||
var target = new CLLocationCoordinate2D [count];
|
||||
fixed (CLLocationCoordinate2D *firstE = &target [0]){
|
||||
fixed (CLLocationCoordinate2D* firstE = &target [0]) {
|
||||
GetCoords ((IntPtr) firstE, range);
|
||||
}
|
||||
return target;
|
||||
|
|
|
@ -23,8 +23,8 @@ namespace MapKit {
|
|||
[UnsupportedOSPlatform ("ios7.0")]
|
||||
[ObsoletedOSPlatform ("ios7.0", "Use 'MKOverlayRenderer' instead.")]
|
||||
#else
|
||||
[TV (9,2)]
|
||||
[Mac (10,9)]
|
||||
[TV (9, 2)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
[DllImport (Constants.MapKitLibrary)]
|
||||
public static extern nfloat MKRoadWidthAtZoomScale (/* MKZoomScale */ nfloat zoomScale);
|
||||
|
|
|
@ -13,11 +13,11 @@ namespace MapKit {
|
|||
}
|
||||
|
||||
public partial class MKPointOfInterestFilter {
|
||||
public MKPointOfInterestFilter (MKPointOfInterestCategory[] categories) : this (categories, MKPointOfInterestFilterType.Including)
|
||||
public MKPointOfInterestFilter (MKPointOfInterestCategory [] categories) : this (categories, MKPointOfInterestFilterType.Including)
|
||||
{
|
||||
}
|
||||
|
||||
public MKPointOfInterestFilter (MKPointOfInterestCategory[] categories, MKPointOfInterestFilterType type)
|
||||
public MKPointOfInterestFilter (MKPointOfInterestCategory [] categories, MKPointOfInterestFilterType type)
|
||||
{
|
||||
// two different `init*` would share the same C# signature
|
||||
switch (type) {
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace MapKit {
|
|||
if (points.Length == 0)
|
||||
return _FromPoints (IntPtr.Zero, 0);
|
||||
|
||||
fixed (MKMapPoint *first = &points [0]){
|
||||
fixed (MKMapPoint* first = &points [0]) {
|
||||
return _FromPoints ((IntPtr) first, points.Length);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace MapKit {
|
|||
if (points.Length == 0)
|
||||
return _FromPoints (IntPtr.Zero, 0);
|
||||
|
||||
fixed (MKMapPoint *first = &points [0]){
|
||||
fixed (MKMapPoint* first = &points [0]) {
|
||||
return _FromPoints ((IntPtr) first, points.Length, interiorPolygons);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace MapKit {
|
|||
if (coords.Length == 0)
|
||||
return _FromCoordinates (IntPtr.Zero, 0);
|
||||
|
||||
fixed (CLLocationCoordinate2D *first = &coords [0]){
|
||||
fixed (CLLocationCoordinate2D* first = &coords [0]) {
|
||||
return _FromCoordinates ((IntPtr) first, coords.Length);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace MapKit {
|
|||
if (coords.Length == 0)
|
||||
return _FromCoordinates (IntPtr.Zero, 0);
|
||||
|
||||
fixed (CLLocationCoordinate2D *first = &coords [0]){
|
||||
fixed (CLLocationCoordinate2D* first = &coords [0]) {
|
||||
return _FromCoordinates ((IntPtr) first, coords.Length, interiorPolygons);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace MapKit {
|
|||
if (points.Length == 0)
|
||||
return _FromPoints (IntPtr.Zero, 0);
|
||||
|
||||
fixed (MKMapPoint *first = &points [0]){
|
||||
fixed (MKMapPoint* first = &points [0]) {
|
||||
return _FromPoints ((IntPtr) first, points.Length);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace MapKit {
|
|||
if (coords.Length == 0)
|
||||
return _FromCoordinates (IntPtr.Zero, 0);
|
||||
|
||||
fixed (CLLocationCoordinate2D *first = &coords [0]){
|
||||
fixed (CLLocationCoordinate2D* first = &coords [0]) {
|
||||
return _FromCoordinates ((IntPtr) first, coords.Length);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,8 +28,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct MKTileOverlayPath
|
||||
{
|
||||
public struct MKTileOverlayPath {
|
||||
public /* NSInteger */ nint X;
|
||||
public /* NSInteger */ nint Y;
|
||||
public /* NSInteger */ nint Z;
|
||||
|
@ -70,7 +69,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Mac (10,9)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct MKCoordinateRegion {
|
||||
|
@ -85,10 +84,10 @@ namespace MapKit {
|
|||
}
|
||||
|
||||
// note: CLLocationDistance is double - see CLLocation.h
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKCoordinateRegionMakeWithDistance")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKCoordinateRegionMakeWithDistance")]
|
||||
extern static public MKCoordinateRegion FromDistance (CLLocationCoordinate2D center, /* CLLocationDistance */ double latitudinalMeters, /* CLLocationDistance */ double longitudinalMeters);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKCoordinateRegionForMapRect")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKCoordinateRegionForMapRect")]
|
||||
extern static public MKCoordinateRegion FromMapRect (MKMapRect rect);
|
||||
|
||||
public override string ToString ()
|
||||
|
@ -104,16 +103,16 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Mac (10,9)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct MKMapPoint {
|
||||
public double X, Y;
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapPointForCoordinate")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapPointForCoordinate")]
|
||||
public extern static MKMapPoint FromCoordinate (CLLocationCoordinate2D coordinate);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKCoordinateForMapPoint")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKCoordinateForMapPoint")]
|
||||
public extern static CLLocationCoordinate2D ToCoordinate (MKMapPoint mapPoint);
|
||||
|
||||
// MKMapPointMake
|
||||
|
@ -136,7 +135,7 @@ namespace MapKit {
|
|||
|
||||
public override bool Equals (object? other)
|
||||
{
|
||||
if (other is MKMapPoint){
|
||||
if (other is MKMapPoint) {
|
||||
var omap = (MKMapPoint) other;
|
||||
|
||||
return omap.X == X && omap.Y == Y;
|
||||
|
@ -180,9 +179,9 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
#endif
|
||||
public static MKMapSize World { get { return new MKMapSize (0x10000000, 0x10000000); }}
|
||||
public static MKMapSize World { get { return new MKMapSize (0x10000000, 0x10000000); } }
|
||||
|
||||
// MKMapSizeEqualToSize
|
||||
public static bool operator == (MKMapSize a, MKMapSize b)
|
||||
|
@ -224,7 +223,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Mac (10,9)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct MKMapRect {
|
||||
|
@ -234,7 +233,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
#endif
|
||||
public static readonly MKMapRect Null = new MKMapRect (double.PositiveInfinity, double.PositiveInfinity, 0, 0);
|
||||
|
||||
|
@ -332,7 +331,7 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (9,2)]
|
||||
[TV (9, 2)]
|
||||
#endif
|
||||
public MKMapRect World {
|
||||
get {
|
||||
|
@ -372,7 +371,7 @@ namespace MapKit {
|
|||
return string.Format ("{{{0}, {1}}}", Origin, Size);
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectContainsPoint")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectContainsPoint")]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
static extern bool MKMapRectContainsPoint (MKMapRect rect, MKMapPoint point);
|
||||
|
||||
|
@ -381,7 +380,7 @@ namespace MapKit {
|
|||
return MKMapRectContainsPoint (this, point);
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectContainsRect")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectContainsRect")]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
static extern bool MKMapRectContainsRect (MKMapRect rect1, MKMapRect rect2);
|
||||
|
||||
|
@ -390,17 +389,17 @@ namespace MapKit {
|
|||
return MKMapRectContainsRect (this, rect);
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectUnion")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectUnion")]
|
||||
static public extern MKMapRect Union (MKMapRect rect1, MKMapRect rect2);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectIntersection")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectIntersection")]
|
||||
static public extern MKMapRect Intersection (MKMapRect rect1, MKMapRect rect2);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectIntersectsRect")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectIntersectsRect")]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
static public extern bool Intersects (MKMapRect rect1, MKMapRect rect2);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectInset")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectInset")]
|
||||
static extern MKMapRect MKMapRectInset (MKMapRect rect, double dx, double dy);
|
||||
|
||||
public MKMapRect Inset (double dx, double dy)
|
||||
|
@ -408,7 +407,7 @@ namespace MapKit {
|
|||
return MKMapRectInset (this, dx, dy);
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectOffset")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectOffset")]
|
||||
static extern MKMapRect MKMapRectOffset (MKMapRect rect, double dx, double dy);
|
||||
|
||||
public MKMapRect Offset (double dx, double dy)
|
||||
|
@ -416,7 +415,7 @@ namespace MapKit {
|
|||
return MKMapRectOffset (this, dx, dy);
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectDivide")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectDivide")]
|
||||
static extern void MKMapRectDivide (MKMapRect rect, out MKMapRect slice, out MKMapRect remainder, double amount, CGRectEdge edge);
|
||||
|
||||
public MKMapRect Divide (double amount, CGRectEdge edge, out MKMapRect remainder)
|
||||
|
@ -426,7 +425,7 @@ namespace MapKit {
|
|||
return slice;
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectSpans180thMeridian")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectSpans180thMeridian")]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
static extern bool MKMapRectSpans180thMeridian (MKMapRect rect);
|
||||
|
||||
|
@ -434,7 +433,7 @@ namespace MapKit {
|
|||
get { return MKMapRectSpans180thMeridian (this); }
|
||||
}
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapRectRemainder")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapRectRemainder")]
|
||||
static extern MKMapRect MKMapRectRemainder (MKMapRect rect);
|
||||
|
||||
public MKMapRect Remainder ()
|
||||
|
@ -450,17 +449,17 @@ namespace MapKit {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Mac (10,9)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
public static class MKGeometry {
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMapPointsPerMeterAtLatitude")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMapPointsPerMeterAtLatitude")]
|
||||
static extern public double MapPointsPerMeterAtLatitude (/* CLLocationDegrees */ double latitude);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMetersPerMapPointAtLatitude")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMetersPerMapPointAtLatitude")]
|
||||
static extern public /* CLLocationDistance */ double MetersPerMapPointAtLatitude (/* CLLocationDegrees */ double latitude);
|
||||
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint="MKMetersBetweenMapPoints")]
|
||||
[DllImport (Constants.MapKitLibrary, EntryPoint = "MKMetersBetweenMapPoints")]
|
||||
static extern public /* CLLocationDistance */ double MetersBetweenMapPoints (MKMapPoint a, MKMapPoint b);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,14 +18,16 @@ using Foundation;
|
|||
namespace MediaAccessibility {
|
||||
|
||||
[Native]
|
||||
[iOS (7,0)][Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
public enum MACaptionAppearanceDomain : long {
|
||||
Default = 0,
|
||||
User = 1,
|
||||
}
|
||||
|
||||
[Native]
|
||||
[iOS (7,0)][Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
public enum MACaptionAppearanceDisplayType : long {
|
||||
ForcedOnly = 0,
|
||||
Automatic = 1,
|
||||
|
@ -33,14 +35,16 @@ namespace MediaAccessibility {
|
|||
}
|
||||
|
||||
[Native]
|
||||
[iOS (7,0)][Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
public enum MACaptionAppearanceBehavior : long {
|
||||
UseValue = 0,
|
||||
UseContentIfAvailable = 1,
|
||||
}
|
||||
|
||||
[Native]
|
||||
[iOS (7,0)][Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
public enum MACaptionAppearanceFontStyle : long {
|
||||
Default = 0,
|
||||
MonospacedWithSerif = 1,
|
||||
|
@ -53,7 +57,8 @@ namespace MediaAccessibility {
|
|||
}
|
||||
|
||||
[Native]
|
||||
[iOS (7,0)][Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
public enum MACaptionAppearanceTextEdgeStyle : long {
|
||||
Undefined = 0,
|
||||
None = 1,
|
||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaAccessibility {
|
|||
[SupportedOSPlatform ("ios13.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (13,0)]
|
||||
[Mac (10,15)]
|
||||
[iOS (13,0)]
|
||||
[TV (13, 0)]
|
||||
[Mac (10, 15)]
|
||||
[iOS (13, 0)]
|
||||
#endif
|
||||
public static partial class MAImageCaptioning {
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ namespace MediaAccessibility {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (7,0)]
|
||||
[Mac (10,9)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 9)]
|
||||
#endif
|
||||
public static partial class MACaptionAppearance {
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace MediaAccessibility {
|
|||
using (var langs = new CFArray (MACaptionAppearanceCopySelectedLanguages ((int) domain), owns: true)) {
|
||||
var languages = new string? [langs.Count];
|
||||
for (int i = 0; i < langs.Count; i++) {
|
||||
languages[i] = CFString.FromHandle (langs.GetValue (i));
|
||||
languages [i] = CFString.FromHandle (langs.GetValue (i));
|
||||
}
|
||||
return languages;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ namespace MediaAccessibility {
|
|||
using (var chars = new CFArray (MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics ((int) domain), owns: true)) {
|
||||
NSString [] characteristics = new NSString [chars.Count];
|
||||
for (int i = 0; i < chars.Count; i++) {
|
||||
characteristics[i] = new NSString (chars.GetValue (i));
|
||||
characteristics [i] = new NSString (chars.GetValue (i));
|
||||
}
|
||||
return characteristics;
|
||||
}
|
||||
|
@ -234,9 +234,9 @@ namespace MediaAccessibility {
|
|||
[SupportedOSPlatform ("ios13.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (13,0)]
|
||||
[Mac (10,15)]
|
||||
[iOS (13,0)]
|
||||
[TV (13, 0)]
|
||||
[Mac (10, 15)]
|
||||
[iOS (13, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.MediaAccessibilityLibrary)]
|
||||
static extern void MACaptionAppearanceDidDisplayCaptions (IntPtr /* CFArratRef */ strings);
|
||||
|
@ -247,11 +247,11 @@ namespace MediaAccessibility {
|
|||
[SupportedOSPlatform ("ios13.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (13,0)]
|
||||
[Mac (10,15)]
|
||||
[iOS (13,0)]
|
||||
[TV (13, 0)]
|
||||
[Mac (10, 15)]
|
||||
[iOS (13, 0)]
|
||||
#endif
|
||||
public static void DidDisplayCaptions (string[] strings)
|
||||
public static void DidDisplayCaptions (string [] strings)
|
||||
{
|
||||
if ((strings is null) || (strings.Length == 0))
|
||||
MACaptionAppearanceDidDisplayCaptions (IntPtr.Zero);
|
||||
|
@ -267,11 +267,11 @@ namespace MediaAccessibility {
|
|||
[SupportedOSPlatform ("ios13.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (13,0)]
|
||||
[Mac (10,15)]
|
||||
[iOS (13,0)]
|
||||
[TV (13, 0)]
|
||||
[Mac (10, 15)]
|
||||
[iOS (13, 0)]
|
||||
#endif
|
||||
public static void DidDisplayCaptions (NSAttributedString[] strings)
|
||||
public static void DidDisplayCaptions (NSAttributedString [] strings)
|
||||
{
|
||||
// CFAttributedString is “toll-free bridged” with its Foundation counterpart, NSAttributedString.
|
||||
// https://developer.apple.com/documentation/corefoundation/cfattributedstring?language=objc
|
||||
|
@ -297,15 +297,15 @@ namespace MediaAccessibility {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (8,0)]
|
||||
[Mac (10,10)]
|
||||
[iOS (8, 0)]
|
||||
[Mac (10, 10)]
|
||||
#endif
|
||||
[DllImport (Constants.MediaAccessibilityLibrary)]
|
||||
static extern unsafe IntPtr /* CFArrayRef __nonnull */ MAAudibleMediaCopyPreferredCharacteristics ();
|
||||
|
||||
// according to webkit source code (the only use I could find) this is an array of CFString
|
||||
// https://github.com/WebKit/webkit/blob/master/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp
|
||||
static public string?[]? GetPreferredCharacteristics ()
|
||||
static public string? []? GetPreferredCharacteristics ()
|
||||
{
|
||||
var handle = MAAudibleMediaCopyPreferredCharacteristics ();
|
||||
if (handle == IntPtr.Zero)
|
||||
|
|
|
@ -25,16 +25,14 @@ using ObjCRuntime;
|
|||
|
||||
namespace MediaLibrary {
|
||||
[Native]
|
||||
public enum MLMediaSourceType : ulong
|
||||
{
|
||||
public enum MLMediaSourceType : ulong {
|
||||
Audio = 1 << 0,
|
||||
Image = 1 << 1,
|
||||
Movie = 1 << 2
|
||||
}
|
||||
|
||||
[Native]
|
||||
public enum MLMediaType : ulong
|
||||
{
|
||||
public enum MLMediaType : ulong {
|
||||
Audio = 1 << 0,
|
||||
Image = 1 << 1,
|
||||
Movie = 1 << 2
|
||||
|
|
|
@ -271,7 +271,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,2)]
|
||||
[iOS (9, 2)]
|
||||
#endif
|
||||
public bool HasProtectedAsset {
|
||||
get {
|
||||
|
@ -285,7 +285,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public bool IsExplicitItem {
|
||||
get {
|
||||
|
@ -299,7 +299,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSDate? DateAdded {
|
||||
get {
|
||||
|
@ -313,7 +313,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[iOS (10, 3)]
|
||||
#endif
|
||||
public NSString? PlaybackStoreID {
|
||||
get {
|
||||
|
@ -327,10 +327,10 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("ios14.5")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (7,4)]
|
||||
[TV (14,5)]
|
||||
[Mac (11,3)]
|
||||
[iOS (14,5)]
|
||||
[Watch (7, 4)]
|
||||
[TV (14, 5)]
|
||||
[Mac (11, 3)]
|
||||
[iOS (14, 5)]
|
||||
#endif
|
||||
public bool IsPreorder {
|
||||
get {
|
||||
|
|
|
@ -19,8 +19,7 @@ using ObjCRuntime;
|
|||
|
||||
namespace MediaPlayer {
|
||||
|
||||
public partial class MPMediaQuery
|
||||
{
|
||||
public partial class MPMediaQuery {
|
||||
public MPMediaItem GetItem (nuint index)
|
||||
{
|
||||
using (var array = new NSArray (Messaging.IntPtr_objc_msgSend (Handle, Selector.GetHandle ("items"))))
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
#endif
|
||||
public class MPNowPlayingInfo {
|
||||
public MPNowPlayingInfo ()
|
||||
|
@ -47,7 +47,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (8,0)]
|
||||
[iOS (8, 0)]
|
||||
#endif
|
||||
public double? DefaultPlaybackRate;
|
||||
|
||||
|
@ -57,25 +57,25 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[iOS (9, 0)]
|
||||
#endif
|
||||
public MPNowPlayingInfoLanguageOptionGroup[]? AvailableLanguageOptions { get; set; }
|
||||
public MPNowPlayingInfoLanguageOptionGroup []? AvailableLanguageOptions { get; set; }
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios9.0")]
|
||||
[SupportedOSPlatform ("macos10.12.2")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[iOS (9, 0)]
|
||||
#endif
|
||||
public MPNowPlayingInfoLanguageOption[]? CurrentLanguageOptions { get; set; }
|
||||
public MPNowPlayingInfoLanguageOption []? CurrentLanguageOptions { get; set; }
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("macos10.12.2")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public string? CollectionIdentifier { get; set; }
|
||||
#if NET
|
||||
|
@ -84,7 +84,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public string? ExternalContentIdentifier { get; set; }
|
||||
#if NET
|
||||
|
@ -93,7 +93,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public string? ExternalUserProfileIdentifier { get; set; }
|
||||
#if NET
|
||||
|
@ -102,7 +102,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public float? PlaybackProgress { get; set; }
|
||||
#if NET
|
||||
|
@ -111,7 +111,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public MPNowPlayingInfoMediaType? MediaType { get; set; }
|
||||
#if NET
|
||||
|
@ -120,7 +120,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,0)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public bool? IsLiveStream { get; set; }
|
||||
#if NET
|
||||
|
@ -129,7 +129,7 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[iOS (10, 3)]
|
||||
#endif
|
||||
public NSUrl? AssetUrl { get; set; }
|
||||
#if NET
|
||||
|
@ -138,9 +138,9 @@ namespace MediaPlayer {
|
|||
[SupportedOSPlatform ("macos10.13.1")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (11,1)]
|
||||
[TV (11,1)]
|
||||
[Mac (10,13,1)]
|
||||
[iOS (11, 1)]
|
||||
[TV (11, 1)]
|
||||
[Mac (10, 13, 1)]
|
||||
#endif
|
||||
public NSDate? CurrentPlaybackDate { get; set; }
|
||||
|
||||
|
@ -183,7 +183,7 @@ namespace MediaPlayer {
|
|||
if (PlaybackProgress.HasValue)
|
||||
Add (dict, MPNowPlayingInfoCenter.PropertyPlaybackProgress, new NSNumber (PlaybackProgress.Value));
|
||||
if (MediaType.HasValue)
|
||||
Add (dict, MPNowPlayingInfoCenter.PropertyMediaType, new NSNumber ((int)MediaType.Value));
|
||||
Add (dict, MPNowPlayingInfoCenter.PropertyMediaType, new NSNumber ((int) MediaType.Value));
|
||||
if (IsLiveStream.HasValue)
|
||||
Add (dict, MPNowPlayingInfoCenter.PropertyIsLiveStream, new NSNumber (IsLiveStream.Value));
|
||||
if (AssetUrl is not null)
|
||||
|
|
|
@ -15,7 +15,7 @@ using ObjCRuntime;
|
|||
|
||||
namespace MediaPlayer {
|
||||
public partial class MPSkipIntervalCommand {
|
||||
public double[]? PreferredIntervals {
|
||||
public double []? PreferredIntervals {
|
||||
get {
|
||||
NSArray a = _PreferredIntervals;
|
||||
if ((a is null) || (a.Count == 0))
|
||||
|
|
|
@ -25,9 +25,9 @@ namespace MediaPlayer {
|
|||
[UnsupportedOSPlatform ("ios11.3")]
|
||||
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 11,3, message: "Use 'MPVolumeView' to present volume controls.")]
|
||||
[Deprecated (PlatformName.iOS, 11, 3, message: "Use 'MPVolumeView' to present volume controls.")]
|
||||
#endif
|
||||
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertShow")]
|
||||
[DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertShow")]
|
||||
public extern static void AlertShow ();
|
||||
|
||||
#if NET
|
||||
|
@ -36,9 +36,9 @@ namespace MediaPlayer {
|
|||
[UnsupportedOSPlatform ("ios11.3")]
|
||||
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 11,3, message: "Use 'MPVolumeView' to present volume controls.")]
|
||||
[Deprecated (PlatformName.iOS, 11, 3, message: "Use 'MPVolumeView' to present volume controls.")]
|
||||
#endif
|
||||
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertHide")]
|
||||
[DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertHide")]
|
||||
public extern static void AlertHide ();
|
||||
|
||||
// note: sizeof (BOOL) is 1 like C, i.e. it's not a Win32 BOOL (4 bytes)
|
||||
|
@ -48,9 +48,9 @@ namespace MediaPlayer {
|
|||
[UnsupportedOSPlatform ("ios11.3")]
|
||||
[ObsoletedOSPlatform ("ios11.3", "Use 'MPVolumeView' to present volume controls.")]
|
||||
#else
|
||||
[Deprecated (PlatformName.iOS, 11,3, message: "Use 'MPVolumeView' to present volume controls.")]
|
||||
[Deprecated (PlatformName.iOS, 11, 3, message: "Use 'MPVolumeView' to present volume controls.")]
|
||||
#endif
|
||||
[DllImport (Constants.MediaPlayerLibrary, EntryPoint="MPVolumeSettingsAlertIsVisible")]
|
||||
[DllImport (Constants.MediaPlayerLibrary, EntryPoint = "MPVolumeSettingsAlertIsVisible")]
|
||||
[return: MarshalAs (UnmanagedType.I1)]
|
||||
public extern static /* BOOL */ bool AlertIsVisible ();
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace MediaPlayer {
|
|||
}
|
||||
|
||||
// NSUInteger -> MPMediaItem.h
|
||||
[Watch (7,0)]
|
||||
[Watch (7, 0)]
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum MPMediaType : ulong {
|
||||
|
@ -118,20 +118,20 @@ namespace MediaPlayer {
|
|||
AudioITunesU = 1 << 3,
|
||||
AnyAudio = 0x00ff,
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
Movie = 1 << 8,
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
TVShow = 1 << 9,
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
VideoPodcast = 1 << 10,
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
MusicVideo = 1 << 11,
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
VideoITunesU = 1 << 12,
|
||||
[iOS (7,0)]
|
||||
[Mac (10,12,2)]
|
||||
[iOS (7, 0)]
|
||||
[Mac (10, 12, 2)]
|
||||
HomeVideo = 1 << 13,
|
||||
[Mac (10,12,2)]
|
||||
[Mac (10, 12, 2)]
|
||||
TypeAnyVideo = 0xff00,
|
||||
Any = 0xFFFFFFFFFFFFFFFF
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ namespace MediaPlayer {
|
|||
// NSInteger -> /MPMusicPlayerController.h
|
||||
[NoMac]
|
||||
[NoWatch]
|
||||
[TV (14,0)]
|
||||
[TV (14, 0)]
|
||||
[Native]
|
||||
public enum MPMusicPlaybackState : long {
|
||||
Stopped,
|
||||
|
@ -213,7 +213,7 @@ namespace MediaPlayer {
|
|||
// NSInteger -> /MPMusicPlayerController.h
|
||||
[NoMac]
|
||||
[NoWatch]
|
||||
[TV (14,0)]
|
||||
[TV (14, 0)]
|
||||
[Native]
|
||||
public enum MPMusicRepeatMode : long {
|
||||
Default,
|
||||
|
@ -225,7 +225,7 @@ namespace MediaPlayer {
|
|||
// NSInteger -> /MPMusicPlayerController.h
|
||||
[NoMac]
|
||||
[NoWatch]
|
||||
[TV (14,0)]
|
||||
[TV (14, 0)]
|
||||
[Native]
|
||||
public enum MPMusicShuffleMode : long {
|
||||
Default,
|
||||
|
@ -236,76 +236,73 @@ namespace MediaPlayer {
|
|||
|
||||
public delegate void MPMediaItemEnumerator (string property, NSObject value, ref bool stop);
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPShuffleType : long
|
||||
{
|
||||
public enum MPShuffleType : long {
|
||||
Off,
|
||||
Items,
|
||||
Collections
|
||||
}
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPRepeatType : long
|
||||
{
|
||||
public enum MPRepeatType : long {
|
||||
Off,
|
||||
One,
|
||||
All
|
||||
}
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[iOS (10,0)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[iOS (10, 0)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPChangeLanguageOptionSetting : long
|
||||
{
|
||||
public enum MPChangeLanguageOptionSetting : long {
|
||||
None,
|
||||
NowPlayingItemOnly,
|
||||
Permanent
|
||||
}
|
||||
|
||||
// NSInteger -> MPRemoteCommand.h
|
||||
[Mac (10,12,2)]
|
||||
[iOS (7,1)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[iOS (7, 1)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPRemoteCommandHandlerStatus : long {
|
||||
Success = 0,
|
||||
NoSuchContent = 100,
|
||||
[iOS (9,1)]
|
||||
[iOS (9, 1)]
|
||||
NoActionableNowPlayingItem = 110,
|
||||
[iOS (11,0)]
|
||||
[TV (11,0)]
|
||||
[Mac (10,13)]
|
||||
[iOS (11, 0)]
|
||||
[TV (11, 0)]
|
||||
[Mac (10, 13)]
|
||||
DeviceNotFound = 120,
|
||||
CommandFailed = 200
|
||||
}
|
||||
|
||||
// NSUInteger -> MPRemoteCommandEvent.h
|
||||
[Mac (10,12,2)]
|
||||
[iOS (7,1)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[iOS (7, 1)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPSeekCommandEventType : ulong {
|
||||
BeginSeeking,
|
||||
EndSeeking
|
||||
}
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[iOS (9,0)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[iOS (9, 0)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPNowPlayingInfoLanguageOptionType : ulong {
|
||||
Audible,
|
||||
Legible
|
||||
}
|
||||
|
||||
[Mac (10,14,2)]
|
||||
[Watch (7,0)]
|
||||
[iOS (9,3)]
|
||||
[Mac (10, 14, 2)]
|
||||
[Watch (7, 0)]
|
||||
[iOS (9, 3)]
|
||||
[Native]
|
||||
[ErrorDomain ("MPErrorDomain")]
|
||||
public enum MPErrorCode : long {
|
||||
|
@ -322,7 +319,7 @@ namespace MediaPlayer {
|
|||
[NoMac]
|
||||
[NoTV]
|
||||
[NoWatch]
|
||||
[iOS (9,3)]
|
||||
[iOS (9, 3)]
|
||||
[Native]
|
||||
public enum MPMediaLibraryAuthorizationStatus : long {
|
||||
NotDetermined = 0,
|
||||
|
@ -331,25 +328,23 @@ namespace MediaPlayer {
|
|||
Authorized
|
||||
}
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[iOS (10,0)]
|
||||
[TV (10,0)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[iOS (10, 0)]
|
||||
[TV (10, 0)]
|
||||
[Watch (5, 0)]
|
||||
[Native]
|
||||
public enum MPNowPlayingInfoMediaType : ulong
|
||||
{
|
||||
public enum MPNowPlayingInfoMediaType : ulong {
|
||||
None = 0,
|
||||
Audio,
|
||||
Video
|
||||
}
|
||||
|
||||
[Mac (10,12,2)]
|
||||
[Watch (5,0)]
|
||||
[Mac (10, 12, 2)]
|
||||
[Watch (5, 0)]
|
||||
[iOS (11, 0)]
|
||||
[TV (11, 0)]
|
||||
[Native]
|
||||
public enum MPNowPlayingPlaybackState : ulong
|
||||
{
|
||||
public enum MPNowPlayingPlaybackState : ulong {
|
||||
Unknown = 0,
|
||||
Playing,
|
||||
Paused,
|
||||
|
|
|
@ -24,8 +24,8 @@ namespace MediaToolbox {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
#endif
|
||||
[DllImport (Constants.MediaToolboxLibrary)]
|
||||
static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaType (
|
||||
|
@ -37,8 +37,8 @@ namespace MediaToolbox {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
#endif
|
||||
static public string? GetLocalizedName (this CMMediaType mediaType)
|
||||
{
|
||||
|
@ -51,8 +51,8 @@ namespace MediaToolbox {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
#endif
|
||||
[DllImport (Constants.MediaToolboxLibrary)]
|
||||
static extern /* CFStringRef CM_NULLABLE */ IntPtr MTCopyLocalizedNameForMediaSubType (
|
||||
|
@ -64,8 +64,8 @@ namespace MediaToolbox {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("tvos")]
|
||||
#else
|
||||
[iOS (9,0)]
|
||||
[Mac (10,11)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
#endif
|
||||
static public string? GetLocalizedName (this CMMediaType mediaType, uint mediaSubType)
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ObjCRuntime;
|
||||
|
@ -206,7 +207,26 @@ namespace Network {
|
|||
[iOS (15,0)]
|
||||
[MacCatalyst (15,0)]
|
||||
#endif
|
||||
public NWInterfaceRadioType GetPathRadioType (uint pathIndex)
|
||||
=> nw_data_transfer_report_get_path_radio_type (GetCheckedHandle (), pathIndex);
|
||||
|
||||
#if !XAMCORE_5_0
|
||||
#if NET
|
||||
[SupportedOSPlatform ("tvos15.0")]
|
||||
[SupportedOSPlatform ("macos12.0")]
|
||||
[SupportedOSPlatform ("ios15.0")]
|
||||
[SupportedOSPlatform ("maccatalyst15.0")]
|
||||
#else
|
||||
[Watch (8,0)]
|
||||
[TV (15,0)]
|
||||
[Mac (12,0)]
|
||||
[iOS (15,0)]
|
||||
[MacCatalyst (15,0)]
|
||||
#endif
|
||||
[Obsolete ("Use the 'GetPathRadioType' property instead.")]
|
||||
[EditorBrowsable (EditorBrowsableState.Never)]
|
||||
public NWInterfaceRadioType get_path_radio_type (uint pathIndex)
|
||||
=> nw_data_transfer_report_get_path_radio_type (GetCheckedHandle (), pathIndex);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,10 +189,12 @@ namespace PassKit {
|
|||
[Mac (12,0), iOS (15,0), Watch (8,0)]
|
||||
Continue = 16,
|
||||
#if !NET
|
||||
#pragma warning disable 0618 // warning CS0618: 'PKPaymentButtonType.[field]' is obsolete: 'Use '[replacement]'.'
|
||||
[iOS (12,0)]
|
||||
Book2 = Checkout,
|
||||
[iOS (12,0)]
|
||||
Checkout2 = Book,
|
||||
#pragma warning restore
|
||||
#endif // !NET
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ using ObjCRuntime;
|
|||
|
||||
namespace SceneKit {
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native] // untyped enum (SceneKitTypes.h) but described as the value of `code` for `NSError` which is an NSInteger
|
||||
[ErrorDomain ("SCNErrorDomain")]
|
||||
|
@ -25,7 +25,7 @@ namespace SceneKit {
|
|||
ProgramCompilationError = 1,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
public enum SCNGeometryPrimitiveType : long {
|
||||
|
@ -33,32 +33,32 @@ namespace SceneKit {
|
|||
TriangleStrip,
|
||||
Line,
|
||||
Point,
|
||||
[TV (10,0), Mac (10,12), iOS (10,0)]
|
||||
[TV (10, 0), Mac (10, 12), iOS (10, 0)]
|
||||
Polygon
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
public enum SCNTransparencyMode : long {
|
||||
AOne,
|
||||
RgbZero,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
SingleLayer = 2,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
DualLayer = 3,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
Default = AOne,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
public enum SCNCullMode : long {
|
||||
Back, Front
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
public enum SCNFilterMode : long {
|
||||
|
@ -67,7 +67,7 @@ namespace SceneKit {
|
|||
Linear
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
public enum SCNWrapMode : long {
|
||||
|
@ -78,7 +78,7 @@ namespace SceneKit {
|
|||
Mirror
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
public enum SCNSceneSourceStatus : long {
|
||||
|
@ -89,7 +89,7 @@ namespace SceneKit {
|
|||
Complete = 16
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 9)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -99,7 +99,7 @@ namespace SceneKit {
|
|||
Back
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 9)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -108,7 +108,7 @@ namespace SceneKit {
|
|||
Additive
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -119,7 +119,7 @@ namespace SceneKit {
|
|||
EaseInEaseOut
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -129,7 +129,7 @@ namespace SceneKit {
|
|||
Modulated
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -139,7 +139,7 @@ namespace SceneKit {
|
|||
Kinematic
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -148,7 +148,7 @@ namespace SceneKit {
|
|||
OutsideExtent
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -160,7 +160,7 @@ namespace SceneKit {
|
|||
YoungestFirst
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -173,7 +173,7 @@ namespace SceneKit {
|
|||
Replace
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -184,7 +184,7 @@ namespace SceneKit {
|
|||
BillboardYAligned
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -194,7 +194,7 @@ namespace SceneKit {
|
|||
Vertex
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -204,7 +204,7 @@ namespace SceneKit {
|
|||
Random
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -214,7 +214,7 @@ namespace SceneKit {
|
|||
AutoReverse
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -224,7 +224,7 @@ namespace SceneKit {
|
|||
OverOtherProperty
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -235,7 +235,7 @@ namespace SceneKit {
|
|||
PostCollision
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
[Native]
|
||||
|
@ -246,8 +246,7 @@ namespace SceneKit {
|
|||
}
|
||||
|
||||
// Utility enum
|
||||
public enum SCNGeometrySourceSemantics
|
||||
{
|
||||
public enum SCNGeometrySourceSemantics {
|
||||
Vertex,
|
||||
Normal,
|
||||
Color,
|
||||
|
@ -259,8 +258,7 @@ namespace SceneKit {
|
|||
}
|
||||
|
||||
// Utility enum
|
||||
public enum SCNAnimationImportPolicy
|
||||
{
|
||||
public enum SCNAnimationImportPolicy {
|
||||
Unknown,
|
||||
Play,
|
||||
PlayRepeatedly,
|
||||
|
@ -274,7 +272,7 @@ namespace SceneKit {
|
|||
Any, Closest, All,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Native]
|
||||
public enum SCNAntialiasingMode : ulong {
|
||||
None,
|
||||
|
@ -288,7 +286,7 @@ namespace SceneKit {
|
|||
#endif
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[Native]
|
||||
public enum SCNPhysicsCollisionCategory : ulong {
|
||||
None = 0,
|
||||
|
@ -297,8 +295,9 @@ namespace SceneKit {
|
|||
All = UInt64.MaxValue
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
public enum SCNBillboardAxis : ulong {
|
||||
X = 1 << 0,
|
||||
|
@ -307,35 +306,36 @@ namespace SceneKit {
|
|||
All = (X | Y | Z)
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
public enum SCNReferenceLoadingPolicy : long {
|
||||
Immediate = 0,
|
||||
OnDemand = 1
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
public enum SCNBlendMode : long
|
||||
{
|
||||
public enum SCNBlendMode : long {
|
||||
Alpha = 0,
|
||||
Add = 1,
|
||||
Subtract = 2,
|
||||
Multiply = 3,
|
||||
Screen = 4,
|
||||
Replace = 5,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
Max = 6,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum SCNDebugOptions : ulong
|
||||
{
|
||||
public enum SCNDebugOptions : ulong {
|
||||
None = 0,
|
||||
ShowPhysicsShapes = 1 << 0,
|
||||
ShowBoundingBoxes = 1 << 1,
|
||||
|
@ -343,26 +343,27 @@ namespace SceneKit {
|
|||
ShowLightExtents = 1 << 3,
|
||||
ShowPhysicsFields = 1 << 4,
|
||||
ShowWireframe = 1 << 5,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
RenderAsWireframe = 1 << 6,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
ShowSkeletons = 1 << 7,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
ShowCreases = 1 << 8,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
ShowConstraints = 1 << 9,
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
ShowCameras = 1 << 10,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
public enum SCNRenderingApi : ulong
|
||||
{
|
||||
public enum SCNRenderingApi : ulong {
|
||||
Metal,
|
||||
#if !MONOMAC
|
||||
[Unavailable (PlatformName.MacCatalyst)][NoMac]
|
||||
[Unavailable (PlatformName.MacCatalyst)]
|
||||
[NoMac]
|
||||
OpenGLES2,
|
||||
#else
|
||||
[NoiOS][NoTV][NoMacCatalyst]
|
||||
|
@ -374,17 +375,17 @@ namespace SceneKit {
|
|||
#endif
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[iOS (9,0)][Mac (10,11)]
|
||||
[Watch (3, 0)]
|
||||
[iOS (9, 0)]
|
||||
[Mac (10, 11)]
|
||||
[Native]
|
||||
public enum SCNBufferFrequency : long
|
||||
{
|
||||
public enum SCNBufferFrequency : long {
|
||||
Frame = 0,
|
||||
Node = 1,
|
||||
Shadable = 2,
|
||||
}
|
||||
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0), Mac (10, 12), iOS (10, 0)]
|
||||
[Native]
|
||||
public enum SCNMovabilityHint : long {
|
||||
|
@ -392,11 +393,10 @@ namespace SceneKit {
|
|||
Movable
|
||||
}
|
||||
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
[Native]
|
||||
[Flags]
|
||||
public enum SCNColorMask : long
|
||||
{
|
||||
public enum SCNColorMask : long {
|
||||
None = 0,
|
||||
Red = 1 << 3,
|
||||
Green = 1 << 2,
|
||||
|
@ -405,10 +405,9 @@ namespace SceneKit {
|
|||
All = 15,
|
||||
}
|
||||
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
[Native]
|
||||
public enum SCNInteractionMode : long
|
||||
{
|
||||
public enum SCNInteractionMode : long {
|
||||
Fly,
|
||||
OrbitTurntable,
|
||||
OrbitAngleMapping,
|
||||
|
@ -418,77 +417,68 @@ namespace SceneKit {
|
|||
Truck,
|
||||
}
|
||||
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
[Native]
|
||||
public enum SCNFillMode : ulong
|
||||
{
|
||||
public enum SCNFillMode : ulong {
|
||||
Fill = 0,
|
||||
Lines = 1,
|
||||
}
|
||||
|
||||
[NoWatch, Mac (10,13), iOS (11,0)]
|
||||
[TV (12,0)]
|
||||
[NoWatch, Mac (10, 13), iOS (11, 0)]
|
||||
[TV (12, 0)]
|
||||
[Native]
|
||||
public enum SCNTessellationSmoothingMode : long
|
||||
{
|
||||
public enum SCNTessellationSmoothingMode : long {
|
||||
None = 0,
|
||||
PNTriangles,
|
||||
Phong,
|
||||
}
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
[Native]
|
||||
public enum SCNHitTestSearchMode : long
|
||||
{
|
||||
public enum SCNHitTestSearchMode : long {
|
||||
Closest = 0,
|
||||
All = 1,
|
||||
Any = 2,
|
||||
}
|
||||
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
[Native]
|
||||
public enum SCNCameraProjectionDirection : long
|
||||
{
|
||||
public enum SCNCameraProjectionDirection : long {
|
||||
Vertical = 0,
|
||||
Horizontal = 1,
|
||||
}
|
||||
|
||||
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
|
||||
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
|
||||
[Native]
|
||||
public enum SCNNodeFocusBehavior : long
|
||||
{
|
||||
public enum SCNNodeFocusBehavior : long {
|
||||
None = 0,
|
||||
Occluding,
|
||||
Focusable,
|
||||
}
|
||||
|
||||
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
|
||||
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
|
||||
[Native]
|
||||
public enum SCNLightProbeType : long
|
||||
{
|
||||
public enum SCNLightProbeType : long {
|
||||
Irradiance = 0,
|
||||
Radiance = 1,
|
||||
}
|
||||
|
||||
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
|
||||
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
|
||||
[Native]
|
||||
public enum SCNLightProbeUpdateType : long
|
||||
{
|
||||
public enum SCNLightProbeUpdateType : long {
|
||||
Never = 0,
|
||||
Realtime = 1,
|
||||
}
|
||||
|
||||
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
|
||||
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
|
||||
[Native]
|
||||
public enum SCNLightAreaType : long
|
||||
{
|
||||
public enum SCNLightAreaType : long {
|
||||
Rectangle = 1,
|
||||
Polygon = 4,
|
||||
}
|
||||
|
||||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
public enum SCNPhysicsShapeType
|
||||
{
|
||||
public enum SCNPhysicsShapeType {
|
||||
ConvexHull,
|
||||
BoundingBox,
|
||||
ConcavePolyhedron,
|
||||
|
|
|
@ -16,8 +16,7 @@ using CoreAnimation;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNAnimatable {
|
||||
|
||||
public void AddAnimation (CAAnimation animation, string? key = null)
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace SceneKit {
|
|||
public abstract partial class SCNSceneRenderer : NSObject {
|
||||
[Mac (10, 10)]
|
||||
[Obsolete ("Use 'SCNSceneRenderer_Extensions.PrepareAsync' instead.")]
|
||||
public unsafe virtual Task<bool> PrepareAsync (NSObject[] objects)
|
||||
public unsafe virtual Task<bool> PrepareAsync (NSObject [] objects)
|
||||
{
|
||||
return SCNSceneRenderer_Extensions.PrepareAsync (this, objects);
|
||||
}
|
||||
|
@ -110,11 +110,10 @@ namespace SceneKit {
|
|||
|
||||
|
||||
#if !NET
|
||||
[Mac (10,9), iOS (8,0), Watch (4,0)]
|
||||
[Mac (10, 9), iOS (8, 0), Watch (4, 0)]
|
||||
public delegate void SCNAnimationEventHandler (AnimationType animation, NSObject animatedObject, bool playingBackward);
|
||||
|
||||
public partial class SCNAnimationEvent : NSObject
|
||||
{
|
||||
public partial class SCNAnimationEvent : NSObject {
|
||||
public static SCNAnimationEvent Create (nfloat keyTime, SCNAnimationEventHandler eventHandler)
|
||||
{
|
||||
var handler = new Action<IntPtr, NSObject, bool> ((animationPtr, animatedObject, playingBackward) => {
|
||||
|
@ -127,9 +126,9 @@ namespace SceneKit {
|
|||
#endif // !NET
|
||||
|
||||
#if !WATCH && !NET
|
||||
[iOS (11,0)]
|
||||
[TV (11,0)]
|
||||
[Mac (10,13,0, PlatformArchitecture.Arch64)]
|
||||
[iOS (11, 0)]
|
||||
[TV (11, 0)]
|
||||
[Mac (10, 13, 0, PlatformArchitecture.Arch64)]
|
||||
static public partial class SCNAnimatableExtensions {
|
||||
static public void AddAnimation (this ISCNAnimatable self, SCNAnimation animation, string key)
|
||||
{
|
||||
|
@ -141,7 +140,7 @@ namespace SceneKit {
|
|||
#endif // !WATCH && !NET
|
||||
|
||||
#if !NET
|
||||
[Watch (3,0)]
|
||||
[Watch (3, 0)]
|
||||
public partial class SCNHitTestOptions {
|
||||
[Obsolete ("Use 'SearchMode' instead.")]
|
||||
public SCNHitTestSearchMode? OptionSearchMode {
|
||||
|
@ -153,7 +152,7 @@ namespace SceneKit {
|
|||
|
||||
#if !MONOMAC && !WATCH && !__MACCATALYST__
|
||||
public partial class SCNView {
|
||||
[Watch (6,0), TV (13,0), iOS (13,0)]
|
||||
[Watch (6, 0), TV (13, 0), iOS (13, 0)]
|
||||
[Obsolete ("Empty stub. (not a public API).")]
|
||||
public virtual bool DrawableResizesAsynchronously { get; set; }
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@ namespace SceneKit {
|
|||
if (vertices is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (vertices));
|
||||
|
||||
fixed (SCNVector3 *ptr = &vertices [0])
|
||||
return FromVertices ((IntPtr)ptr, vertices.Length);
|
||||
fixed (SCNVector3* ptr = &vertices [0])
|
||||
return FromVertices ((IntPtr) ptr, vertices.Length);
|
||||
}
|
||||
|
||||
public static unsafe SCNGeometrySource FromNormals (SCNVector3 [] normals)
|
||||
|
@ -34,8 +34,8 @@ namespace SceneKit {
|
|||
if (normals is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (normals));
|
||||
|
||||
fixed (SCNVector3 *ptr = &normals[0])
|
||||
return FromNormals ((IntPtr)ptr, normals.Length);
|
||||
fixed (SCNVector3* ptr = &normals [0])
|
||||
return FromNormals ((IntPtr) ptr, normals.Length);
|
||||
}
|
||||
|
||||
public static unsafe SCNGeometrySource FromTextureCoordinates (CGPoint [] texcoords)
|
||||
|
@ -43,8 +43,8 @@ namespace SceneKit {
|
|||
if (texcoords is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (texcoords));
|
||||
|
||||
fixed (CGPoint *ptr = &texcoords[0])
|
||||
return FromTextureCoordinates ((IntPtr)ptr, texcoords.Length);
|
||||
fixed (CGPoint* ptr = &texcoords [0])
|
||||
return FromTextureCoordinates ((IntPtr) ptr, texcoords.Length);
|
||||
}
|
||||
|
||||
static NSString SemanticToToken (SCNGeometrySourceSemantics geometrySourceSemantic)
|
||||
|
|
|
@ -17,8 +17,7 @@ using JavaScriptCore;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
#if NET
|
||||
[SupportedOSPlatform ("macos10.10")]
|
||||
[SupportedOSPlatform ("ios8.0")]
|
||||
|
@ -28,8 +27,7 @@ namespace SceneKit
|
|||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
#endif
|
||||
public static class SCNJavaScript
|
||||
{
|
||||
public static class SCNJavaScript {
|
||||
[DllImport (Constants.SceneKitLibrary)]
|
||||
static extern void SCNExportJavaScriptModule (IntPtr context);
|
||||
|
||||
|
|
|
@ -45,8 +45,7 @@ using pfloat = System.Single;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
/// <summary>
|
||||
/// Represents a 4x4 Matrix
|
||||
/// </summary>
|
||||
|
@ -57,10 +56,9 @@ namespace SceneKit
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
[Advice ("This is a row major matrix representation.")]
|
||||
public struct SCNMatrix4 : IEquatable<SCNMatrix4>
|
||||
{
|
||||
public struct SCNMatrix4 : IEquatable<SCNMatrix4> {
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
|
@ -83,7 +81,7 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// The identity matrix
|
||||
/// </summary>
|
||||
public readonly static SCNMatrix4 Identity = new SCNMatrix4(SCNVector4.UnitX, SCNVector4.UnitY, SCNVector4.UnitZ, SCNVector4.UnitW);
|
||||
public readonly static SCNMatrix4 Identity = new SCNMatrix4 (SCNVector4.UnitX, SCNVector4.UnitY, SCNVector4.UnitZ, SCNVector4.UnitW);
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -96,7 +94,7 @@ namespace SceneKit
|
|||
/// <param name="row1">Second row of the matrix</param>
|
||||
/// <param name="row2">Third row of the matrix</param>
|
||||
/// <param name="row3">Bottom row of the matrix</param>
|
||||
public SCNMatrix4(SCNVector4 row0, SCNVector4 row1, SCNVector4 row2, SCNVector4 row3)
|
||||
public SCNMatrix4 (SCNVector4 row0, SCNVector4 row1, SCNVector4 row2, SCNVector4 row3)
|
||||
{
|
||||
Row0 = row0;
|
||||
Row1 = row1;
|
||||
|
@ -123,16 +121,16 @@ namespace SceneKit
|
|||
/// <param name="m31">Second item of the fourth row of the matrix.</param>
|
||||
/// <param name="m32">Third item of the fourth row of the matrix.</param>
|
||||
/// <param name="m33">Fourth item of the fourth row of the matrix.</param>
|
||||
public SCNMatrix4(
|
||||
public SCNMatrix4 (
|
||||
pfloat m00, pfloat m01, pfloat m02, pfloat m03,
|
||||
pfloat m10, pfloat m11, pfloat m12, pfloat m13,
|
||||
pfloat m20, pfloat m21, pfloat m22, pfloat m23,
|
||||
pfloat m30, pfloat m31, pfloat m32, pfloat m33)
|
||||
{
|
||||
Row0 = new SCNVector4(m00, m01, m02, m03);
|
||||
Row1 = new SCNVector4(m10, m11, m12, m13);
|
||||
Row2 = new SCNVector4(m20, m21, m22, m23);
|
||||
Row3 = new SCNVector4(m30, m31, m32, m33);
|
||||
Row0 = new SCNVector4 (m00, m01, m02, m03);
|
||||
Row1 = new SCNVector4 (m10, m11, m12, m13);
|
||||
Row2 = new SCNVector4 (m20, m21, m22, m23);
|
||||
Row3 = new SCNVector4 (m30, m31, m32, m33);
|
||||
}
|
||||
|
||||
#if !WATCH
|
||||
|
@ -154,10 +152,8 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// The determinant of this matrix
|
||||
/// </summary>
|
||||
public pfloat Determinant
|
||||
{
|
||||
get
|
||||
{
|
||||
public pfloat Determinant {
|
||||
get {
|
||||
return
|
||||
Row0.X * Row1.Y * Row2.Z * Row3.W - Row0.X * Row1.Y * Row2.W * Row3.Z + Row0.X * Row1.Z * Row2.W * Row3.Y - Row0.X * Row1.Z * Row2.Y * Row3.W
|
||||
+ Row0.X * Row1.W * Row2.Y * Row3.Z - Row0.X * Row1.W * Row2.Z * Row3.Y - Row0.Y * Row1.Z * Row2.W * Row3.X + Row0.Y * Row1.Z * Row2.X * Row3.W
|
||||
|
@ -171,9 +167,8 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// The first column of this matrix
|
||||
/// </summary>
|
||||
public SCNVector4 Column0
|
||||
{
|
||||
get { return new SCNVector4(Row0.X, Row1.X, Row2.X, Row3.X); }
|
||||
public SCNVector4 Column0 {
|
||||
get { return new SCNVector4 (Row0.X, Row1.X, Row2.X, Row3.X); }
|
||||
set {
|
||||
M11 = value.X;
|
||||
M21 = value.Y;
|
||||
|
@ -185,9 +180,8 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// The second column of this matrix
|
||||
/// </summary>
|
||||
public SCNVector4 Column1
|
||||
{
|
||||
get { return new SCNVector4(Row0.Y, Row1.Y, Row2.Y, Row3.Y); }
|
||||
public SCNVector4 Column1 {
|
||||
get { return new SCNVector4 (Row0.Y, Row1.Y, Row2.Y, Row3.Y); }
|
||||
set {
|
||||
M12 = value.X;
|
||||
M22 = value.Y;
|
||||
|
@ -199,9 +193,8 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// The third column of this matrix
|
||||
/// </summary>
|
||||
public SCNVector4 Column2
|
||||
{
|
||||
get { return new SCNVector4(Row0.Z, Row1.Z, Row2.Z, Row3.Z); }
|
||||
public SCNVector4 Column2 {
|
||||
get { return new SCNVector4 (Row0.Z, Row1.Z, Row2.Z, Row3.Z); }
|
||||
set {
|
||||
M13 = value.X;
|
||||
M23 = value.Y;
|
||||
|
@ -213,9 +206,8 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// The fourth column of this matrix
|
||||
/// </summary>
|
||||
public SCNVector4 Column3
|
||||
{
|
||||
get { return new SCNVector4(Row0.W, Row1.W, Row2.W, Row3.W); }
|
||||
public SCNVector4 Column3 {
|
||||
get { return new SCNVector4 (Row0.W, Row1.W, Row2.W, Row3.W); }
|
||||
set {
|
||||
M14 = value.X;
|
||||
M24 = value.Y;
|
||||
|
@ -313,9 +305,9 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Converts this instance into its inverse.
|
||||
/// </summary>
|
||||
public void Invert()
|
||||
public void Invert ()
|
||||
{
|
||||
this = SCNMatrix4.Invert(this);
|
||||
this = SCNMatrix4.Invert (this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -325,9 +317,9 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Converts this instance into its transpose.
|
||||
/// </summary>
|
||||
public void Transpose()
|
||||
public void Transpose ()
|
||||
{
|
||||
this = SCNMatrix4.Transpose(this);
|
||||
this = SCNMatrix4.Transpose (this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -367,45 +359,45 @@ namespace SceneKit
|
|||
/// <param name="axis">The axis to rotate about.</param>
|
||||
/// <param name="angle">Angle in radians to rotate counter-clockwise (looking in the direction of the given axis).</param>
|
||||
/// <param name="result">A matrix instance.</param>
|
||||
public static void CreateFromAxisAngle(SCNVector3 axis, pfloat angle, out SCNMatrix4 result)
|
||||
public static void CreateFromAxisAngle (SCNVector3 axis, pfloat angle, out SCNMatrix4 result)
|
||||
{
|
||||
pfloat cos = (float)System.Math.Cos(-angle);
|
||||
pfloat sin = (float)System.Math.Sin(-angle);
|
||||
pfloat cos = (float) System.Math.Cos (-angle);
|
||||
pfloat sin = (float) System.Math.Sin (-angle);
|
||||
pfloat t = 1.0f - cos;
|
||||
|
||||
axis.Normalize();
|
||||
axis.Normalize ();
|
||||
|
||||
result = new SCNMatrix4(t * axis.X * axis.X + cos, t * axis.X * axis.Y - sin * axis.Z, t * axis.X * axis.Z + sin * axis.Y, 0.0f,
|
||||
result = new SCNMatrix4 (t * axis.X * axis.X + cos, t * axis.X * axis.Y - sin * axis.Z, t * axis.X * axis.Z + sin * axis.Y, 0.0f,
|
||||
t * axis.X * axis.Y + sin * axis.Z, t * axis.Y * axis.Y + cos, t * axis.Y * axis.Z - sin * axis.X, 0.0f,
|
||||
t * axis.X * axis.Z - sin * axis.Y, t * axis.Y * axis.Z + sin * axis.X, t * axis.Z * axis.Z + cos, 0.0f,
|
||||
0, 0, 0, 1);
|
||||
}
|
||||
|
||||
public static void CreateFromAxisAngle(Vector3 axis, float angle, out SCNMatrix4 result)
|
||||
public static void CreateFromAxisAngle (Vector3 axis, float angle, out SCNMatrix4 result)
|
||||
{
|
||||
pfloat cos = (float)System.Math.Cos(-angle);
|
||||
pfloat sin = (float)System.Math.Sin(-angle);
|
||||
pfloat cos = (float) System.Math.Cos (-angle);
|
||||
pfloat sin = (float) System.Math.Sin (-angle);
|
||||
pfloat t = 1.0f - cos;
|
||||
|
||||
axis.Normalize();
|
||||
axis.Normalize ();
|
||||
|
||||
result = new SCNMatrix4(t * axis.X * axis.X + cos, t * axis.X * axis.Y - sin * axis.Z, t * axis.X * axis.Z + sin * axis.Y, 0.0f,
|
||||
result = new SCNMatrix4 (t * axis.X * axis.X + cos, t * axis.X * axis.Y - sin * axis.Z, t * axis.X * axis.Z + sin * axis.Y, 0.0f,
|
||||
t * axis.X * axis.Y + sin * axis.Z, t * axis.Y * axis.Y + cos, t * axis.Y * axis.Z - sin * axis.X, 0.0f,
|
||||
t * axis.X * axis.Z - sin * axis.Y, t * axis.Y * axis.Z + sin * axis.X, t * axis.Z * axis.Z + cos, 0.0f,
|
||||
0, 0, 0, 1);
|
||||
}
|
||||
|
||||
public static void CreateFromAxisAngle(Vector3d axis, double angle, out SCNMatrix4 result)
|
||||
public static void CreateFromAxisAngle (Vector3d axis, double angle, out SCNMatrix4 result)
|
||||
{
|
||||
double cos = System.Math.Cos(-angle);
|
||||
double sin = System.Math.Sin(-angle);
|
||||
double cos = System.Math.Cos (-angle);
|
||||
double sin = System.Math.Sin (-angle);
|
||||
double t = 1.0f - cos;
|
||||
|
||||
axis.Normalize();
|
||||
axis.Normalize ();
|
||||
|
||||
result = new SCNMatrix4((pfloat)(t * axis.X * axis.X + cos), (pfloat)(t * axis.X * axis.Y - sin * axis.Z), (pfloat)(t * axis.X * axis.Z + sin * axis.Y), (pfloat)(0.0f),
|
||||
(pfloat)( t * axis.X * axis.Y + sin * axis.Z), (pfloat)(t * axis.Y * axis.Y + cos), (pfloat)(t * axis.Y * axis.Z - sin * axis.X), (pfloat)0.0f,
|
||||
(pfloat)(t * axis.X * axis.Z - sin * axis.Y), (pfloat)(t * axis.Y * axis.Z + sin * axis.X), (pfloat)(t * axis.Z * axis.Z + cos), (pfloat)0.0f,
|
||||
result = new SCNMatrix4 ((pfloat) (t * axis.X * axis.X + cos), (pfloat) (t * axis.X * axis.Y - sin * axis.Z), (pfloat) (t * axis.X * axis.Z + sin * axis.Y), (pfloat) (0.0f),
|
||||
(pfloat) (t * axis.X * axis.Y + sin * axis.Z), (pfloat) (t * axis.Y * axis.Y + cos), (pfloat) (t * axis.Y * axis.Z - sin * axis.X), (pfloat) 0.0f,
|
||||
(pfloat) (t * axis.X * axis.Z - sin * axis.Y), (pfloat) (t * axis.Y * axis.Z + sin * axis.X), (pfloat) (t * axis.Z * axis.Z + cos), (pfloat) 0.0f,
|
||||
0, 0, 0, 1);
|
||||
}
|
||||
|
||||
|
@ -415,10 +407,10 @@ namespace SceneKit
|
|||
/// <param name="axis">The axis to rotate about.</param>
|
||||
/// <param name="angle">Angle in radians to rotate counter-clockwise (looking in the direction of the given axis).</param>
|
||||
/// <returns>A matrix instance.</returns>
|
||||
public static SCNMatrix4 CreateFromAxisAngle(SCNVector3 axis, pfloat angle)
|
||||
public static SCNMatrix4 CreateFromAxisAngle (SCNVector3 axis, pfloat angle)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateFromAxisAngle(axis, angle, out result);
|
||||
CreateFromAxisAngle (axis, angle, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -431,14 +423,14 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="angle">The counter-clockwise angle in radians.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateRotationX(pfloat angle, out SCNMatrix4 result)
|
||||
public static void CreateRotationX (pfloat angle, out SCNMatrix4 result)
|
||||
{
|
||||
pfloat cos = (pfloat)System.Math.Cos(angle);
|
||||
pfloat sin = (pfloat)System.Math.Sin(angle);
|
||||
pfloat cos = (pfloat) System.Math.Cos (angle);
|
||||
pfloat sin = (pfloat) System.Math.Sin (angle);
|
||||
|
||||
result.Row0 = SCNVector4.UnitX;
|
||||
result.Row1 = new SCNVector4(0.0f, cos, sin, 0.0f);
|
||||
result.Row2 = new SCNVector4(0.0f, -sin, cos, 0.0f);
|
||||
result.Row1 = new SCNVector4 (0.0f, cos, sin, 0.0f);
|
||||
result.Row2 = new SCNVector4 (0.0f, -sin, cos, 0.0f);
|
||||
result.Row3 = SCNVector4.UnitW;
|
||||
}
|
||||
|
||||
|
@ -447,10 +439,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="angle">The counter-clockwise angle in radians.</param>
|
||||
/// <returns>The resulting SCNMatrix4 instance.</returns>
|
||||
public static SCNMatrix4 CreateRotationX(pfloat angle)
|
||||
public static SCNMatrix4 CreateRotationX (pfloat angle)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateRotationX(angle, out result);
|
||||
CreateRotationX (angle, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -459,14 +451,14 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="angle">The counter-clockwise angle in radians.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateRotationY(pfloat angle, out SCNMatrix4 result)
|
||||
public static void CreateRotationY (pfloat angle, out SCNMatrix4 result)
|
||||
{
|
||||
pfloat cos = (pfloat)System.Math.Cos(angle);
|
||||
pfloat sin = (pfloat)System.Math.Sin(angle);
|
||||
pfloat cos = (pfloat) System.Math.Cos (angle);
|
||||
pfloat sin = (pfloat) System.Math.Sin (angle);
|
||||
|
||||
result.Row0 = new SCNVector4(cos, 0.0f, -sin, 0.0f);
|
||||
result.Row0 = new SCNVector4 (cos, 0.0f, -sin, 0.0f);
|
||||
result.Row1 = SCNVector4.UnitY;
|
||||
result.Row2 = new SCNVector4(sin, 0.0f, cos, 0.0f);
|
||||
result.Row2 = new SCNVector4 (sin, 0.0f, cos, 0.0f);
|
||||
result.Row3 = SCNVector4.UnitW;
|
||||
}
|
||||
|
||||
|
@ -475,10 +467,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="angle">The counter-clockwise angle in radians.</param>
|
||||
/// <returns>The resulting SCNMatrix4 instance.</returns>
|
||||
public static SCNMatrix4 CreateRotationY(pfloat angle)
|
||||
public static SCNMatrix4 CreateRotationY (pfloat angle)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateRotationY(angle, out result);
|
||||
CreateRotationY (angle, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -487,13 +479,13 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="angle">The counter-clockwise angle in radians.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateRotationZ(pfloat angle, out SCNMatrix4 result)
|
||||
public static void CreateRotationZ (pfloat angle, out SCNMatrix4 result)
|
||||
{
|
||||
pfloat cos = (pfloat)System.Math.Cos(angle);
|
||||
pfloat sin = (pfloat)System.Math.Sin(angle);
|
||||
pfloat cos = (pfloat) System.Math.Cos (angle);
|
||||
pfloat sin = (pfloat) System.Math.Sin (angle);
|
||||
|
||||
result.Row0 = new SCNVector4(cos, sin, 0.0f, 0.0f);
|
||||
result.Row1 = new SCNVector4(-sin, cos, 0.0f, 0.0f);
|
||||
result.Row0 = new SCNVector4 (cos, sin, 0.0f, 0.0f);
|
||||
result.Row1 = new SCNVector4 (-sin, cos, 0.0f, 0.0f);
|
||||
result.Row2 = SCNVector4.UnitZ;
|
||||
result.Row3 = SCNVector4.UnitW;
|
||||
}
|
||||
|
@ -503,10 +495,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="angle">The counter-clockwise angle in radians.</param>
|
||||
/// <returns>The resulting SCNMatrix4 instance.</returns>
|
||||
public static SCNMatrix4 CreateRotationZ(pfloat angle)
|
||||
public static SCNMatrix4 CreateRotationZ (pfloat angle)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateRotationZ(angle, out result);
|
||||
CreateRotationZ (angle, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -521,10 +513,10 @@ namespace SceneKit
|
|||
/// <param name="y">Y translation.</param>
|
||||
/// <param name="z">Z translation.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateTranslation(pfloat x, pfloat y, pfloat z, out SCNMatrix4 result)
|
||||
public static void CreateTranslation (pfloat x, pfloat y, pfloat z, out SCNMatrix4 result)
|
||||
{
|
||||
result = Identity;
|
||||
result.Row3 = new SCNVector4(x, y, z, 1);
|
||||
result.Row3 = new SCNVector4 (x, y, z, 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -532,10 +524,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vector">The translation vector.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateTranslation(ref SCNVector3 vector, out SCNMatrix4 result)
|
||||
public static void CreateTranslation (ref SCNVector3 vector, out SCNMatrix4 result)
|
||||
{
|
||||
result = Identity;
|
||||
result.Row3 = new SCNVector4(vector.X, vector.Y, vector.Z, 1);
|
||||
result.Row3 = new SCNVector4 (vector.X, vector.Y, vector.Z, 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -545,10 +537,10 @@ namespace SceneKit
|
|||
/// <param name="y">Y translation.</param>
|
||||
/// <param name="z">Z translation.</param>
|
||||
/// <returns>The resulting SCNMatrix4 instance.</returns>
|
||||
public static SCNMatrix4 CreateTranslation(pfloat x, pfloat y, pfloat z)
|
||||
public static SCNMatrix4 CreateTranslation (pfloat x, pfloat y, pfloat z)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateTranslation(x, y, z, out result);
|
||||
CreateTranslation (x, y, z, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -557,10 +549,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vector">The translation vector.</param>
|
||||
/// <returns>The resulting SCNMatrix4 instance.</returns>
|
||||
public static SCNMatrix4 CreateTranslation(SCNVector3 vector)
|
||||
public static SCNMatrix4 CreateTranslation (SCNVector3 vector)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateTranslation(vector.X, vector.Y, vector.Z, out result);
|
||||
CreateTranslation (vector.X, vector.Y, vector.Z, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -576,9 +568,9 @@ namespace SceneKit
|
|||
/// <param name="zNear">The near edge of the projection volume.</param>
|
||||
/// <param name="zFar">The far edge of the projection volume.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateOrthographic(pfloat width, pfloat height, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
public static void CreateOrthographic (pfloat width, pfloat height, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
{
|
||||
CreateOrthographicOffCenter(-width / 2, width / 2, -height / 2, height / 2, zNear, zFar, out result);
|
||||
CreateOrthographicOffCenter (-width / 2, width / 2, -height / 2, height / 2, zNear, zFar, out result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -589,10 +581,10 @@ namespace SceneKit
|
|||
/// <param name="zNear">The near edge of the projection volume.</param>
|
||||
/// <param name="zFar">The far edge of the projection volume.</param>
|
||||
/// <rereturns>The resulting SCNMatrix4 instance.</rereturns>
|
||||
public static SCNMatrix4 CreateOrthographic(pfloat width, pfloat height, pfloat zNear, pfloat zFar)
|
||||
public static SCNMatrix4 CreateOrthographic (pfloat width, pfloat height, pfloat zNear, pfloat zFar)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateOrthographicOffCenter(-width / 2, width / 2, -height / 2, height / 2, zNear, zFar, out result);
|
||||
CreateOrthographicOffCenter (-width / 2, width / 2, -height / 2, height / 2, zNear, zFar, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -610,9 +602,9 @@ namespace SceneKit
|
|||
/// <param name="zNear">The near edge of the projection volume.</param>
|
||||
/// <param name="zFar">The far edge of the projection volume.</param>
|
||||
/// <param name="result">The resulting SCNMatrix4 instance.</param>
|
||||
public static void CreateOrthographicOffCenter(pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
public static void CreateOrthographicOffCenter (pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
{
|
||||
result = new SCNMatrix4();
|
||||
result = new SCNMatrix4 ();
|
||||
|
||||
pfloat invRL = 1 / (right - left);
|
||||
pfloat invTB = 1 / (top - bottom);
|
||||
|
@ -638,10 +630,10 @@ namespace SceneKit
|
|||
/// <param name="zNear">The near edge of the projection volume.</param>
|
||||
/// <param name="zFar">The far edge of the projection volume.</param>
|
||||
/// <returns>The resulting SCNMatrix4 instance.</returns>
|
||||
public static SCNMatrix4 CreateOrthographicOffCenter(pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar)
|
||||
public static SCNMatrix4 CreateOrthographicOffCenter (pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreateOrthographicOffCenter(left, right, bottom, top, zNear, zFar, out result);
|
||||
CreateOrthographicOffCenter (left, right, bottom, top, zNear, zFar, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -667,25 +659,25 @@ namespace SceneKit
|
|||
/// <item>zNear is larger than zFar</item>
|
||||
/// </list>
|
||||
/// </exception>
|
||||
public static void CreatePerspectiveFieldOfView(pfloat fovy, pfloat aspect, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
public static void CreatePerspectiveFieldOfView (pfloat fovy, pfloat aspect, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
{
|
||||
if (fovy <= 0 || fovy > Math.PI)
|
||||
throw new ArgumentOutOfRangeException("fovy");
|
||||
throw new ArgumentOutOfRangeException ("fovy");
|
||||
if (aspect <= 0)
|
||||
throw new ArgumentOutOfRangeException("aspect");
|
||||
throw new ArgumentOutOfRangeException ("aspect");
|
||||
if (zNear <= 0)
|
||||
throw new ArgumentOutOfRangeException("zNear");
|
||||
throw new ArgumentOutOfRangeException ("zNear");
|
||||
if (zFar <= 0)
|
||||
throw new ArgumentOutOfRangeException("zFar");
|
||||
throw new ArgumentOutOfRangeException ("zFar");
|
||||
if (zNear >= zFar)
|
||||
throw new ArgumentOutOfRangeException("zNear");
|
||||
throw new ArgumentOutOfRangeException ("zNear");
|
||||
|
||||
pfloat yMax = zNear * (float)System.Math.Tan(0.5f * fovy);
|
||||
pfloat yMax = zNear * (float) System.Math.Tan (0.5f * fovy);
|
||||
pfloat yMin = -yMax;
|
||||
pfloat xMin = yMin * aspect;
|
||||
pfloat xMax = yMax * aspect;
|
||||
|
||||
CreatePerspectiveOffCenter(xMin, xMax, yMin, yMax, zNear, zFar, out result);
|
||||
CreatePerspectiveOffCenter (xMin, xMax, yMin, yMax, zNear, zFar, out result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -706,10 +698,10 @@ namespace SceneKit
|
|||
/// <item>zNear is larger than zFar</item>
|
||||
/// </list>
|
||||
/// </exception>
|
||||
public static SCNMatrix4 CreatePerspectiveFieldOfView(pfloat fovy, pfloat aspect, pfloat zNear, pfloat zFar)
|
||||
public static SCNMatrix4 CreatePerspectiveFieldOfView (pfloat fovy, pfloat aspect, pfloat zNear, pfloat zFar)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreatePerspectiveFieldOfView(fovy, aspect, zNear, zFar, out result);
|
||||
CreatePerspectiveFieldOfView (fovy, aspect, zNear, zFar, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -735,14 +727,14 @@ namespace SceneKit
|
|||
/// <item>zNear is larger than zFar</item>
|
||||
/// </list>
|
||||
/// </exception>
|
||||
public static void CreatePerspectiveOffCenter(pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
public static void CreatePerspectiveOffCenter (pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar, out SCNMatrix4 result)
|
||||
{
|
||||
if (zNear <= 0)
|
||||
throw new ArgumentOutOfRangeException("zNear");
|
||||
throw new ArgumentOutOfRangeException ("zNear");
|
||||
if (zFar <= 0)
|
||||
throw new ArgumentOutOfRangeException("zFar");
|
||||
throw new ArgumentOutOfRangeException ("zFar");
|
||||
if (zNear >= zFar)
|
||||
throw new ArgumentOutOfRangeException("zNear");
|
||||
throw new ArgumentOutOfRangeException ("zNear");
|
||||
|
||||
pfloat x = (2.0f * zNear) / (right - left);
|
||||
pfloat y = (2.0f * zNear) / (top - bottom);
|
||||
|
@ -751,7 +743,7 @@ namespace SceneKit
|
|||
pfloat c = -(zFar + zNear) / (zFar - zNear);
|
||||
pfloat d = -(2.0f * zFar * zNear) / (zFar - zNear);
|
||||
|
||||
result = new SCNMatrix4(x, 0, 0, 0,
|
||||
result = new SCNMatrix4 (x, 0, 0, 0,
|
||||
0, y, 0, 0,
|
||||
a, b, c, -1,
|
||||
0, 0, d, 0);
|
||||
|
@ -775,10 +767,10 @@ namespace SceneKit
|
|||
/// <item>zNear is larger than zFar</item>
|
||||
/// </list>
|
||||
/// </exception>
|
||||
public static SCNMatrix4 CreatePerspectiveOffCenter(pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar)
|
||||
public static SCNMatrix4 CreatePerspectiveOffCenter (pfloat left, pfloat right, pfloat bottom, pfloat top, pfloat zNear, pfloat zFar)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
CreatePerspectiveOffCenter(left, right, bottom, top, zNear, zFar, out result);
|
||||
CreatePerspectiveOffCenter (left, right, bottom, top, zNear, zFar, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -791,9 +783,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="scale">Single scale factor for x,y and z axes</param>
|
||||
/// <returns>A scaling matrix</returns>
|
||||
public static SCNMatrix4 Scale(pfloat scale)
|
||||
public static SCNMatrix4 Scale (pfloat scale)
|
||||
{
|
||||
return Scale(scale, scale, scale);
|
||||
return Scale (scale, scale, scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -801,9 +793,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="scale">Scale factors for x,y and z axes</param>
|
||||
/// <returns>A scaling matrix</returns>
|
||||
public static SCNMatrix4 Scale(SCNVector3 scale)
|
||||
public static SCNMatrix4 Scale (SCNVector3 scale)
|
||||
{
|
||||
return Scale(scale.X, scale.Y, scale.Z);
|
||||
return Scale (scale.X, scale.Y, scale.Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -813,7 +805,7 @@ namespace SceneKit
|
|||
/// <param name="y">Scale factor for y-axis</param>
|
||||
/// <param name="z">Scale factor for z-axis</param>
|
||||
/// <returns>A scaling matrix</returns>
|
||||
public static SCNMatrix4 Scale(pfloat x, pfloat y, pfloat z)
|
||||
public static SCNMatrix4 Scale (pfloat x, pfloat y, pfloat z)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
result.Row0 = SCNVector4.UnitX * x;
|
||||
|
@ -832,13 +824,13 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">the quaternion</param>
|
||||
/// <returns>A rotation matrix</returns>
|
||||
public static SCNMatrix4 Rotate(Quaternion q)
|
||||
public static SCNMatrix4 Rotate (Quaternion q)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
Vector3 axis;
|
||||
float angle;
|
||||
q.ToAxisAngle(out axis, out angle);
|
||||
CreateFromAxisAngle(axis, angle, out result);
|
||||
q.ToAxisAngle (out axis, out angle);
|
||||
CreateFromAxisAngle (axis, angle, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -847,13 +839,13 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">the quaternion</param>
|
||||
/// <returns>A rotation matrix</returns>
|
||||
public static SCNMatrix4 Rotate(Quaterniond q)
|
||||
public static SCNMatrix4 Rotate (Quaterniond q)
|
||||
{
|
||||
Vector3d axis;
|
||||
double angle;
|
||||
SCNMatrix4 result;
|
||||
q.ToAxisAngle(out axis, out angle);
|
||||
CreateFromAxisAngle(axis, angle, out result);
|
||||
q.ToAxisAngle (out axis, out angle);
|
||||
CreateFromAxisAngle (axis, angle, out result);
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
@ -867,18 +859,18 @@ namespace SceneKit
|
|||
/// <param name="target">Target position in world space</param>
|
||||
/// <param name="up">Up vector in world space (should not be parallel to the camera direction, that is target - eye)</param>
|
||||
/// <returns>A SCNMatrix4 that transforms world space to camera space</returns>
|
||||
public static SCNMatrix4 LookAt(SCNVector3 eye, SCNVector3 target, SCNVector3 up)
|
||||
public static SCNMatrix4 LookAt (SCNVector3 eye, SCNVector3 target, SCNVector3 up)
|
||||
{
|
||||
SCNVector3 z = SCNVector3.Normalize(eye - target);
|
||||
SCNVector3 x = SCNVector3.Normalize(SCNVector3.Cross(up, z));
|
||||
SCNVector3 y = SCNVector3.Normalize(SCNVector3.Cross(z, x));
|
||||
SCNVector3 z = SCNVector3.Normalize (eye - target);
|
||||
SCNVector3 x = SCNVector3.Normalize (SCNVector3.Cross (up, z));
|
||||
SCNVector3 y = SCNVector3.Normalize (SCNVector3.Cross (z, x));
|
||||
|
||||
SCNMatrix4 rot = new SCNMatrix4(new SCNVector4(x.X, y.X, z.X, 0.0f),
|
||||
new SCNVector4(x.Y, y.Y, z.Y, 0.0f),
|
||||
new SCNVector4(x.Z, y.Z, z.Z, 0.0f),
|
||||
SCNMatrix4 rot = new SCNMatrix4 (new SCNVector4 (x.X, y.X, z.X, 0.0f),
|
||||
new SCNVector4 (x.Y, y.Y, z.Y, 0.0f),
|
||||
new SCNVector4 (x.Z, y.Z, z.Z, 0.0f),
|
||||
SCNVector4.UnitW);
|
||||
|
||||
SCNMatrix4 trans = SCNMatrix4.CreateTranslation(-eye);
|
||||
SCNMatrix4 trans = SCNMatrix4.CreateTranslation (-eye);
|
||||
|
||||
return trans * rot;
|
||||
}
|
||||
|
@ -896,9 +888,9 @@ namespace SceneKit
|
|||
/// <param name="upY">Up vector in world space (should not be parallel to the camera direction, that is target - eye)</param>
|
||||
/// <param name="upZ">Up vector in world space (should not be parallel to the camera direction, that is target - eye)</param>
|
||||
/// <returns>A SCNMatrix4 that transforms world space to camera space</returns>
|
||||
public static SCNMatrix4 LookAt(pfloat eyeX, pfloat eyeY, pfloat eyeZ, pfloat targetX, pfloat targetY, pfloat targetZ, pfloat upX, pfloat upY, pfloat upZ)
|
||||
public static SCNMatrix4 LookAt (pfloat eyeX, pfloat eyeY, pfloat eyeZ, pfloat targetX, pfloat targetY, pfloat targetZ, pfloat upX, pfloat upY, pfloat upZ)
|
||||
{
|
||||
return LookAt(new SCNVector3(eyeX, eyeY, eyeZ), new SCNVector3(targetX, targetY, targetZ), new SCNVector3(upX, upY, upZ));
|
||||
return LookAt (new SCNVector3 (eyeX, eyeY, eyeZ), new SCNVector3 (targetX, targetY, targetZ), new SCNVector3 (upX, upY, upZ));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -911,10 +903,10 @@ namespace SceneKit
|
|||
/// <param name="left">The left operand of the multiplication.</param>
|
||||
/// <param name="right">The right operand of the multiplication.</param>
|
||||
/// <returns>A new instance that is the result of the multiplication</returns>
|
||||
public static SCNMatrix4 Mult(SCNMatrix4 left, SCNMatrix4 right)
|
||||
public static SCNMatrix4 Mult (SCNMatrix4 left, SCNMatrix4 right)
|
||||
{
|
||||
SCNMatrix4 result;
|
||||
Mult(ref left, ref right, out result);
|
||||
Mult (ref left, ref right, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -924,9 +916,9 @@ namespace SceneKit
|
|||
/// <param name="left">The left operand of the multiplication.</param>
|
||||
/// <param name="right">The right operand of the multiplication.</param>
|
||||
/// <param name="result">A new instance that is the result of the multiplication</param>
|
||||
public static void Mult(ref SCNMatrix4 left, ref SCNMatrix4 right, out SCNMatrix4 result)
|
||||
public static void Mult (ref SCNMatrix4 left, ref SCNMatrix4 right, out SCNMatrix4 result)
|
||||
{
|
||||
result = new SCNMatrix4(
|
||||
result = new SCNMatrix4 (
|
||||
left.M11 * right.M11 + left.M12 * right.M21 + left.M13 * right.M31 + left.M14 * right.M41,
|
||||
left.M11 * right.M12 + left.M12 * right.M22 + left.M13 * right.M32 + left.M14 * right.M42,
|
||||
left.M11 * right.M13 + left.M12 * right.M23 + left.M13 * right.M33 + left.M14 * right.M43,
|
||||
|
@ -955,107 +947,92 @@ namespace SceneKit
|
|||
/// <param name="mat">The matrix to invert</param>
|
||||
/// <returns>The inverse of the given matrix if it has one, or the input if it is singular</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if the SCNMatrix4 is singular.</exception>
|
||||
public static SCNMatrix4 Invert(SCNMatrix4 mat)
|
||||
public static SCNMatrix4 Invert (SCNMatrix4 mat)
|
||||
{
|
||||
int[] colIdx = { 0, 0, 0, 0 };
|
||||
int[] rowIdx = { 0, 0, 0, 0 };
|
||||
int[] pivotIdx = { -1, -1, -1, -1 };
|
||||
int [] colIdx = { 0, 0, 0, 0 };
|
||||
int [] rowIdx = { 0, 0, 0, 0 };
|
||||
int [] pivotIdx = { -1, -1, -1, -1 };
|
||||
|
||||
// convert the matrix to an array for easy looping
|
||||
pfloat[,] inverse = {{mat.Row0.X, mat.Row0.Y, mat.Row0.Z, mat.Row0.W},
|
||||
pfloat [,] inverse = {{mat.Row0.X, mat.Row0.Y, mat.Row0.Z, mat.Row0.W},
|
||||
{mat.Row1.X, mat.Row1.Y, mat.Row1.Z, mat.Row1.W},
|
||||
{mat.Row2.X, mat.Row2.Y, mat.Row2.Z, mat.Row2.W},
|
||||
{mat.Row3.X, mat.Row3.Y, mat.Row3.Z, mat.Row3.W} };
|
||||
int icol = 0;
|
||||
int irow = 0;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
for (int i = 0; i < 4; i++) {
|
||||
// Find the largest pivot value
|
||||
pfloat maxPivot = 0.0f;
|
||||
for (int j = 0; j < 4; j++)
|
||||
{
|
||||
if (pivotIdx[j] != 0)
|
||||
{
|
||||
for (int k = 0; k < 4; ++k)
|
||||
{
|
||||
if (pivotIdx[k] == -1)
|
||||
{
|
||||
pfloat absVal = (pfloat)System.Math.Abs(inverse[j, k]);
|
||||
if (absVal > maxPivot)
|
||||
{
|
||||
for (int j = 0; j < 4; j++) {
|
||||
if (pivotIdx [j] != 0) {
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
if (pivotIdx [k] == -1) {
|
||||
pfloat absVal = (pfloat) System.Math.Abs (inverse [j, k]);
|
||||
if (absVal > maxPivot) {
|
||||
maxPivot = absVal;
|
||||
irow = j;
|
||||
icol = k;
|
||||
}
|
||||
}
|
||||
else if (pivotIdx[k] > 0)
|
||||
{
|
||||
} else if (pivotIdx [k] > 0) {
|
||||
return mat;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
++(pivotIdx[icol]);
|
||||
++(pivotIdx [icol]);
|
||||
|
||||
// Swap rows over so pivot is on diagonal
|
||||
if (irow != icol)
|
||||
{
|
||||
for (int k = 0; k < 4; ++k)
|
||||
{
|
||||
pfloat f = inverse[irow, k];
|
||||
inverse[irow, k] = inverse[icol, k];
|
||||
inverse[icol, k] = f;
|
||||
if (irow != icol) {
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
pfloat f = inverse [irow, k];
|
||||
inverse [irow, k] = inverse [icol, k];
|
||||
inverse [icol, k] = f;
|
||||
}
|
||||
}
|
||||
|
||||
rowIdx[i] = irow;
|
||||
colIdx[i] = icol;
|
||||
rowIdx [i] = irow;
|
||||
colIdx [i] = icol;
|
||||
|
||||
pfloat pivot = inverse[icol, icol];
|
||||
pfloat pivot = inverse [icol, icol];
|
||||
// check for singular matrix
|
||||
if (pivot == 0.0f)
|
||||
{
|
||||
throw new InvalidOperationException("Matrix is singular and cannot be inverted.");
|
||||
if (pivot == 0.0f) {
|
||||
throw new InvalidOperationException ("Matrix is singular and cannot be inverted.");
|
||||
//return mat;
|
||||
}
|
||||
|
||||
// Scale row so it has a unit diagonal
|
||||
pfloat oneOverPivot = 1.0f / pivot;
|
||||
inverse[icol, icol] = 1.0f;
|
||||
inverse [icol, icol] = 1.0f;
|
||||
for (int k = 0; k < 4; ++k)
|
||||
inverse[icol, k] *= oneOverPivot;
|
||||
inverse [icol, k] *= oneOverPivot;
|
||||
|
||||
// Do elimination of non-diagonal elements
|
||||
for (int j = 0; j < 4; ++j)
|
||||
{
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
// check this isn't on the diagonal
|
||||
if (icol != j)
|
||||
{
|
||||
pfloat f = inverse[j, icol];
|
||||
inverse[j, icol] = 0.0f;
|
||||
if (icol != j) {
|
||||
pfloat f = inverse [j, icol];
|
||||
inverse [j, icol] = 0.0f;
|
||||
for (int k = 0; k < 4; ++k)
|
||||
inverse[j, k] -= inverse[icol, k] * f;
|
||||
inverse [j, k] -= inverse [icol, k] * f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 3; j >= 0; --j)
|
||||
{
|
||||
int ir = rowIdx[j];
|
||||
int ic = colIdx[j];
|
||||
for (int k = 0; k < 4; ++k)
|
||||
{
|
||||
pfloat f = inverse[k, ir];
|
||||
inverse[k, ir] = inverse[k, ic];
|
||||
inverse[k, ic] = f;
|
||||
for (int j = 3; j >= 0; --j) {
|
||||
int ir = rowIdx [j];
|
||||
int ic = colIdx [j];
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
pfloat f = inverse [k, ir];
|
||||
inverse [k, ir] = inverse [k, ic];
|
||||
inverse [k, ic] = f;
|
||||
}
|
||||
}
|
||||
|
||||
mat.Row0 = new SCNVector4(inverse[0, 0], inverse[0, 1], inverse[0, 2], inverse[0, 3]);
|
||||
mat.Row1 = new SCNVector4(inverse[1, 0], inverse[1, 1], inverse[1, 2], inverse[1, 3]);
|
||||
mat.Row2 = new SCNVector4(inverse[2, 0], inverse[2, 1], inverse[2, 2], inverse[2, 3]);
|
||||
mat.Row3 = new SCNVector4(inverse[3, 0], inverse[3, 1], inverse[3, 2], inverse[3, 3]);
|
||||
mat.Row0 = new SCNVector4 (inverse [0, 0], inverse [0, 1], inverse [0, 2], inverse [0, 3]);
|
||||
mat.Row1 = new SCNVector4 (inverse [1, 0], inverse [1, 1], inverse [1, 2], inverse [1, 3]);
|
||||
mat.Row2 = new SCNVector4 (inverse [2, 0], inverse [2, 1], inverse [2, 2], inverse [2, 3]);
|
||||
mat.Row3 = new SCNVector4 (inverse [3, 0], inverse [3, 1], inverse [3, 2], inverse [3, 3]);
|
||||
return mat;
|
||||
}
|
||||
|
||||
|
@ -1068,9 +1045,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="mat">The matrix to transpose</param>
|
||||
/// <returns>The transpose of the given matrix</returns>
|
||||
public static SCNMatrix4 Transpose(SCNMatrix4 mat)
|
||||
public static SCNMatrix4 Transpose (SCNMatrix4 mat)
|
||||
{
|
||||
return new SCNMatrix4(mat.Column0, mat.Column1, mat.Column2, mat.Column3);
|
||||
return new SCNMatrix4 (mat.Column0, mat.Column1, mat.Column2, mat.Column3);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1079,7 +1056,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="mat">The matrix to transpose</param>
|
||||
/// <param name="result">The result of the calculation</param>
|
||||
public static void Transpose(ref SCNMatrix4 mat, out SCNMatrix4 result)
|
||||
public static void Transpose (ref SCNMatrix4 mat, out SCNMatrix4 result)
|
||||
{
|
||||
result.Row0 = mat.Column0;
|
||||
result.Row1 = mat.Column1;
|
||||
|
@ -1099,9 +1076,9 @@ namespace SceneKit
|
|||
/// <param name="left">left-hand operand</param>
|
||||
/// <param name="right">right-hand operand</param>
|
||||
/// <returns>A new SCNMatrix44 which holds the result of the multiplication</returns>
|
||||
public static SCNMatrix4 operator *(SCNMatrix4 left, SCNMatrix4 right)
|
||||
public static SCNMatrix4 operator * (SCNMatrix4 left, SCNMatrix4 right)
|
||||
{
|
||||
return SCNMatrix4.Mult(left, right);
|
||||
return SCNMatrix4.Mult (left, right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1110,9 +1087,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(SCNMatrix4 left, SCNMatrix4 right)
|
||||
public static bool operator == (SCNMatrix4 left, SCNMatrix4 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
return left.Equals (right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1121,9 +1098,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(SCNMatrix4 left, SCNMatrix4 right)
|
||||
public static bool operator != (SCNMatrix4 left, SCNMatrix4 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1136,9 +1113,9 @@ namespace SceneKit
|
|||
/// Returns a System.String that represents the current SCNMatrix44.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format("{0}\n{1}\n{2}\n{3}", Row0, Row1, Row2, Row3);
|
||||
return String.Format ("{0}\n{1}\n{2}\n{3}", Row0, Row1, Row2, Row3);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1149,9 +1126,9 @@ namespace SceneKit
|
|||
/// Returns the hashcode for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
|
||||
public override int GetHashCode()
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode() ^ Row3.GetHashCode();
|
||||
return Row0.GetHashCode () ^ Row1.GetHashCode () ^ Row2.GetHashCode () ^ Row3.GetHashCode ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1168,7 +1145,7 @@ namespace SceneKit
|
|||
if (!(obj is SCNMatrix4))
|
||||
return false;
|
||||
|
||||
return this.Equals((SCNMatrix4)obj);
|
||||
return this.Equals ((SCNMatrix4) obj);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1182,7 +1159,7 @@ namespace SceneKit
|
|||
/// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
|
||||
/// <param name="other">An matrix to compare with this matrix.</param>
|
||||
/// <returns>true if the current matrix is equal to the matrix parameter; otherwise, false.</returns>
|
||||
public bool Equals(SCNMatrix4 other)
|
||||
public bool Equals (SCNMatrix4 other)
|
||||
{
|
||||
return
|
||||
Row0 == other.Row0 &&
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace SceneKit {
|
|||
/// </summary>
|
||||
[Serializable]
|
||||
public struct SCNMatrix4 : IEquatable<SCNMatrix4> {
|
||||
#region Fields
|
||||
#region Fields
|
||||
|
||||
/*
|
||||
* SCNMatrix4 is defined like this for iOS, tvOS and watchOS:
|
||||
|
@ -104,9 +104,9 @@ namespace SceneKit {
|
|||
/// </summary>
|
||||
public readonly static SCNMatrix4 Identity = new SCNMatrix4 (SCNVector4.UnitX, SCNVector4.UnitY, SCNVector4.UnitZ, SCNVector4.UnitW);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance.
|
||||
|
@ -164,11 +164,11 @@ namespace SceneKit {
|
|||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
#region Public Members
|
||||
|
||||
#region Properties
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// The determinant of this matrix
|
||||
|
@ -317,11 +317,11 @@ namespace SceneKit {
|
|||
/// </summary>
|
||||
public pfloat M44 { get { return Column3.W; } set { Column3.W = value; } }
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Instance
|
||||
#region Instance
|
||||
|
||||
#region public void Invert()
|
||||
#region public void Invert()
|
||||
|
||||
/// <summary>
|
||||
/// Converts this instance into its inverse.
|
||||
|
@ -331,9 +331,9 @@ namespace SceneKit {
|
|||
this = SCNMatrix4.Invert (this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region public void Transpose()
|
||||
#region public void Transpose()
|
||||
|
||||
/// <summary>
|
||||
/// Converts this instance into its transpose.
|
||||
|
@ -343,13 +343,13 @@ namespace SceneKit {
|
|||
this = SCNMatrix4.Transpose (this);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Static
|
||||
#region Static
|
||||
|
||||
#region CreateFromColumns
|
||||
#region CreateFromColumns
|
||||
|
||||
public static SCNMatrix4 CreateFromColumns (SCNVector4 column0, SCNVector4 column1, SCNVector4 column2, SCNVector4 column3)
|
||||
{
|
||||
|
@ -370,9 +370,9 @@ namespace SceneKit {
|
|||
result.Column3 = column3;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreateFromAxisAngle
|
||||
#region CreateFromAxisAngle
|
||||
|
||||
/// <summary>
|
||||
/// Build a rotation matrix from the specified axis/angle rotation.
|
||||
|
@ -476,9 +476,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreateRotation[XYZ]
|
||||
#region CreateRotation[XYZ]
|
||||
|
||||
/// <summary>
|
||||
/// Builds a rotation matrix for a rotation around the x-axis.
|
||||
|
@ -567,9 +567,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreateTranslation
|
||||
#region CreateTranslation
|
||||
|
||||
/// <summary>
|
||||
/// Creates a translation matrix.
|
||||
|
@ -623,9 +623,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreateOrthographic
|
||||
#region CreateOrthographic
|
||||
|
||||
/// <summary>
|
||||
/// Creates an orthographic projection matrix.
|
||||
|
@ -655,9 +655,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreateOrthographicOffCenter
|
||||
#region CreateOrthographicOffCenter
|
||||
|
||||
/// <summary>
|
||||
/// Creates an orthographic projection matrix.
|
||||
|
@ -704,9 +704,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreatePerspectiveFieldOfView
|
||||
#region CreatePerspectiveFieldOfView
|
||||
|
||||
/// <summary>
|
||||
/// Creates a perspective projection matrix.
|
||||
|
@ -772,9 +772,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region CreatePerspectiveOffCenter
|
||||
#region CreatePerspectiveOffCenter
|
||||
|
||||
/// <summary>
|
||||
/// Creates an perspective projection matrix.
|
||||
|
@ -842,9 +842,9 @@ namespace SceneKit {
|
|||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Scale Functions
|
||||
#region Scale Functions
|
||||
|
||||
/// <summary>
|
||||
/// Build a scaling matrix
|
||||
|
@ -882,9 +882,9 @@ namespace SceneKit {
|
|||
0, 0, 0, 1);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Rotation Functions
|
||||
#region Rotation Functions
|
||||
|
||||
/// <summary>
|
||||
/// Build a rotation matrix from a quaternion
|
||||
|
@ -915,9 +915,9 @@ namespace SceneKit {
|
|||
CreateFromAxisAngle (axis, angle, out result);
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Camera Helper Functions
|
||||
#region Camera Helper Functions
|
||||
|
||||
/// <summary>
|
||||
/// Build a world space to camera space matrix
|
||||
|
@ -961,9 +961,9 @@ namespace SceneKit {
|
|||
return LookAt (new SCNVector3 (eyeX, eyeY, eyeZ), new SCNVector3 (targetX, targetY, targetZ), new SCNVector3 (upX, upY, upZ));
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Multiply Functions
|
||||
#region Multiply Functions
|
||||
|
||||
/// <summary>
|
||||
/// Combines two transformation matrices.
|
||||
|
@ -1054,9 +1054,9 @@ namespace SceneKit {
|
|||
left.Column0.W * right.Column3.X + left.Column1.W * right.Column3.Y + left.Column2.W * right.Column3.Z + left.Column3.W * right.Column3.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Invert Functions
|
||||
#region Invert Functions
|
||||
|
||||
static bool InvertSoftware (SCNMatrix4 matrix, out SCNMatrix4 result)
|
||||
{
|
||||
|
@ -1148,9 +1148,9 @@ namespace SceneKit {
|
|||
return inverse;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Transpose
|
||||
#region Transpose
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the transpose of the given matrix
|
||||
|
@ -1173,11 +1173,11 @@ namespace SceneKit {
|
|||
result = new SCNMatrix4 (mat.Column0, mat.Column1, mat.Column2, mat.Column3);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Operators
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Matrix multiplication
|
||||
|
@ -1212,11 +1212,11 @@ namespace SceneKit {
|
|||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Overrides
|
||||
#region Overrides
|
||||
|
||||
#region public override string ToString()
|
||||
#region public override string ToString()
|
||||
|
||||
/// <summary>
|
||||
/// Returns a System.String that represents the current SCNMatrix4.
|
||||
|
@ -1227,9 +1227,9 @@ namespace SceneKit {
|
|||
return String.Format ("{0}\n{1}\n{2}\n{3}", Row0, Row1, Row2, Row3);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region public override int GetHashCode()
|
||||
#region public override int GetHashCode()
|
||||
|
||||
/// <summary>
|
||||
/// Returns the hashcode for this instance.
|
||||
|
@ -1240,9 +1240,9 @@ namespace SceneKit {
|
|||
return Column0.GetHashCode () ^ Column1.GetHashCode () ^ Column2.GetHashCode () ^ Column3.GetHashCode ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region public override bool Equals(object obj)
|
||||
#region public override bool Equals(object obj)
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether this instance and a specified object are equal.
|
||||
|
@ -1257,13 +1257,13 @@ namespace SceneKit {
|
|||
return this.Equals ((SCNMatrix4) obj);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region IEquatable<SCNMatrix4> Members
|
||||
#region IEquatable<SCNMatrix4> Members
|
||||
|
||||
/// <summary>Indicates whether the current matrix is equal to another matrix.</summary>
|
||||
/// <param name="other">An matrix to compare with this matrix.</param>
|
||||
|
@ -1277,7 +1277,7 @@ namespace SceneKit {
|
|||
Column3 == other.Column3;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
static void ToAxisAngle (Quaternion q, out Vector3 axis, out float angle)
|
||||
{
|
||||
|
|
|
@ -19,10 +19,8 @@ using ObjCRuntime;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
public partial class SCNNode : IEnumerable, IEnumerable<SCNNode>
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNNode : IEnumerable, IEnumerable<SCNNode> {
|
||||
public void Add (SCNNode node)
|
||||
{
|
||||
AddChildNode (node);
|
||||
|
@ -64,7 +62,7 @@ namespace SceneKit
|
|||
ObjCRuntime.ThrowHelper.ThrowArgumentException (nameof (key));
|
||||
|
||||
using (var s = new NSString (key))
|
||||
((ISCNAnimatable)this).RemoveAnimation (s, duration);
|
||||
((ISCNAnimatable) this).RemoveAnimation (s, duration);
|
||||
}
|
||||
|
||||
public void RemoveAnimation (string key)
|
||||
|
@ -73,7 +71,7 @@ namespace SceneKit
|
|||
ObjCRuntime.ThrowHelper.ThrowArgumentException (nameof (key));
|
||||
|
||||
using (var s = new NSString (key))
|
||||
((ISCNAnimatable)this).RemoveAnimation (s);
|
||||
((ISCNAnimatable) this).RemoveAnimation (s);
|
||||
}
|
||||
|
||||
public CAAnimation? GetAnimation (string key)
|
||||
|
@ -82,7 +80,7 @@ namespace SceneKit
|
|||
ObjCRuntime.ThrowHelper.ThrowArgumentException (nameof (key));
|
||||
|
||||
using (var s = new NSString (key))
|
||||
return ((ISCNAnimatable)this).GetAnimation (s);
|
||||
return ((ISCNAnimatable) this).GetAnimation (s);
|
||||
}
|
||||
|
||||
public void PauseAnimation (string key)
|
||||
|
@ -91,7 +89,7 @@ namespace SceneKit
|
|||
ObjCRuntime.ThrowHelper.ThrowArgumentException (nameof (key));
|
||||
|
||||
using (var s = new NSString (key))
|
||||
((ISCNAnimatable)this).PauseAnimation (s);
|
||||
((ISCNAnimatable) this).PauseAnimation (s);
|
||||
}
|
||||
|
||||
public void ResumeAnimation (string key)
|
||||
|
@ -100,7 +98,7 @@ namespace SceneKit
|
|||
ObjCRuntime.ThrowHelper.ThrowArgumentException (nameof (key));
|
||||
|
||||
using (var s = new NSString (key))
|
||||
((ISCNAnimatable)this).ResumeAnimation (s);
|
||||
((ISCNAnimatable) this).ResumeAnimation (s);
|
||||
}
|
||||
|
||||
public bool IsAnimationPaused (string key)
|
||||
|
@ -111,7 +109,7 @@ namespace SceneKit
|
|||
bool isPaused;
|
||||
|
||||
using (var s = new NSString (key))
|
||||
isPaused = ((ISCNAnimatable)this).IsAnimationPaused (s);
|
||||
isPaused = ((ISCNAnimatable) this).IsAnimationPaused (s);
|
||||
|
||||
return isPaused;
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@ using System.Runtime.Versioning;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
#if NET
|
||||
[SupportedOSPlatform ("ios")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
|
@ -43,7 +42,7 @@ namespace SceneKit
|
|||
|
||||
internal void Set (NSString key, SCNParticlePropertyController? value)
|
||||
{
|
||||
if (mutDict is null){
|
||||
if (mutDict is null) {
|
||||
mutDict = new NSMutableDictionary (dict);
|
||||
dict = mutDict;
|
||||
}
|
||||
|
@ -178,8 +177,7 @@ namespace SceneKit
|
|||
|
||||
}
|
||||
|
||||
public partial class SCNParticleSystem
|
||||
{
|
||||
public partial class SCNParticleSystem {
|
||||
public SCNPropertyControllers? PropertyControllers {
|
||||
get {
|
||||
var weak = WeakPropertyControllers;
|
||||
|
|
|
@ -15,10 +15,8 @@ using Foundation;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
public partial class SCNPhysicsShape
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNPhysicsShape {
|
||||
public static SCNPhysicsShape Create (SCNPhysicsShape [] shapes, SCNMatrix4 [] transforms)
|
||||
{
|
||||
if (shapes is null)
|
||||
|
@ -105,18 +103,17 @@ namespace SceneKit
|
|||
[Mac (10, 10)]
|
||||
[iOS (8, 0)]
|
||||
#endif
|
||||
public class SCNPhysicsShapeOptions
|
||||
{
|
||||
public class SCNPhysicsShapeOptions {
|
||||
public SCNPhysicsShapeType? ShapeType { get; set; }
|
||||
public bool? KeepAsCompound { get; set; }
|
||||
public SCNVector3? Scale { get; set; }
|
||||
|
||||
public SCNPhysicsShapeOptions () {}
|
||||
public SCNPhysicsShapeOptions () { }
|
||||
|
||||
internal SCNPhysicsShapeOptions (NSDictionary source)
|
||||
{
|
||||
var ret = source [SCNPhysicsShapeOptionsKeys.Type] as NSString;
|
||||
if (ret is not null){
|
||||
if (ret is not null) {
|
||||
if (ret == SCNPhysicsShapeOptionsTypes.BoundingBox)
|
||||
ShapeType = SCNPhysicsShapeType.BoundingBox;
|
||||
else if (ret == SCNPhysicsShapeOptionsTypes.ConcavePolyhedron)
|
||||
|
|
|
@ -11,8 +11,7 @@ using System;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNPhysicsTest {
|
||||
public SCNPhysicsSearchMode SearchMode {
|
||||
get {
|
||||
|
@ -29,7 +28,7 @@ namespace SceneKit
|
|||
}
|
||||
|
||||
set {
|
||||
switch (value){
|
||||
switch (value) {
|
||||
case SCNPhysicsSearchMode.All:
|
||||
_SearchMode = SCNPhysicsTestSearchModeKeys.All;
|
||||
break;
|
||||
|
|
|
@ -55,8 +55,7 @@ using System.Runtime.Versioning;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
/// <summary>
|
||||
/// Represents a Quaternion.
|
||||
/// </summary>
|
||||
|
@ -67,9 +66,8 @@ namespace SceneKit
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SCNQuaternion : IEquatable<SCNQuaternion>
|
||||
{
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct SCNQuaternion : IEquatable<SCNQuaternion> {
|
||||
#region Fields
|
||||
|
||||
SCNVector3 xyz;
|
||||
|
@ -84,7 +82,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="v">The vector part</param>
|
||||
/// <param name="w">The w part</param>
|
||||
public SCNQuaternion(SCNVector3 v, pfloat w)
|
||||
public SCNQuaternion (SCNVector3 v, pfloat w)
|
||||
{
|
||||
this.xyz = v;
|
||||
this.w = w;
|
||||
|
@ -97,8 +95,8 @@ namespace SceneKit
|
|||
/// <param name="y">The y component</param>
|
||||
/// <param name="z">The z component</param>
|
||||
/// <param name="w">The w component</param>
|
||||
public SCNQuaternion(pfloat x, pfloat y, pfloat z, pfloat w)
|
||||
: this(new SCNVector3(x, y, z), w)
|
||||
public SCNQuaternion (pfloat x, pfloat y, pfloat z, pfloat w)
|
||||
: this (new SCNVector3 (x, y, z), w)
|
||||
{ }
|
||||
|
||||
public SCNQuaternion (ref Matrix3 matrix)
|
||||
|
@ -106,14 +104,14 @@ namespace SceneKit
|
|||
#if NET
|
||||
double scale = System.Math.Pow (matrix.GetDeterminant (), 1.0d / 3.0d);
|
||||
#else
|
||||
double scale = System.Math.Pow(matrix.Determinant, 1.0d / 3.0d);
|
||||
double scale = System.Math.Pow (matrix.Determinant, 1.0d / 3.0d);
|
||||
#endif
|
||||
float x, y, z;
|
||||
|
||||
w = (float) (System.Math.Sqrt(System.Math.Max(0, scale + matrix.R0C0 + matrix.R1C1 + matrix.R2C2)) / 2);
|
||||
x = (float) (System.Math.Sqrt(System.Math.Max(0, scale + matrix.R0C0 - matrix.R1C1 - matrix.R2C2)) / 2);
|
||||
y = (float) (System.Math.Sqrt(System.Math.Max(0, scale - matrix.R0C0 + matrix.R1C1 - matrix.R2C2)) / 2);
|
||||
z = (float) (System.Math.Sqrt(System.Math.Max(0, scale - matrix.R0C0 - matrix.R1C1 + matrix.R2C2)) / 2);
|
||||
w = (float) (System.Math.Sqrt (System.Math.Max (0, scale + matrix.R0C0 + matrix.R1C1 + matrix.R2C2)) / 2);
|
||||
x = (float) (System.Math.Sqrt (System.Math.Max (0, scale + matrix.R0C0 - matrix.R1C1 - matrix.R2C2)) / 2);
|
||||
y = (float) (System.Math.Sqrt (System.Math.Max (0, scale - matrix.R0C0 + matrix.R1C1 - matrix.R2C2)) / 2);
|
||||
z = (float) (System.Math.Sqrt (System.Math.Max (0, scale - matrix.R0C0 - matrix.R1C1 + matrix.R2C2)) / 2);
|
||||
|
||||
xyz = new Vector3 (x, y, z);
|
||||
|
||||
|
@ -179,9 +177,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="axis">The resultant axis</param>
|
||||
/// <param name="angle">The resultant angle</param>
|
||||
public void ToAxisAngle(out SCNVector3 axis, out pfloat angle)
|
||||
public void ToAxisAngle (out SCNVector3 axis, out pfloat angle)
|
||||
{
|
||||
SCNVector4 result = ToAxisAngle();
|
||||
SCNVector4 result = ToAxisAngle ();
|
||||
axis = result.Xyz;
|
||||
angle = result.W;
|
||||
}
|
||||
|
@ -190,22 +188,19 @@ namespace SceneKit
|
|||
/// Convert this instance to an axis-angle representation.
|
||||
/// </summary>
|
||||
/// <returns>A Vector4 that is the axis-angle representation of this quaternion.</returns>
|
||||
public SCNVector4 ToAxisAngle()
|
||||
public SCNVector4 ToAxisAngle ()
|
||||
{
|
||||
SCNQuaternion q = this;
|
||||
if (q.W > 1.0f)
|
||||
q.Normalize();
|
||||
q.Normalize ();
|
||||
|
||||
SCNVector4 result = new SCNVector4();
|
||||
SCNVector4 result = new SCNVector4 ();
|
||||
|
||||
result.W = 2.0f * (pfloat)System.Math.Acos(q.W); // angle
|
||||
pfloat den = (pfloat)System.Math.Sqrt(1.0 - q.W * q.W);
|
||||
if (den > 0.0001f)
|
||||
{
|
||||
result.W = 2.0f * (pfloat) System.Math.Acos (q.W); // angle
|
||||
pfloat den = (pfloat) System.Math.Sqrt (1.0 - q.W * q.W);
|
||||
if (den > 0.0001f) {
|
||||
result.Xyz = q.Xyz / den;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// This occurs when the angle is zero.
|
||||
// Not a problem: just set an arbitrary normalized axis.
|
||||
result.Xyz = SCNVector3.UnitX;
|
||||
|
@ -222,11 +217,9 @@ namespace SceneKit
|
|||
/// Gets the length (magnitude) of the quaternion.
|
||||
/// </summary>
|
||||
/// <seealso cref="LengthSquared"/>
|
||||
public float Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)System.Math.Sqrt(W * W + Xyz.LengthSquared);
|
||||
public float Length {
|
||||
get {
|
||||
return (float) System.Math.Sqrt (W * W + Xyz.LengthSquared);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -237,11 +230,9 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Gets the square of the quaternion length (magnitude).
|
||||
/// </summary>
|
||||
public float LengthSquared
|
||||
{
|
||||
get
|
||||
{
|
||||
return (float)(W * W + Xyz.LengthSquared);
|
||||
public float LengthSquared {
|
||||
get {
|
||||
return (float) (W * W + Xyz.LengthSquared);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,7 +243,7 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Scales the Quaternion to unit length.
|
||||
/// </summary>
|
||||
public void Normalize()
|
||||
public void Normalize ()
|
||||
{
|
||||
float scale = 1.0f / this.Length;
|
||||
Xyz *= scale;
|
||||
|
@ -266,7 +257,7 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Convert this quaternion to its conjugate
|
||||
/// </summary>
|
||||
public void Conjugate()
|
||||
public void Conjugate ()
|
||||
{
|
||||
Xyz = -Xyz;
|
||||
}
|
||||
|
@ -282,7 +273,7 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Defines the identity quaternion.
|
||||
/// </summary>
|
||||
public readonly static SCNQuaternion Identity = new SCNQuaternion(0, 0, 0, 1);
|
||||
public readonly static SCNQuaternion Identity = new SCNQuaternion (0, 0, 0, 1);
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -294,9 +285,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first operand</param>
|
||||
/// <param name="right">The second operand</param>
|
||||
/// <returns>The result of the addition</returns>
|
||||
public static SCNQuaternion Add(SCNQuaternion left, SCNQuaternion right)
|
||||
public static SCNQuaternion Add (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
return new SCNQuaternion(
|
||||
return new SCNQuaternion (
|
||||
left.Xyz + right.Xyz,
|
||||
left.W + right.W);
|
||||
}
|
||||
|
@ -307,9 +298,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first operand</param>
|
||||
/// <param name="right">The second operand</param>
|
||||
/// <param name="result">The result of the addition</param>
|
||||
public static void Add(ref SCNQuaternion left, ref SCNQuaternion right, out SCNQuaternion result)
|
||||
public static void Add (ref SCNQuaternion left, ref SCNQuaternion right, out SCNQuaternion result)
|
||||
{
|
||||
result = new SCNQuaternion(
|
||||
result = new SCNQuaternion (
|
||||
left.Xyz + right.Xyz,
|
||||
left.W + right.W);
|
||||
}
|
||||
|
@ -324,9 +315,9 @@ namespace SceneKit
|
|||
/// <param name="left">The left instance.</param>
|
||||
/// <param name="right">The right instance.</param>
|
||||
/// <returns>The result of the operation.</returns>
|
||||
public static SCNQuaternion Sub(SCNQuaternion left, SCNQuaternion right)
|
||||
public static SCNQuaternion Sub (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
return new SCNQuaternion(
|
||||
return new SCNQuaternion (
|
||||
left.Xyz - right.Xyz,
|
||||
left.W - right.W);
|
||||
}
|
||||
|
@ -337,9 +328,9 @@ namespace SceneKit
|
|||
/// <param name="left">The left instance.</param>
|
||||
/// <param name="right">The right instance.</param>
|
||||
/// <param name="result">The result of the operation.</param>
|
||||
public static void Sub(ref SCNQuaternion left, ref SCNQuaternion right, out SCNQuaternion result)
|
||||
public static void Sub (ref SCNQuaternion left, ref SCNQuaternion right, out SCNQuaternion result)
|
||||
{
|
||||
result = new SCNQuaternion(
|
||||
result = new SCNQuaternion (
|
||||
left.Xyz - right.Xyz,
|
||||
left.W - right.W);
|
||||
}
|
||||
|
@ -354,10 +345,10 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static SCNQuaternion Multiply(SCNQuaternion left, SCNQuaternion right)
|
||||
public static SCNQuaternion Multiply (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
SCNQuaternion result;
|
||||
Multiply(ref left, ref right, out result);
|
||||
Multiply (ref left, ref right, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -367,11 +358,11 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
public static void Multiply(ref SCNQuaternion left, ref SCNQuaternion right, out SCNQuaternion result)
|
||||
public static void Multiply (ref SCNQuaternion left, ref SCNQuaternion right, out SCNQuaternion result)
|
||||
{
|
||||
result = new SCNQuaternion(
|
||||
right.W * left.Xyz + left.W * right.Xyz + SCNVector3.Cross(left.Xyz, right.Xyz),
|
||||
left.W * right.W - SCNVector3.Dot(left.Xyz, right.Xyz));
|
||||
result = new SCNQuaternion (
|
||||
right.W * left.Xyz + left.W * right.Xyz + SCNVector3.Cross (left.Xyz, right.Xyz),
|
||||
left.W * right.W - SCNVector3.Dot (left.Xyz, right.Xyz));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -380,9 +371,9 @@ namespace SceneKit
|
|||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
public static void Multiply(ref SCNQuaternion quaternion, float scale, out SCNQuaternion result)
|
||||
public static void Multiply (ref SCNQuaternion quaternion, float scale, out SCNQuaternion result)
|
||||
{
|
||||
result = new SCNQuaternion(quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
result = new SCNQuaternion (quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -391,9 +382,9 @@ namespace SceneKit
|
|||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static SCNQuaternion Multiply(SCNQuaternion quaternion, float scale)
|
||||
public static SCNQuaternion Multiply (SCNQuaternion quaternion, float scale)
|
||||
{
|
||||
return new SCNQuaternion(quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
return new SCNQuaternion (quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -405,9 +396,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">The quaternion</param>
|
||||
/// <returns>The conjugate of the given quaternion</returns>
|
||||
public static SCNQuaternion Conjugate(SCNQuaternion q)
|
||||
public static SCNQuaternion Conjugate (SCNQuaternion q)
|
||||
{
|
||||
return new SCNQuaternion(-q.Xyz, q.W);
|
||||
return new SCNQuaternion (-q.Xyz, q.W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -415,9 +406,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">The quaternion</param>
|
||||
/// <param name="result">The conjugate of the given quaternion</param>
|
||||
public static void Conjugate(ref SCNQuaternion q, out SCNQuaternion result)
|
||||
public static void Conjugate (ref SCNQuaternion q, out SCNQuaternion result)
|
||||
{
|
||||
result = new SCNQuaternion(-q.Xyz, q.W);
|
||||
result = new SCNQuaternion (-q.Xyz, q.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -429,10 +420,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">The quaternion to invert</param>
|
||||
/// <returns>The inverse of the given quaternion</returns>
|
||||
public static SCNQuaternion Invert(SCNQuaternion q)
|
||||
public static SCNQuaternion Invert (SCNQuaternion q)
|
||||
{
|
||||
SCNQuaternion result;
|
||||
Invert(ref q, out result);
|
||||
Invert (ref q, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -441,16 +432,13 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">The quaternion to invert</param>
|
||||
/// <param name="result">The inverse of the given quaternion</param>
|
||||
public static void Invert(ref SCNQuaternion q, out SCNQuaternion result)
|
||||
public static void Invert (ref SCNQuaternion q, out SCNQuaternion result)
|
||||
{
|
||||
float lengthSq = q.LengthSquared;
|
||||
if (lengthSq != 0.0)
|
||||
{
|
||||
if (lengthSq != 0.0) {
|
||||
float i = 1.0f / lengthSq;
|
||||
result = new SCNQuaternion(q.Xyz * -i, q.W * i);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = new SCNQuaternion (q.Xyz * -i, q.W * i);
|
||||
} else {
|
||||
result = q;
|
||||
}
|
||||
}
|
||||
|
@ -464,10 +452,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">The quaternion to normalize</param>
|
||||
/// <returns>The normalized quaternion</returns>
|
||||
public static SCNQuaternion Normalize(SCNQuaternion q)
|
||||
public static SCNQuaternion Normalize (SCNQuaternion q)
|
||||
{
|
||||
SCNQuaternion result;
|
||||
Normalize(ref q, out result);
|
||||
Normalize (ref q, out result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -476,10 +464,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="q">The quaternion to normalize</param>
|
||||
/// <param name="result">The normalized quaternion</param>
|
||||
public static void Normalize(ref SCNQuaternion q, out SCNQuaternion result)
|
||||
public static void Normalize (ref SCNQuaternion q, out SCNQuaternion result)
|
||||
{
|
||||
float scale = 1.0f / q.Length;
|
||||
result = new SCNQuaternion(q.Xyz * scale, q.W * scale);
|
||||
result = new SCNQuaternion (q.Xyz * scale, q.W * scale);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -492,7 +480,7 @@ namespace SceneKit
|
|||
/// <param name="axis">The axis to rotate about</param>
|
||||
/// <param name="angle">The rotation angle in radians</param>
|
||||
/// <returns></returns>
|
||||
public static SCNQuaternion FromAxisAngle(SCNVector3 axis, float angle)
|
||||
public static SCNQuaternion FromAxisAngle (SCNVector3 axis, float angle)
|
||||
{
|
||||
if (axis.LengthSquared == 0.0f)
|
||||
return Identity;
|
||||
|
@ -500,11 +488,11 @@ namespace SceneKit
|
|||
SCNQuaternion result = Identity;
|
||||
|
||||
angle *= 0.5f;
|
||||
axis.Normalize();
|
||||
result.Xyz = axis * (float)System.Math.Sin(angle);
|
||||
result.W = (float)System.Math.Cos(angle);
|
||||
axis.Normalize ();
|
||||
result.Xyz = axis * (float) System.Math.Sin (angle);
|
||||
result.W = (float) System.Math.Cos (angle);
|
||||
|
||||
return Normalize(result);
|
||||
return Normalize (result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -518,32 +506,25 @@ namespace SceneKit
|
|||
/// <param name="q2">The second quaternion</param>
|
||||
/// <param name="blend">The blend factor</param>
|
||||
/// <returns>A smooth blend between the given quaternions</returns>
|
||||
public static SCNQuaternion Slerp(SCNQuaternion q1, SCNQuaternion q2, float blend)
|
||||
public static SCNQuaternion Slerp (SCNQuaternion q1, SCNQuaternion q2, float blend)
|
||||
{
|
||||
// if either input is zero, return the other.
|
||||
if (q1.LengthSquared == 0.0f)
|
||||
{
|
||||
if (q2.LengthSquared == 0.0f)
|
||||
{
|
||||
if (q1.LengthSquared == 0.0f) {
|
||||
if (q2.LengthSquared == 0.0f) {
|
||||
return Identity;
|
||||
}
|
||||
return q2;
|
||||
}
|
||||
else if (q2.LengthSquared == 0.0f)
|
||||
{
|
||||
} else if (q2.LengthSquared == 0.0f) {
|
||||
return q1;
|
||||
}
|
||||
|
||||
|
||||
pfloat cosHalfAngle = q1.W * q2.W + SCNVector3.Dot(q1.Xyz, q2.Xyz);
|
||||
pfloat cosHalfAngle = q1.W * q2.W + SCNVector3.Dot (q1.Xyz, q2.Xyz);
|
||||
|
||||
if (cosHalfAngle >= 1.0f || cosHalfAngle <= -1.0f)
|
||||
{
|
||||
if (cosHalfAngle >= 1.0f || cosHalfAngle <= -1.0f) {
|
||||
// angle = 0.0f, so just return one input.
|
||||
return q1;
|
||||
}
|
||||
else if (cosHalfAngle < 0.0f)
|
||||
{
|
||||
} else if (cosHalfAngle < 0.0f) {
|
||||
q2.Xyz = -q2.Xyz;
|
||||
q2.W = -q2.W;
|
||||
cosHalfAngle = -cosHalfAngle;
|
||||
|
@ -551,25 +532,22 @@ namespace SceneKit
|
|||
|
||||
float blendA;
|
||||
float blendB;
|
||||
if (cosHalfAngle < 0.99f)
|
||||
{
|
||||
if (cosHalfAngle < 0.99f) {
|
||||
// do proper slerp for big angles
|
||||
float halfAngle = (float)System.Math.Acos(cosHalfAngle);
|
||||
float sinHalfAngle = (float)System.Math.Sin(halfAngle);
|
||||
float halfAngle = (float) System.Math.Acos (cosHalfAngle);
|
||||
float sinHalfAngle = (float) System.Math.Sin (halfAngle);
|
||||
float oneOverSinHalfAngle = 1.0f / sinHalfAngle;
|
||||
blendA = (float)System.Math.Sin(halfAngle * (1.0f - blend)) * oneOverSinHalfAngle;
|
||||
blendB = (float)System.Math.Sin(halfAngle * blend) * oneOverSinHalfAngle;
|
||||
}
|
||||
else
|
||||
{
|
||||
blendA = (float) System.Math.Sin (halfAngle * (1.0f - blend)) * oneOverSinHalfAngle;
|
||||
blendB = (float) System.Math.Sin (halfAngle * blend) * oneOverSinHalfAngle;
|
||||
} else {
|
||||
// do lerp if angle is really small.
|
||||
blendA = 1.0f - blend;
|
||||
blendB = blend;
|
||||
}
|
||||
|
||||
SCNQuaternion result = new SCNQuaternion(blendA * q1.Xyz + blendB * q2.Xyz, blendA * q1.W + blendB * q2.W);
|
||||
SCNQuaternion result = new SCNQuaternion (blendA * q1.Xyz + blendB * q2.Xyz, blendA * q1.W + blendB * q2.W);
|
||||
if (result.LengthSquared > 0.0f)
|
||||
return Normalize(result);
|
||||
return Normalize (result);
|
||||
else
|
||||
return Identity;
|
||||
}
|
||||
|
@ -586,7 +564,7 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNQuaternion operator +(SCNQuaternion left, SCNQuaternion right)
|
||||
public static SCNQuaternion operator + (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
left.Xyz += right.Xyz;
|
||||
left.W += right.W;
|
||||
|
@ -599,7 +577,7 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNQuaternion operator -(SCNQuaternion left, SCNQuaternion right)
|
||||
public static SCNQuaternion operator - (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
left.Xyz -= right.Xyz;
|
||||
left.W -= right.W;
|
||||
|
@ -612,9 +590,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNQuaternion operator *(SCNQuaternion left, SCNQuaternion right)
|
||||
public static SCNQuaternion operator * (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
Multiply(ref left, ref right, out left);
|
||||
Multiply (ref left, ref right, out left);
|
||||
return left;
|
||||
}
|
||||
|
||||
|
@ -624,9 +602,9 @@ namespace SceneKit
|
|||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static SCNQuaternion operator *(SCNQuaternion quaternion, float scale)
|
||||
public static SCNQuaternion operator * (SCNQuaternion quaternion, float scale)
|
||||
{
|
||||
Multiply(ref quaternion, scale, out quaternion);
|
||||
Multiply (ref quaternion, scale, out quaternion);
|
||||
return quaternion;
|
||||
}
|
||||
|
||||
|
@ -636,9 +614,9 @@ namespace SceneKit
|
|||
/// <param name="quaternion">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static SCNQuaternion operator *(float scale, SCNQuaternion quaternion)
|
||||
public static SCNQuaternion operator * (float scale, SCNQuaternion quaternion)
|
||||
{
|
||||
return new SCNQuaternion(quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
return new SCNQuaternion (quaternion.X * scale, quaternion.Y * scale, quaternion.Z * scale, quaternion.W * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -647,9 +625,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(SCNQuaternion left, SCNQuaternion right)
|
||||
public static bool operator == (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
return left.Equals (right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -658,9 +636,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(SCNQuaternion left, SCNQuaternion right)
|
||||
public static bool operator != (SCNQuaternion left, SCNQuaternion right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -673,9 +651,9 @@ namespace SceneKit
|
|||
/// Returns a System.String that represents the current Quaternion.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format("V: {0}, W: {1}", Xyz, W);
|
||||
return String.Format ("V: {0}, W: {1}", Xyz, W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -701,9 +679,9 @@ namespace SceneKit
|
|||
/// Provides the hash code for this object.
|
||||
/// </summary>
|
||||
/// <returns>A hash code formed from the bitwise XOR of this objects members.</returns>
|
||||
public override int GetHashCode()
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return Xyz.GetHashCode() ^ W.GetHashCode();
|
||||
return Xyz.GetHashCode () ^ W.GetHashCode ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -719,7 +697,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="other">The other SCNQuaternion to be used in the comparison.</param>
|
||||
/// <returns>True if both instances are equal; false otherwise.</returns>
|
||||
public bool Equals(SCNQuaternion other)
|
||||
public bool Equals (SCNQuaternion other)
|
||||
{
|
||||
return Xyz == other.Xyz && W == other.W;
|
||||
}
|
||||
|
|
|
@ -5,20 +5,19 @@ using ObjCRuntime;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNRenderingOptions {
|
||||
public SCNRenderingApi? RenderingApi {
|
||||
get {
|
||||
var val = GetNUIntValue (SCNRenderingOptionsKeys.RenderingApiKey);
|
||||
if (val is not null)
|
||||
return (SCNRenderingApi)(uint) val;
|
||||
return (SCNRenderingApi) (uint) val;
|
||||
return null;
|
||||
}
|
||||
|
||||
set {
|
||||
if (value.HasValue)
|
||||
SetNumberValue (SCNRenderingOptionsKeys.RenderingApiKey, (nuint)(uint)value.Value);
|
||||
SetNumberValue (SCNRenderingOptionsKeys.RenderingApiKey, (nuint) (uint) value.Value);
|
||||
else
|
||||
RemoveValue (SCNRenderingOptionsKeys.RenderingApiKey);
|
||||
}
|
||||
|
|
|
@ -13,10 +13,8 @@ using System.Collections.Generic;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
public partial class SCNScene : IEnumerable<SCNNode>
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNScene : IEnumerable<SCNNode> {
|
||||
public void Add (SCNNode node)
|
||||
{
|
||||
RootNode.AddChildNode (node);
|
||||
|
|
|
@ -2,8 +2,7 @@ using System;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNSceneLoadingOptions {
|
||||
public SCNAnimationImportPolicy AnimationImportPolicy {
|
||||
get {
|
||||
|
@ -22,7 +21,7 @@ namespace SceneKit
|
|||
}
|
||||
|
||||
set {
|
||||
switch (value){
|
||||
switch (value) {
|
||||
case SCNAnimationImportPolicy.Play:
|
||||
_AnimationImportPolicyKey = SCNSceneSourceLoading.AnimationImportPolicyPlay;
|
||||
break;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace SceneKit {
|
|||
|
||||
#if !XAMCORE_3_0
|
||||
public static partial class SCNSceneRenderer_Extensions {
|
||||
public static SCNHitTestResult[] HitTest (ISCNSceneRenderer This, CGPoint thePoint, SCNHitTestOptions? options)
|
||||
public static SCNHitTestResult [] HitTest (ISCNSceneRenderer This, CGPoint thePoint, SCNHitTestOptions? options)
|
||||
{
|
||||
return This.HitTest (thePoint, options?.Dictionary);
|
||||
}
|
||||
|
|
|
@ -16,8 +16,7 @@ using ObjCRuntime;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
public partial class SCNSceneSource {
|
||||
|
||||
public NSObject? GetEntryWithIdentifier<T> (string uid)
|
||||
|
@ -27,7 +26,7 @@ namespace SceneKit
|
|||
|
||||
public string [] GetIdentifiersOfEntries<T> ()
|
||||
{
|
||||
return CFArray.StringArrayFromHandle (Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, Selector.GetHandle ("identifiersOfEntriesWithClass:"), new Class (typeof(T)).Handle))!;
|
||||
return CFArray.StringArrayFromHandle (Messaging.IntPtr_objc_msgSend_IntPtr (this.Handle, Selector.GetHandle ("identifiersOfEntriesWithClass:"), new Class (typeof (T)).Handle))!;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,12 +38,12 @@ namespace SceneKit {
|
|||
return new NSArray ();
|
||||
|
||||
var count = items.Length;
|
||||
var buf = Marshal.AllocHGlobal ((IntPtr)(count * IntPtr.Size));
|
||||
var buf = Marshal.AllocHGlobal ((IntPtr) (count * IntPtr.Size));
|
||||
|
||||
for (nint i = 0; i < count; i++) {
|
||||
var item = NSValue.FromSCNMatrix4 (items [i]);
|
||||
var h = item?.Handle ?? NSNull.Null.Handle;
|
||||
Marshal.WriteIntPtr (buf, (int)(i * IntPtr.Size), h);
|
||||
Marshal.WriteIntPtr (buf, (int) (i * IntPtr.Size), h);
|
||||
}
|
||||
|
||||
var nsa = new NSArray (NSArray.FromObjects (buf, count));
|
||||
|
|
|
@ -14,11 +14,9 @@ using Foundation;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
public partial class SCNTechnique
|
||||
{
|
||||
public NSObject? this[NSString key] {
|
||||
namespace SceneKit {
|
||||
public partial class SCNTechnique {
|
||||
public NSObject? this [NSString key] {
|
||||
get { return _GetObject (key); }
|
||||
set { _SetObject (value, key); }
|
||||
}
|
||||
|
|
|
@ -53,8 +53,7 @@ using pfloat = System.Single;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
/// <summary>
|
||||
/// Represents a 3D vector using three single-precision floating-point numbers.
|
||||
/// </summary>
|
||||
|
@ -68,9 +67,8 @@ namespace SceneKit
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SCNVector3 : IEquatable<SCNVector3>
|
||||
{
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct SCNVector3 : IEquatable<SCNVector3> {
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
|
@ -98,14 +96,14 @@ namespace SceneKit
|
|||
/// <param name="x">The x component of the Vector3.</param>
|
||||
/// <param name="y">The y component of the Vector3.</param>
|
||||
/// <param name="z">The z component of the Vector3.</param>
|
||||
public SCNVector3(pfloat x, pfloat y, pfloat z)
|
||||
public SCNVector3 (pfloat x, pfloat y, pfloat z)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
}
|
||||
|
||||
public SCNVector3(Vector3 v)
|
||||
public SCNVector3 (Vector3 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -116,7 +114,7 @@ namespace SceneKit
|
|||
/// Constructs a new Vector3 from the given Vector3.
|
||||
/// </summary>
|
||||
/// <param name="v">The Vector3 to copy components from.</param>
|
||||
public SCNVector3(SCNVector3 v)
|
||||
public SCNVector3 (SCNVector3 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -127,7 +125,7 @@ namespace SceneKit
|
|||
/// Constructs a new Vector3 from the given Vector4.
|
||||
/// </summary>
|
||||
/// <param name="v">The Vector4 to copy components from.</param>
|
||||
public SCNVector3(SCNVector4 v)
|
||||
public SCNVector3 (SCNVector4 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -147,11 +145,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <see cref="LengthFast"/>
|
||||
/// <seealso cref="LengthSquared"/>
|
||||
public pfloat Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (pfloat)System.Math.Sqrt(X * X + Y * Y + Z * Z);
|
||||
public pfloat Length {
|
||||
get {
|
||||
return (pfloat) System.Math.Sqrt (X * X + Y * Y + Z * Z);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,11 +164,9 @@ namespace SceneKit
|
|||
/// </remarks>
|
||||
/// <see cref="Length"/>
|
||||
/// <seealso cref="LengthSquared"/>
|
||||
public pfloat LengthFast
|
||||
{
|
||||
get
|
||||
{
|
||||
return (pfloat)(1.0f / MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z));
|
||||
public pfloat LengthFast {
|
||||
get {
|
||||
return (pfloat) (1.0f / MathHelper.InverseSqrtFast (X * X + Y * Y + Z * Z));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,10 +183,8 @@ namespace SceneKit
|
|||
/// </remarks>
|
||||
/// <see cref="Length"/>
|
||||
/// <seealso cref="LengthFast"/>
|
||||
public pfloat LengthSquared
|
||||
{
|
||||
get
|
||||
{
|
||||
public pfloat LengthSquared {
|
||||
get {
|
||||
return X * X + Y * Y + Z * Z;
|
||||
}
|
||||
}
|
||||
|
@ -204,7 +196,7 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Scales the SCNVector3 to unit length.
|
||||
/// </summary>
|
||||
public void Normalize()
|
||||
public void Normalize ()
|
||||
{
|
||||
pfloat scale = 1.0f / this.Length;
|
||||
X *= scale;
|
||||
|
@ -219,9 +211,9 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Scales the SCNVector3 to approximately unit length.
|
||||
/// </summary>
|
||||
public void NormalizeFast()
|
||||
public void NormalizeFast ()
|
||||
{
|
||||
pfloat scale = (pfloat)MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z);
|
||||
pfloat scale = (pfloat) MathHelper.InverseSqrtFast (X * X + Y * Y + Z * Z);
|
||||
X *= scale;
|
||||
Y *= scale;
|
||||
Z *= scale;
|
||||
|
@ -238,32 +230,32 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Defines a unit-length SCNVector3 that points towards the X-axis.
|
||||
/// </summary>
|
||||
public static readonly SCNVector3 UnitX = new SCNVector3(1, 0, 0);
|
||||
public static readonly SCNVector3 UnitX = new SCNVector3 (1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a unit-length SCNVector3 that points towards the Y-axis.
|
||||
/// </summary>
|
||||
public static readonly SCNVector3 UnitY = new SCNVector3(0, 1, 0);
|
||||
public static readonly SCNVector3 UnitY = new SCNVector3 (0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// /// Defines a unit-length SCNVector3 that points towards the Z-axis.
|
||||
/// </summary>
|
||||
public static readonly SCNVector3 UnitZ = new SCNVector3(0, 0, 1);
|
||||
public static readonly SCNVector3 UnitZ = new SCNVector3 (0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a zero-length SCNVector3.
|
||||
/// </summary>
|
||||
public static readonly SCNVector3 Zero = new SCNVector3(0, 0, 0);
|
||||
public static readonly SCNVector3 Zero = new SCNVector3 (0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Defines an instance with all components set to 1.
|
||||
/// </summary>
|
||||
public static readonly SCNVector3 One = new SCNVector3(1, 1, 1);
|
||||
public static readonly SCNVector3 One = new SCNVector3 (1, 1, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the size of the SCNVector3 struct in bytes.
|
||||
/// </summary>
|
||||
public static readonly int SizeInBytes = Marshal.SizeOf(new SCNVector3());
|
||||
public static readonly int SizeInBytes = Marshal.SizeOf (new SCNVector3 ());
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -275,9 +267,9 @@ namespace SceneKit
|
|||
/// <param name="a">Left operand.</param>
|
||||
/// <param name="b">Right operand.</param>
|
||||
/// <returns>Result of operation.</returns>
|
||||
public static SCNVector3 Add(SCNVector3 a, SCNVector3 b)
|
||||
public static SCNVector3 Add (SCNVector3 a, SCNVector3 b)
|
||||
{
|
||||
Add(ref a, ref b, out a);
|
||||
Add (ref a, ref b, out a);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -287,9 +279,9 @@ namespace SceneKit
|
|||
/// <param name="a">Left operand.</param>
|
||||
/// <param name="b">Right operand.</param>
|
||||
/// <param name="result">Result of operation.</param>
|
||||
public static void Add(ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
public static void Add (ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
{
|
||||
result = new SCNVector3(a.X + b.X, a.Y + b.Y, a.Z + b.Z);
|
||||
result = new SCNVector3 (a.X + b.X, a.Y + b.Y, a.Z + b.Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -302,9 +294,9 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>Result of subtraction</returns>
|
||||
public static SCNVector3 Subtract(SCNVector3 a, SCNVector3 b)
|
||||
public static SCNVector3 Subtract (SCNVector3 a, SCNVector3 b)
|
||||
{
|
||||
Subtract(ref a, ref b, out a);
|
||||
Subtract (ref a, ref b, out a);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -314,9 +306,9 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">Result of subtraction</param>
|
||||
public static void Subtract(ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
public static void Subtract (ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
{
|
||||
result = new SCNVector3(a.X - b.X, a.Y - b.Y, a.Z - b.Z);
|
||||
result = new SCNVector3 (a.X - b.X, a.Y - b.Y, a.Z - b.Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -329,9 +321,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector3 Multiply(SCNVector3 vector, pfloat scale)
|
||||
public static SCNVector3 Multiply (SCNVector3 vector, pfloat scale)
|
||||
{
|
||||
Multiply(ref vector, scale, out vector);
|
||||
Multiply (ref vector, scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -341,9 +333,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Multiply(ref SCNVector3 vector, pfloat scale, out SCNVector3 result)
|
||||
public static void Multiply (ref SCNVector3 vector, pfloat scale, out SCNVector3 result)
|
||||
{
|
||||
result = new SCNVector3(vector.X * scale, vector.Y * scale, vector.Z * scale);
|
||||
result = new SCNVector3 (vector.X * scale, vector.Y * scale, vector.Z * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -352,9 +344,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector3 Multiply(SCNVector3 vector, SCNVector3 scale)
|
||||
public static SCNVector3 Multiply (SCNVector3 vector, SCNVector3 scale)
|
||||
{
|
||||
Multiply(ref vector, ref scale, out vector);
|
||||
Multiply (ref vector, ref scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -364,9 +356,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Multiply(ref SCNVector3 vector, ref SCNVector3 scale, out SCNVector3 result)
|
||||
public static void Multiply (ref SCNVector3 vector, ref SCNVector3 scale, out SCNVector3 result)
|
||||
{
|
||||
result = new SCNVector3(vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z);
|
||||
result = new SCNVector3 (vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -379,9 +371,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector3 Divide(SCNVector3 vector, pfloat scale)
|
||||
public static SCNVector3 Divide (SCNVector3 vector, pfloat scale)
|
||||
{
|
||||
Divide(ref vector, scale, out vector);
|
||||
Divide (ref vector, scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -391,9 +383,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Divide(ref SCNVector3 vector, pfloat scale, out SCNVector3 result)
|
||||
public static void Divide (ref SCNVector3 vector, pfloat scale, out SCNVector3 result)
|
||||
{
|
||||
Multiply(ref vector, 1 / scale, out result);
|
||||
Multiply (ref vector, 1 / scale, out result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -402,9 +394,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector3 Divide(SCNVector3 vector, SCNVector3 scale)
|
||||
public static SCNVector3 Divide (SCNVector3 vector, SCNVector3 scale)
|
||||
{
|
||||
Divide(ref vector, ref scale, out vector);
|
||||
Divide (ref vector, ref scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -414,9 +406,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Divide(ref SCNVector3 vector, ref SCNVector3 scale, out SCNVector3 result)
|
||||
public static void Divide (ref SCNVector3 vector, ref SCNVector3 scale, out SCNVector3 result)
|
||||
{
|
||||
result = new SCNVector3(vector.X / scale.X, vector.Y / scale.Y, vector.Z / scale.Z);
|
||||
result = new SCNVector3 (vector.X / scale.X, vector.Y / scale.Y, vector.Z / scale.Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -429,7 +421,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>The component-wise minimum</returns>
|
||||
public static SCNVector3 ComponentMin(SCNVector3 a, SCNVector3 b)
|
||||
public static SCNVector3 ComponentMin (SCNVector3 a, SCNVector3 b)
|
||||
{
|
||||
a.X = a.X < b.X ? a.X : b.X;
|
||||
a.Y = a.Y < b.Y ? a.Y : b.Y;
|
||||
|
@ -443,7 +435,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">The component-wise minimum</param>
|
||||
public static void ComponentMin(ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
public static void ComponentMin (ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
{
|
||||
result.X = a.X < b.X ? a.X : b.X;
|
||||
result.Y = a.Y < b.Y ? a.Y : b.Y;
|
||||
|
@ -460,7 +452,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>The component-wise maximum</returns>
|
||||
public static SCNVector3 ComponentMax(SCNVector3 a, SCNVector3 b)
|
||||
public static SCNVector3 ComponentMax (SCNVector3 a, SCNVector3 b)
|
||||
{
|
||||
a.X = a.X > b.X ? a.X : b.X;
|
||||
a.Y = a.Y > b.Y ? a.Y : b.Y;
|
||||
|
@ -474,7 +466,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">The component-wise maximum</param>
|
||||
public static void ComponentMax(ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
public static void ComponentMax (ref SCNVector3 a, ref SCNVector3 b, out SCNVector3 result)
|
||||
{
|
||||
result.X = a.X > b.X ? a.X : b.X;
|
||||
result.Y = a.Y > b.Y ? a.Y : b.Y;
|
||||
|
@ -491,7 +483,7 @@ namespace SceneKit
|
|||
/// <param name="left">Left operand</param>
|
||||
/// <param name="right">Right operand</param>
|
||||
/// <returns>The minimum SCNVector3</returns>
|
||||
public static SCNVector3 Min(SCNVector3 left, SCNVector3 right)
|
||||
public static SCNVector3 Min (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
return left.LengthSquared < right.LengthSquared ? left : right;
|
||||
}
|
||||
|
@ -506,7 +498,7 @@ namespace SceneKit
|
|||
/// <param name="left">Left operand</param>
|
||||
/// <param name="right">Right operand</param>
|
||||
/// <returns>The minimum SCNVector3</returns>
|
||||
public static SCNVector3 Max(SCNVector3 left, SCNVector3 right)
|
||||
public static SCNVector3 Max (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
return left.LengthSquared >= right.LengthSquared ? left : right;
|
||||
}
|
||||
|
@ -522,7 +514,7 @@ namespace SceneKit
|
|||
/// <param name="min">Minimum vector</param>
|
||||
/// <param name="max">Maximum vector</param>
|
||||
/// <returns>The clamped vector</returns>
|
||||
public static SCNVector3 Clamp(SCNVector3 vec, SCNVector3 min, SCNVector3 max)
|
||||
public static SCNVector3 Clamp (SCNVector3 vec, SCNVector3 min, SCNVector3 max)
|
||||
{
|
||||
vec.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
|
||||
vec.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
|
||||
|
@ -537,7 +529,7 @@ namespace SceneKit
|
|||
/// <param name="min">Minimum vector</param>
|
||||
/// <param name="max">Maximum vector</param>
|
||||
/// <param name="result">The clamped vector</param>
|
||||
public static void Clamp(ref SCNVector3 vec, ref SCNVector3 min, ref SCNVector3 max, out SCNVector3 result)
|
||||
public static void Clamp (ref SCNVector3 vec, ref SCNVector3 min, ref SCNVector3 max, out SCNVector3 result)
|
||||
{
|
||||
result.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
|
||||
result.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
|
||||
|
@ -553,7 +545,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <returns>The normalized vector</returns>
|
||||
public static SCNVector3 Normalize(SCNVector3 vec)
|
||||
public static SCNVector3 Normalize (SCNVector3 vec)
|
||||
{
|
||||
pfloat scale = 1.0f / vec.Length;
|
||||
vec.X *= scale;
|
||||
|
@ -567,7 +559,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <param name="result">The normalized vector</param>
|
||||
public static void Normalize(ref SCNVector3 vec, out SCNVector3 result)
|
||||
public static void Normalize (ref SCNVector3 vec, out SCNVector3 result)
|
||||
{
|
||||
pfloat scale = 1.0f / vec.Length;
|
||||
result.X = vec.X * scale;
|
||||
|
@ -584,9 +576,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <returns>The normalized vector</returns>
|
||||
public static SCNVector3 NormalizeFast(SCNVector3 vec)
|
||||
public static SCNVector3 NormalizeFast (SCNVector3 vec)
|
||||
{
|
||||
pfloat scale = (pfloat)MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);
|
||||
pfloat scale = (pfloat) MathHelper.InverseSqrtFast (vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
|
@ -598,9 +590,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <param name="result">The normalized vector</param>
|
||||
public static void NormalizeFast(ref SCNVector3 vec, out SCNVector3 result)
|
||||
public static void NormalizeFast (ref SCNVector3 vec, out SCNVector3 result)
|
||||
{
|
||||
pfloat scale = (pfloat)MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);
|
||||
pfloat scale = (pfloat) MathHelper.InverseSqrtFast (vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z);
|
||||
result.X = vec.X * scale;
|
||||
result.Y = vec.Y * scale;
|
||||
result.Z = vec.Z * scale;
|
||||
|
@ -616,7 +608,7 @@ namespace SceneKit
|
|||
/// <param name="left">First operand</param>
|
||||
/// <param name="right">Second operand</param>
|
||||
/// <returns>The dot product of the two inputs</returns>
|
||||
public static pfloat Dot(SCNVector3 left, SCNVector3 right)
|
||||
public static pfloat Dot (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
return left.X * right.X + left.Y * right.Y + left.Z * right.Z;
|
||||
}
|
||||
|
@ -627,7 +619,7 @@ namespace SceneKit
|
|||
/// <param name="left">First operand</param>
|
||||
/// <param name="right">Second operand</param>
|
||||
/// <param name="result">The dot product of the two inputs</param>
|
||||
public static void Dot(ref SCNVector3 left, ref SCNVector3 right, out pfloat result)
|
||||
public static void Dot (ref SCNVector3 left, ref SCNVector3 right, out pfloat result)
|
||||
{
|
||||
result = left.X * right.X + left.Y * right.Y + left.Z * right.Z;
|
||||
}
|
||||
|
@ -642,9 +634,9 @@ namespace SceneKit
|
|||
/// <param name="left">First operand</param>
|
||||
/// <param name="right">Second operand</param>
|
||||
/// <returns>The cross product of the two inputs</returns>
|
||||
public static SCNVector3 Cross(SCNVector3 left, SCNVector3 right)
|
||||
public static SCNVector3 Cross (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
return new SCNVector3(left.Y * right.Z - left.Z * right.Y,
|
||||
return new SCNVector3 (left.Y * right.Z - left.Z * right.Y,
|
||||
left.Z * right.X - left.X * right.Z,
|
||||
left.X * right.Y - left.Y * right.X);
|
||||
}
|
||||
|
@ -656,7 +648,7 @@ namespace SceneKit
|
|||
/// <param name="right">Second operand</param>
|
||||
/// <returns>The cross product of the two inputs</returns>
|
||||
/// <param name="result">The cross product of the two inputs</param>
|
||||
public static void Cross(ref SCNVector3 left, ref SCNVector3 right, out SCNVector3 result)
|
||||
public static void Cross (ref SCNVector3 left, ref SCNVector3 right, out SCNVector3 result)
|
||||
{
|
||||
result.X = left.Y * right.Z - left.Z * right.Y;
|
||||
result.Y = left.Z * right.X - left.X * right.Z;
|
||||
|
@ -674,7 +666,7 @@ namespace SceneKit
|
|||
/// <param name="b">Second input vector</param>
|
||||
/// <param name="blend">The blend factor. a when blend=0, b when blend=1.</param>
|
||||
/// <returns>a when blend=0, b when blend=1, and a linear combination otherwise</returns>
|
||||
public static SCNVector3 Lerp(SCNVector3 a, SCNVector3 b, pfloat blend)
|
||||
public static SCNVector3 Lerp (SCNVector3 a, SCNVector3 b, pfloat blend)
|
||||
{
|
||||
a.X = blend * (b.X - a.X) + a.X;
|
||||
a.Y = blend * (b.Y - a.Y) + a.Y;
|
||||
|
@ -689,7 +681,7 @@ namespace SceneKit
|
|||
/// <param name="b">Second input vector</param>
|
||||
/// <param name="blend">The blend factor. a when blend=0, b when blend=1.</param>
|
||||
/// <param name="result">a when blend=0, b when blend=1, and a linear combination otherwise</param>
|
||||
public static void Lerp(ref SCNVector3 a, ref SCNVector3 b, pfloat blend, out SCNVector3 result)
|
||||
public static void Lerp (ref SCNVector3 a, ref SCNVector3 b, pfloat blend, out SCNVector3 result)
|
||||
{
|
||||
result.X = blend * (b.X - a.X) + a.X;
|
||||
result.Y = blend * (b.Y - a.Y) + a.Y;
|
||||
|
@ -709,7 +701,7 @@ namespace SceneKit
|
|||
/// <param name="u">First Barycentric Coordinate</param>
|
||||
/// <param name="v">Second Barycentric Coordinate</param>
|
||||
/// <returns>a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise</returns>
|
||||
public static SCNVector3 BaryCentric(SCNVector3 a, SCNVector3 b, SCNVector3 c, pfloat u, pfloat v)
|
||||
public static SCNVector3 BaryCentric (SCNVector3 a, SCNVector3 b, SCNVector3 c, pfloat u, pfloat v)
|
||||
{
|
||||
return a + u * (b - a) + v * (c - a);
|
||||
}
|
||||
|
@ -721,19 +713,19 @@ namespace SceneKit
|
|||
/// <param name="u">First Barycentric Coordinate.</param>
|
||||
/// <param name="v">Second Barycentric Coordinate.</param>
|
||||
/// <param name="result">Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise</param>
|
||||
public static void BaryCentric(ref SCNVector3 a, ref SCNVector3 b, ref SCNVector3 c, pfloat u, pfloat v, out SCNVector3 result)
|
||||
public static void BaryCentric (ref SCNVector3 a, ref SCNVector3 b, ref SCNVector3 c, pfloat u, pfloat v, out SCNVector3 result)
|
||||
{
|
||||
result = a; // copy
|
||||
|
||||
SCNVector3 temp = b; // copy
|
||||
Subtract(ref temp, ref a, out temp);
|
||||
Multiply(ref temp, u, out temp);
|
||||
Add(ref result, ref temp, out result);
|
||||
Subtract (ref temp, ref a, out temp);
|
||||
Multiply (ref temp, u, out temp);
|
||||
Add (ref result, ref temp, out result);
|
||||
|
||||
temp = c; // copy
|
||||
Subtract(ref temp, ref a, out temp);
|
||||
Multiply(ref temp, v, out temp);
|
||||
Add(ref result, ref temp, out result);
|
||||
Subtract (ref temp, ref a, out temp);
|
||||
Multiply (ref temp, v, out temp);
|
||||
Add (ref result, ref temp, out result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -753,7 +745,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <returns>The transformed vector</returns>
|
||||
public static SCNVector3 TransformVector(SCNVector3 vec, SCNMatrix4 mat)
|
||||
public static SCNVector3 TransformVector (SCNVector3 vec, SCNMatrix4 mat)
|
||||
{
|
||||
TransformVector (ref vec, ref mat, out var v);
|
||||
return v;
|
||||
|
@ -772,7 +764,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <param name="result">The transformed vector</param>
|
||||
public static void TransformVector(ref SCNVector3 vec, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
public static void TransformVector (ref SCNVector3 vec, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
{
|
||||
#if NET
|
||||
result.X = vec.X * mat.Row0.X +
|
||||
|
@ -813,10 +805,10 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <returns>The transformed normal</returns>
|
||||
public static SCNVector3 TransformNormal(SCNVector3 norm, SCNMatrix4 mat)
|
||||
public static SCNVector3 TransformNormal (SCNVector3 norm, SCNMatrix4 mat)
|
||||
{
|
||||
mat.Invert();
|
||||
return TransformNormalInverse(norm, mat);
|
||||
mat.Invert ();
|
||||
return TransformNormalInverse (norm, mat);
|
||||
}
|
||||
|
||||
/// <summary>Transform a Normal by the given Matrix</summary>
|
||||
|
@ -831,10 +823,10 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <param name="result">The transformed normal</param>
|
||||
public static void TransformNormal(ref SCNVector3 norm, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
public static void TransformNormal (ref SCNVector3 norm, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
{
|
||||
SCNMatrix4 Inverse = SCNMatrix4.Invert(mat);
|
||||
SCNVector3.TransformNormalInverse(ref norm, ref Inverse, out result);
|
||||
SCNMatrix4 Inverse = SCNMatrix4.Invert (mat);
|
||||
SCNVector3.TransformNormalInverse (ref norm, ref Inverse, out result);
|
||||
}
|
||||
|
||||
/// <summary>Transform a Normal by the (transpose of the) given Matrix</summary>
|
||||
|
@ -849,7 +841,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="invMat">The inverse of the desired transformation</param>
|
||||
/// <returns>The transformed normal</returns>
|
||||
public static SCNVector3 TransformNormalInverse(SCNVector3 norm, SCNMatrix4 invMat)
|
||||
public static SCNVector3 TransformNormalInverse (SCNVector3 norm, SCNMatrix4 invMat)
|
||||
{
|
||||
TransformNormalInverse (ref norm, ref invMat, out var n);
|
||||
return n;
|
||||
|
@ -867,7 +859,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="invMat">The inverse of the desired transformation</param>
|
||||
/// <param name="result">The transformed normal</param>
|
||||
public static void TransformNormalInverse(ref SCNVector3 norm, ref SCNMatrix4 invMat, out SCNVector3 result)
|
||||
public static void TransformNormalInverse (ref SCNVector3 norm, ref SCNMatrix4 invMat, out SCNVector3 result)
|
||||
{
|
||||
#if NET
|
||||
result.X = norm.X * invMat.Column0.X +
|
||||
|
@ -904,7 +896,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <returns>The transformed position</returns>
|
||||
public static SCNVector3 TransformPosition(SCNVector3 pos, SCNMatrix4 mat)
|
||||
public static SCNVector3 TransformPosition (SCNVector3 pos, SCNMatrix4 mat)
|
||||
{
|
||||
TransformPosition (ref pos, ref mat, out var p);
|
||||
return p;
|
||||
|
@ -918,7 +910,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <param name="result">The transformed position</param>
|
||||
public static void TransformPosition(ref SCNVector3 pos, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
public static void TransformPosition (ref SCNVector3 pos, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
{
|
||||
#if NET
|
||||
result.X = mat.Row0.X * pos.X +
|
||||
|
@ -961,9 +953,9 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <returns>The transformed vector</returns>
|
||||
public static SCNVector4 Transform(SCNVector3 vec, SCNMatrix4 mat)
|
||||
public static SCNVector4 Transform (SCNVector3 vec, SCNMatrix4 mat)
|
||||
{
|
||||
SCNVector4 v4 = new SCNVector4(vec.X, vec.Y, vec.Z, 1.0f);
|
||||
SCNVector4 v4 = new SCNVector4 (vec.X, vec.Y, vec.Z, 1.0f);
|
||||
return SCNVector4.Transform (v4, mat);
|
||||
}
|
||||
|
||||
|
@ -975,30 +967,30 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <param name="result">The transformed vector</param>
|
||||
public static void Transform(ref SCNVector3 vec, ref SCNMatrix4 mat, out SCNVector4 result)
|
||||
public static void Transform (ref SCNVector3 vec, ref SCNMatrix4 mat, out SCNVector4 result)
|
||||
{
|
||||
SCNVector4 v4 = new SCNVector4(vec.X, vec.Y, vec.Z, 1.0f);
|
||||
SCNVector4.Transform(ref v4, ref mat, out result);
|
||||
SCNVector4 v4 = new SCNVector4 (vec.X, vec.Y, vec.Z, 1.0f);
|
||||
SCNVector4.Transform (ref v4, ref mat, out result);
|
||||
}
|
||||
|
||||
/// <summary>Transform a SCNVector3 by the given Matrix, and project the resulting Vector4 back to a SCNVector3</summary>
|
||||
/// <param name="vec">The vector to transform</param>
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <returns>The transformed vector</returns>
|
||||
public static SCNVector3 TransformPerspective(SCNVector3 vec, SCNMatrix4 mat)
|
||||
public static SCNVector3 TransformPerspective (SCNVector3 vec, SCNMatrix4 mat)
|
||||
{
|
||||
SCNVector4 h = Transform(vec, mat);
|
||||
return new SCNVector3(h.X / h.W, h.Y / h.W, h.Z / h.W);
|
||||
SCNVector4 h = Transform (vec, mat);
|
||||
return new SCNVector3 (h.X / h.W, h.Y / h.W, h.Z / h.W);
|
||||
}
|
||||
|
||||
/// <summary>Transform a SCNVector3 by the given Matrix, and project the resulting SCNVector4 back to a SCNVector3</summary>
|
||||
/// <param name="vec">The vector to transform</param>
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <param name="result">The transformed vector</param>
|
||||
public static void TransformPerspective(ref SCNVector3 vec, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
public static void TransformPerspective (ref SCNVector3 vec, ref SCNMatrix4 mat, out SCNVector3 result)
|
||||
{
|
||||
SCNVector4 h;
|
||||
SCNVector3.Transform(ref vec, ref mat, out h);
|
||||
SCNVector3.Transform (ref vec, ref mat, out h);
|
||||
result.X = h.X / h.W;
|
||||
result.Y = h.Y / h.W;
|
||||
result.Z = h.Z / h.W;
|
||||
|
@ -1015,9 +1007,9 @@ namespace SceneKit
|
|||
/// <param name="second">The second vector.</param>
|
||||
/// <returns>Angle (in radians) between the vectors.</returns>
|
||||
/// <remarks>Note that the returned angle is never bigger than the constant Pi.</remarks>
|
||||
public static pfloat CalculateAngle(SCNVector3 first, SCNVector3 second)
|
||||
public static pfloat CalculateAngle (SCNVector3 first, SCNVector3 second)
|
||||
{
|
||||
return (pfloat)System.Math.Acos((SCNVector3.Dot(first, second)) / (first.Length * second.Length));
|
||||
return (pfloat) System.Math.Acos ((SCNVector3.Dot (first, second)) / (first.Length * second.Length));
|
||||
}
|
||||
|
||||
/// <summary>Calculates the angle (in radians) between two vectors.</summary>
|
||||
|
@ -1025,11 +1017,11 @@ namespace SceneKit
|
|||
/// <param name="second">The second vector.</param>
|
||||
/// <param name="result">Angle (in radians) between the vectors.</param>
|
||||
/// <remarks>Note that the returned angle is never bigger than the constant Pi.</remarks>
|
||||
public static void CalculateAngle(ref SCNVector3 first, ref SCNVector3 second, out pfloat result)
|
||||
public static void CalculateAngle (ref SCNVector3 first, ref SCNVector3 second, out pfloat result)
|
||||
{
|
||||
pfloat temp;
|
||||
SCNVector3.Dot(ref first, ref second, out temp);
|
||||
result = (pfloat)System.Math.Acos(temp / (first.Length * second.Length));
|
||||
SCNVector3.Dot (ref first, ref second, out temp);
|
||||
result = (pfloat) System.Math.Acos (temp / (first.Length * second.Length));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1042,7 +1034,7 @@ namespace SceneKit
|
|||
/// Gets or sets an OpenTK.Vector2 with the X and Y components of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector2 Xy { get { return new Vector2((float)X, (float)Y); } set { X = value.X; Y = value.Y; } }
|
||||
public Vector2 Xy { get { return new Vector2 ((float) X, (float) Y); } set { X = value.X; Y = value.Y; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -1054,7 +1046,7 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector3 operator +(SCNVector3 left, SCNVector3 right)
|
||||
public static SCNVector3 operator + (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
left.X += right.X;
|
||||
left.Y += right.Y;
|
||||
|
@ -1068,7 +1060,7 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector3 operator -(SCNVector3 left, SCNVector3 right)
|
||||
public static SCNVector3 operator - (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
left.X -= right.X;
|
||||
left.Y -= right.Y;
|
||||
|
@ -1081,7 +1073,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector3 operator -(SCNVector3 vec)
|
||||
public static SCNVector3 operator - (SCNVector3 vec)
|
||||
{
|
||||
vec.X = -vec.X;
|
||||
vec.Y = -vec.Y;
|
||||
|
@ -1095,7 +1087,7 @@ namespace SceneKit
|
|||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector3 operator *(SCNVector3 vec, pfloat scale)
|
||||
public static SCNVector3 operator * (SCNVector3 vec, pfloat scale)
|
||||
{
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
|
@ -1109,7 +1101,7 @@ namespace SceneKit
|
|||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector3 operator *(pfloat scale, SCNVector3 vec)
|
||||
public static SCNVector3 operator * (pfloat scale, SCNVector3 vec)
|
||||
{
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
|
@ -1123,7 +1115,7 @@ namespace SceneKit
|
|||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector3 operator /(SCNVector3 vec, pfloat scale)
|
||||
public static SCNVector3 operator / (SCNVector3 vec, pfloat scale)
|
||||
{
|
||||
pfloat mult = 1.0f / scale;
|
||||
vec.X *= mult;
|
||||
|
@ -1138,9 +1130,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(SCNVector3 left, SCNVector3 right)
|
||||
public static bool operator == (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
return left.Equals (right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1149,9 +1141,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equa lright; false otherwise.</returns>
|
||||
public static bool operator !=(SCNVector3 left, SCNVector3 right)
|
||||
public static bool operator != (SCNVector3 left, SCNVector3 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1164,9 +1156,9 @@ namespace SceneKit
|
|||
/// Returns a System.String that represents the current SCNVector3.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format("({0}, {1}, {2})", X, Y, Z);
|
||||
return String.Format ("({0}, {1}, {2})", X, Y, Z);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1177,9 +1169,9 @@ namespace SceneKit
|
|||
/// Returns the hashcode for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
|
||||
public override int GetHashCode()
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode();
|
||||
return X.GetHashCode () ^ Y.GetHashCode () ^ Z.GetHashCode ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1196,7 +1188,7 @@ namespace SceneKit
|
|||
if (!(obj is SCNVector3))
|
||||
return false;
|
||||
|
||||
return this.Equals((SCNVector3)obj);
|
||||
return this.Equals ((SCNVector3) obj);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1210,7 +1202,7 @@ namespace SceneKit
|
|||
/// <summary>Indicates whether the current vector is equal to another vector.</summary>
|
||||
/// <param name="other">A vector to compare with this vector.</param>
|
||||
/// <returns>true if the current vector is equal to the vector parameter; otherwise, false.</returns>
|
||||
public bool Equals(SCNVector3 other)
|
||||
public bool Equals (SCNVector3 other)
|
||||
{
|
||||
return
|
||||
X == other.X &&
|
||||
|
@ -1226,7 +1218,7 @@ namespace SceneKit
|
|||
|
||||
public static explicit operator Vector3 (SCNVector3 source)
|
||||
{
|
||||
return new Vector3 ((float)source.X, (float)source.Y, (float)source.Z);
|
||||
return new Vector3 ((float) source.X, (float) source.Y, (float) source.Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,8 +54,7 @@ using pfloat = System.Single;
|
|||
|
||||
#nullable enable
|
||||
|
||||
namespace SceneKit
|
||||
{
|
||||
namespace SceneKit {
|
||||
/// <summary>Represents a 4D vector using four single-precision floating-point numbers.</summary>
|
||||
/// <remarks>
|
||||
/// The Vector4 structure is suitable for interoperation with unmanaged code requiring four consecutive floats.
|
||||
|
@ -67,9 +66,8 @@ namespace SceneKit
|
|||
[SupportedOSPlatform ("tvos")]
|
||||
#endif
|
||||
[Serializable]
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SCNVector4 : IEquatable<SCNVector4>
|
||||
{
|
||||
[StructLayout (LayoutKind.Sequential)]
|
||||
public struct SCNVector4 : IEquatable<SCNVector4> {
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
|
@ -95,37 +93,37 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Defines a unit-length SCNVector4 that points towards the X-axis.
|
||||
/// </summary>
|
||||
public readonly static SCNVector4 UnitX = new SCNVector4(1, 0, 0, 0);
|
||||
public readonly static SCNVector4 UnitX = new SCNVector4 (1, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a unit-length SCNVector4 that points towards the Y-axis.
|
||||
/// </summary>
|
||||
public readonly static SCNVector4 UnitY = new SCNVector4(0, 1, 0, 0);
|
||||
public readonly static SCNVector4 UnitY = new SCNVector4 (0, 1, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a unit-length SCNVector4 that points towards the Z-axis.
|
||||
/// </summary>
|
||||
public readonly static SCNVector4 UnitZ = new SCNVector4(0, 0, 1, 0);
|
||||
public readonly static SCNVector4 UnitZ = new SCNVector4 (0, 0, 1, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a unit-length SCNVector4 that points towards the W-axis.
|
||||
/// </summary>
|
||||
public readonly static SCNVector4 UnitW = new SCNVector4(0, 0, 0, 1);
|
||||
public readonly static SCNVector4 UnitW = new SCNVector4 (0, 0, 0, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Defines a zero-length SCNVector4.
|
||||
/// </summary>
|
||||
public readonly static SCNVector4 Zero = new SCNVector4(0, 0, 0, 0);
|
||||
public readonly static SCNVector4 Zero = new SCNVector4 (0, 0, 0, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Defines an instance with all components set to 1.
|
||||
/// </summary>
|
||||
public static readonly SCNVector4 One = new SCNVector4(1, 1, 1, 1);
|
||||
public static readonly SCNVector4 One = new SCNVector4 (1, 1, 1, 1);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the size of the SCNVector4 struct in bytes.
|
||||
/// </summary>
|
||||
public static readonly int SizeInBytes = Marshal.SizeOf(new SCNVector4());
|
||||
public static readonly int SizeInBytes = Marshal.SizeOf (new SCNVector4 ());
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -138,7 +136,7 @@ namespace SceneKit
|
|||
/// <param name="y">The y component of the SCNVector4.</param>
|
||||
/// <param name="z">The z component of the SCNVector4.</param>
|
||||
/// <param name="w">The z component of the SCNVector4.</param>
|
||||
public SCNVector4(pfloat x, pfloat y, pfloat z, pfloat w)
|
||||
public SCNVector4 (pfloat x, pfloat y, pfloat z, pfloat w)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
|
@ -150,7 +148,7 @@ namespace SceneKit
|
|||
/// Constructs a new SCNVector4 from the given Vector2.
|
||||
/// </summary>
|
||||
/// <param name="v">The Vector2 to copy components from.</param>
|
||||
public SCNVector4(Vector2 v)
|
||||
public SCNVector4 (Vector2 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -162,7 +160,7 @@ namespace SceneKit
|
|||
/// Constructs a new SCNVector4 from the given Vector3.
|
||||
/// </summary>
|
||||
/// <param name="v">The Vector3 to copy components from.</param>
|
||||
public SCNVector4(SCNVector3 v)
|
||||
public SCNVector4 (SCNVector3 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -171,7 +169,7 @@ namespace SceneKit
|
|||
}
|
||||
|
||||
|
||||
public SCNVector4(Vector3 v)
|
||||
public SCNVector4 (Vector3 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -179,7 +177,7 @@ namespace SceneKit
|
|||
W = 0.0f;
|
||||
}
|
||||
|
||||
public SCNVector4(Vector4 v)
|
||||
public SCNVector4 (Vector4 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -192,7 +190,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="v">The Vector3 to copy components from.</param>
|
||||
/// <param name="w">The W component of the new SCNVector4.</param>
|
||||
public SCNVector4(SCNVector3 v, pfloat w)
|
||||
public SCNVector4 (SCNVector3 v, pfloat w)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -204,7 +202,7 @@ namespace SceneKit
|
|||
/// Constructs a new SCNVector4 from the given SCNVector4.
|
||||
/// </summary>
|
||||
/// <param name="v">The SCNVector4 to copy components from.</param>
|
||||
public SCNVector4(SCNVector4 v)
|
||||
public SCNVector4 (SCNVector4 v)
|
||||
{
|
||||
X = v.X;
|
||||
Y = v.Y;
|
||||
|
@ -225,11 +223,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <see cref="LengthFast"/>
|
||||
/// <seealso cref="LengthSquared"/>
|
||||
public pfloat Length
|
||||
{
|
||||
get
|
||||
{
|
||||
return (pfloat)System.Math.Sqrt(X * X + Y * Y + Z * Z + W * W);
|
||||
public pfloat Length {
|
||||
get {
|
||||
return (pfloat) System.Math.Sqrt (X * X + Y * Y + Z * Z + W * W);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,11 +242,9 @@ namespace SceneKit
|
|||
/// </remarks>
|
||||
/// <see cref="Length"/>
|
||||
/// <seealso cref="LengthSquared"/>
|
||||
public pfloat LengthFast
|
||||
{
|
||||
get
|
||||
{
|
||||
return (pfloat)(1.0f / MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z + W * W));
|
||||
public pfloat LengthFast {
|
||||
get {
|
||||
return (pfloat) (1.0f / MathHelper.InverseSqrtFast (X * X + Y * Y + Z * Z + W * W));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,10 +261,8 @@ namespace SceneKit
|
|||
/// </remarks>
|
||||
/// <see cref="Length"/>
|
||||
/// <seealso cref="LengthFast"/>
|
||||
public pfloat LengthSquared
|
||||
{
|
||||
get
|
||||
{
|
||||
public pfloat LengthSquared {
|
||||
get {
|
||||
return X * X + Y * Y + Z * Z + W * W;
|
||||
}
|
||||
}
|
||||
|
@ -282,7 +274,7 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Scales the SCNVector4 to unit length.
|
||||
/// </summary>
|
||||
public void Normalize()
|
||||
public void Normalize ()
|
||||
{
|
||||
pfloat scale = 1.0f / this.Length;
|
||||
X *= scale;
|
||||
|
@ -298,9 +290,9 @@ namespace SceneKit
|
|||
/// <summary>
|
||||
/// Scales the SCNVector4 to approximately unit length.
|
||||
/// </summary>
|
||||
public void NormalizeFast()
|
||||
public void NormalizeFast ()
|
||||
{
|
||||
pfloat scale = (pfloat)(MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z + W * W));
|
||||
pfloat scale = (pfloat) (MathHelper.InverseSqrtFast (X * X + Y * Y + Z * Z + W * W));
|
||||
X *= scale;
|
||||
Y *= scale;
|
||||
Z *= scale;
|
||||
|
@ -323,7 +315,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>Result of subtraction</returns>
|
||||
public static SCNVector4 Sub(SCNVector4 a, SCNVector4 b)
|
||||
public static SCNVector4 Sub (SCNVector4 a, SCNVector4 b)
|
||||
{
|
||||
a.X -= b.X;
|
||||
a.Y -= b.Y;
|
||||
|
@ -338,7 +330,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">Result of subtraction</param>
|
||||
public static void Sub(ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
public static void Sub (ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
{
|
||||
result.X = a.X - b.X;
|
||||
result.Y = a.Y - b.Y;
|
||||
|
@ -356,7 +348,7 @@ namespace SceneKit
|
|||
/// <param name="a">Vector operand</param>
|
||||
/// <param name="f">Scalar operand</param>
|
||||
/// <returns>Result of the multiplication</returns>
|
||||
public static SCNVector4 Mult(SCNVector4 a, pfloat f)
|
||||
public static SCNVector4 Mult (SCNVector4 a, pfloat f)
|
||||
{
|
||||
a.X *= f;
|
||||
a.Y *= f;
|
||||
|
@ -371,7 +363,7 @@ namespace SceneKit
|
|||
/// <param name="a">Vector operand</param>
|
||||
/// <param name="f">Scalar operand</param>
|
||||
/// <param name="result">Result of the multiplication</param>
|
||||
public static void Mult(ref SCNVector4 a, pfloat f, out SCNVector4 result)
|
||||
public static void Mult (ref SCNVector4 a, pfloat f, out SCNVector4 result)
|
||||
{
|
||||
result.X = a.X * f;
|
||||
result.Y = a.Y * f;
|
||||
|
@ -389,7 +381,7 @@ namespace SceneKit
|
|||
/// <param name="a">Vector operand</param>
|
||||
/// <param name="f">Scalar operand</param>
|
||||
/// <returns>Result of the division</returns>
|
||||
public static SCNVector4 Div(SCNVector4 a, pfloat f)
|
||||
public static SCNVector4 Div (SCNVector4 a, pfloat f)
|
||||
{
|
||||
pfloat mult = 1.0f / f;
|
||||
a.X *= mult;
|
||||
|
@ -405,7 +397,7 @@ namespace SceneKit
|
|||
/// <param name="a">Vector operand</param>
|
||||
/// <param name="f">Scalar operand</param>
|
||||
/// <param name="result">Result of the division</param>
|
||||
public static void Div(ref SCNVector4 a, pfloat f, out SCNVector4 result)
|
||||
public static void Div (ref SCNVector4 a, pfloat f, out SCNVector4 result)
|
||||
{
|
||||
pfloat mult = 1.0f / f;
|
||||
result.X = a.X * mult;
|
||||
|
@ -426,9 +418,9 @@ namespace SceneKit
|
|||
/// <param name="a">Left operand.</param>
|
||||
/// <param name="b">Right operand.</param>
|
||||
/// <returns>Result of operation.</returns>
|
||||
public static SCNVector4 Add(SCNVector4 a, SCNVector4 b)
|
||||
public static SCNVector4 Add (SCNVector4 a, SCNVector4 b)
|
||||
{
|
||||
Add(ref a, ref b, out a);
|
||||
Add (ref a, ref b, out a);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -438,9 +430,9 @@ namespace SceneKit
|
|||
/// <param name="a">Left operand.</param>
|
||||
/// <param name="b">Right operand.</param>
|
||||
/// <param name="result">Result of operation.</param>
|
||||
public static void Add(ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
public static void Add (ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
{
|
||||
result = new SCNVector4(a.X + b.X, a.Y + b.Y, a.Z + b.Z, a.W + b.W);
|
||||
result = new SCNVector4 (a.X + b.X, a.Y + b.Y, a.Z + b.Z, a.W + b.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -453,9 +445,9 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>Result of subtraction</returns>
|
||||
public static SCNVector4 Subtract(SCNVector4 a, SCNVector4 b)
|
||||
public static SCNVector4 Subtract (SCNVector4 a, SCNVector4 b)
|
||||
{
|
||||
Subtract(ref a, ref b, out a);
|
||||
Subtract (ref a, ref b, out a);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
@ -465,9 +457,9 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">Result of subtraction</param>
|
||||
public static void Subtract(ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
public static void Subtract (ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
{
|
||||
result = new SCNVector4(a.X - b.X, a.Y - b.Y, a.Z - b.Z, a.W - b.W);
|
||||
result = new SCNVector4 (a.X - b.X, a.Y - b.Y, a.Z - b.Z, a.W - b.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -480,9 +472,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector4 Multiply(SCNVector4 vector, pfloat scale)
|
||||
public static SCNVector4 Multiply (SCNVector4 vector, pfloat scale)
|
||||
{
|
||||
Multiply(ref vector, scale, out vector);
|
||||
Multiply (ref vector, scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -492,9 +484,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Multiply(ref SCNVector4 vector, pfloat scale, out SCNVector4 result)
|
||||
public static void Multiply (ref SCNVector4 vector, pfloat scale, out SCNVector4 result)
|
||||
{
|
||||
result = new SCNVector4(vector.X * scale, vector.Y * scale, vector.Z * scale, vector.W * scale);
|
||||
result = new SCNVector4 (vector.X * scale, vector.Y * scale, vector.Z * scale, vector.W * scale);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -503,9 +495,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector4 Multiply(SCNVector4 vector, SCNVector4 scale)
|
||||
public static SCNVector4 Multiply (SCNVector4 vector, SCNVector4 scale)
|
||||
{
|
||||
Multiply(ref vector, ref scale, out vector);
|
||||
Multiply (ref vector, ref scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -515,9 +507,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Multiply(ref SCNVector4 vector, ref SCNVector4 scale, out SCNVector4 result)
|
||||
public static void Multiply (ref SCNVector4 vector, ref SCNVector4 scale, out SCNVector4 result)
|
||||
{
|
||||
result = new SCNVector4(vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z, vector.W * scale.W);
|
||||
result = new SCNVector4 (vector.X * scale.X, vector.Y * scale.Y, vector.Z * scale.Z, vector.W * scale.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -530,9 +522,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector4 Divide(SCNVector4 vector, pfloat scale)
|
||||
public static SCNVector4 Divide (SCNVector4 vector, pfloat scale)
|
||||
{
|
||||
Divide(ref vector, scale, out vector);
|
||||
Divide (ref vector, scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -542,9 +534,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Divide(ref SCNVector4 vector, pfloat scale, out SCNVector4 result)
|
||||
public static void Divide (ref SCNVector4 vector, pfloat scale, out SCNVector4 result)
|
||||
{
|
||||
Multiply(ref vector, 1 / scale, out result);
|
||||
Multiply (ref vector, 1 / scale, out result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -553,9 +545,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <returns>Result of the operation.</returns>
|
||||
public static SCNVector4 Divide(SCNVector4 vector, SCNVector4 scale)
|
||||
public static SCNVector4 Divide (SCNVector4 vector, SCNVector4 scale)
|
||||
{
|
||||
Divide(ref vector, ref scale, out vector);
|
||||
Divide (ref vector, ref scale, out vector);
|
||||
return vector;
|
||||
}
|
||||
|
||||
|
@ -565,9 +557,9 @@ namespace SceneKit
|
|||
/// <param name="vector">Left operand.</param>
|
||||
/// <param name="scale">Right operand.</param>
|
||||
/// <param name="result">Result of the operation.</param>
|
||||
public static void Divide(ref SCNVector4 vector, ref SCNVector4 scale, out SCNVector4 result)
|
||||
public static void Divide (ref SCNVector4 vector, ref SCNVector4 scale, out SCNVector4 result)
|
||||
{
|
||||
result = new SCNVector4(vector.X / scale.X, vector.Y / scale.Y, vector.Z / scale.Z, vector.W / scale.W);
|
||||
result = new SCNVector4 (vector.X / scale.X, vector.Y / scale.Y, vector.Z / scale.Z, vector.W / scale.W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -580,7 +572,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>The component-wise minimum</returns>
|
||||
public static SCNVector4 Min(SCNVector4 a, SCNVector4 b)
|
||||
public static SCNVector4 Min (SCNVector4 a, SCNVector4 b)
|
||||
{
|
||||
a.X = a.X < b.X ? a.X : b.X;
|
||||
a.Y = a.Y < b.Y ? a.Y : b.Y;
|
||||
|
@ -595,7 +587,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">The component-wise minimum</param>
|
||||
public static void Min(ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
public static void Min (ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
{
|
||||
result.X = a.X < b.X ? a.X : b.X;
|
||||
result.Y = a.Y < b.Y ? a.Y : b.Y;
|
||||
|
@ -613,7 +605,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <returns>The component-wise maximum</returns>
|
||||
public static SCNVector4 Max(SCNVector4 a, SCNVector4 b)
|
||||
public static SCNVector4 Max (SCNVector4 a, SCNVector4 b)
|
||||
{
|
||||
a.X = a.X > b.X ? a.X : b.X;
|
||||
a.Y = a.Y > b.Y ? a.Y : b.Y;
|
||||
|
@ -628,7 +620,7 @@ namespace SceneKit
|
|||
/// <param name="a">First operand</param>
|
||||
/// <param name="b">Second operand</param>
|
||||
/// <param name="result">The component-wise maximum</param>
|
||||
public static void Max(ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
public static void Max (ref SCNVector4 a, ref SCNVector4 b, out SCNVector4 result)
|
||||
{
|
||||
result.X = a.X > b.X ? a.X : b.X;
|
||||
result.Y = a.Y > b.Y ? a.Y : b.Y;
|
||||
|
@ -647,7 +639,7 @@ namespace SceneKit
|
|||
/// <param name="min">Minimum vector</param>
|
||||
/// <param name="max">Maximum vector</param>
|
||||
/// <returns>The clamped vector</returns>
|
||||
public static SCNVector4 Clamp(SCNVector4 vec, SCNVector4 min, SCNVector4 max)
|
||||
public static SCNVector4 Clamp (SCNVector4 vec, SCNVector4 min, SCNVector4 max)
|
||||
{
|
||||
vec.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
|
||||
vec.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
|
||||
|
@ -663,7 +655,7 @@ namespace SceneKit
|
|||
/// <param name="min">Minimum vector</param>
|
||||
/// <param name="max">Maximum vector</param>
|
||||
/// <param name="result">The clamped vector</param>
|
||||
public static void Clamp(ref SCNVector4 vec, ref SCNVector4 min, ref SCNVector4 max, out SCNVector4 result)
|
||||
public static void Clamp (ref SCNVector4 vec, ref SCNVector4 min, ref SCNVector4 max, out SCNVector4 result)
|
||||
{
|
||||
result.X = vec.X < min.X ? min.X : vec.X > max.X ? max.X : vec.X;
|
||||
result.Y = vec.Y < min.Y ? min.Y : vec.Y > max.Y ? max.Y : vec.Y;
|
||||
|
@ -680,7 +672,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <returns>The normalized vector</returns>
|
||||
public static SCNVector4 Normalize(SCNVector4 vec)
|
||||
public static SCNVector4 Normalize (SCNVector4 vec)
|
||||
{
|
||||
pfloat scale = 1.0f / vec.Length;
|
||||
vec.X *= scale;
|
||||
|
@ -695,7 +687,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <param name="result">The normalized vector</param>
|
||||
public static void Normalize(ref SCNVector4 vec, out SCNVector4 result)
|
||||
public static void Normalize (ref SCNVector4 vec, out SCNVector4 result)
|
||||
{
|
||||
pfloat scale = 1.0f / vec.Length;
|
||||
result.X = vec.X * scale;
|
||||
|
@ -713,9 +705,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <returns>The normalized vector</returns>
|
||||
public static SCNVector4 NormalizeFast(SCNVector4 vec)
|
||||
public static SCNVector4 NormalizeFast (SCNVector4 vec)
|
||||
{
|
||||
pfloat scale = (pfloat)(MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z + vec.W * vec.W));
|
||||
pfloat scale = (pfloat) (MathHelper.InverseSqrtFast (vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z + vec.W * vec.W));
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
|
@ -728,9 +720,9 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The input vector</param>
|
||||
/// <param name="result">The normalized vector</param>
|
||||
public static void NormalizeFast(ref SCNVector4 vec, out SCNVector4 result)
|
||||
public static void NormalizeFast (ref SCNVector4 vec, out SCNVector4 result)
|
||||
{
|
||||
pfloat scale = (pfloat)(MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z + vec.W * vec.W));
|
||||
pfloat scale = (pfloat) (MathHelper.InverseSqrtFast (vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z + vec.W * vec.W));
|
||||
result.X = vec.X * scale;
|
||||
result.Y = vec.Y * scale;
|
||||
result.Z = vec.Z * scale;
|
||||
|
@ -747,7 +739,7 @@ namespace SceneKit
|
|||
/// <param name="left">First operand</param>
|
||||
/// <param name="right">Second operand</param>
|
||||
/// <returns>The dot product of the two inputs</returns>
|
||||
public static pfloat Dot(SCNVector4 left, SCNVector4 right)
|
||||
public static pfloat Dot (SCNVector4 left, SCNVector4 right)
|
||||
{
|
||||
return left.X * right.X + left.Y * right.Y + left.Z * right.Z + left.W * right.W;
|
||||
}
|
||||
|
@ -758,7 +750,7 @@ namespace SceneKit
|
|||
/// <param name="left">First operand</param>
|
||||
/// <param name="right">Second operand</param>
|
||||
/// <param name="result">The dot product of the two inputs</param>
|
||||
public static void Dot(ref SCNVector4 left, ref SCNVector4 right, out pfloat result)
|
||||
public static void Dot (ref SCNVector4 left, ref SCNVector4 right, out pfloat result)
|
||||
{
|
||||
result = left.X * right.X + left.Y * right.Y + left.Z * right.Z + left.W * right.W;
|
||||
}
|
||||
|
@ -774,7 +766,7 @@ namespace SceneKit
|
|||
/// <param name="b">Second input vector</param>
|
||||
/// <param name="blend">The blend factor. a when blend=0, b when blend=1.</param>
|
||||
/// <returns>a when blend=0, b when blend=1, and a linear combination otherwise</returns>
|
||||
public static SCNVector4 Lerp(SCNVector4 a, SCNVector4 b, pfloat blend)
|
||||
public static SCNVector4 Lerp (SCNVector4 a, SCNVector4 b, pfloat blend)
|
||||
{
|
||||
a.X = blend * (b.X - a.X) + a.X;
|
||||
a.Y = blend * (b.Y - a.Y) + a.Y;
|
||||
|
@ -790,7 +782,7 @@ namespace SceneKit
|
|||
/// <param name="b">Second input vector</param>
|
||||
/// <param name="blend">The blend factor. a when blend=0, b when blend=1.</param>
|
||||
/// <param name="result">a when blend=0, b when blend=1, and a linear combination otherwise</param>
|
||||
public static void Lerp(ref SCNVector4 a, ref SCNVector4 b, pfloat blend, out SCNVector4 result)
|
||||
public static void Lerp (ref SCNVector4 a, ref SCNVector4 b, pfloat blend, out SCNVector4 result)
|
||||
{
|
||||
result.X = blend * (b.X - a.X) + a.X;
|
||||
result.Y = blend * (b.Y - a.Y) + a.Y;
|
||||
|
@ -811,7 +803,7 @@ namespace SceneKit
|
|||
/// <param name="u">First Barycentric Coordinate</param>
|
||||
/// <param name="v">Second Barycentric Coordinate</param>
|
||||
/// <returns>a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise</returns>
|
||||
public static SCNVector4 BaryCentric(SCNVector4 a, SCNVector4 b, SCNVector4 c, pfloat u, pfloat v)
|
||||
public static SCNVector4 BaryCentric (SCNVector4 a, SCNVector4 b, SCNVector4 c, pfloat u, pfloat v)
|
||||
{
|
||||
return a + u * (b - a) + v * (c - a);
|
||||
}
|
||||
|
@ -823,19 +815,19 @@ namespace SceneKit
|
|||
/// <param name="u">First Barycentric Coordinate.</param>
|
||||
/// <param name="v">Second Barycentric Coordinate.</param>
|
||||
/// <param name="result">Output Vector. a when u=v=0, b when u=1,v=0, c when u=0,v=1, and a linear combination of a,b,c otherwise</param>
|
||||
public static void BaryCentric(ref SCNVector4 a, ref SCNVector4 b, ref SCNVector4 c, pfloat u, pfloat v, out SCNVector4 result)
|
||||
public static void BaryCentric (ref SCNVector4 a, ref SCNVector4 b, ref SCNVector4 c, pfloat u, pfloat v, out SCNVector4 result)
|
||||
{
|
||||
result = a; // copy
|
||||
|
||||
SCNVector4 temp = b; // copy
|
||||
Subtract(ref temp, ref a, out temp);
|
||||
Multiply(ref temp, u, out temp);
|
||||
Add(ref result, ref temp, out result);
|
||||
Subtract (ref temp, ref a, out temp);
|
||||
Multiply (ref temp, u, out temp);
|
||||
Add (ref result, ref temp, out result);
|
||||
|
||||
temp = c; // copy
|
||||
Subtract(ref temp, ref a, out temp);
|
||||
Multiply(ref temp, v, out temp);
|
||||
Add(ref result, ref temp, out result);
|
||||
Subtract (ref temp, ref a, out temp);
|
||||
Multiply (ref temp, v, out temp);
|
||||
Add (ref result, ref temp, out result);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -850,9 +842,9 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <returns>The transformed vector</returns>
|
||||
public static SCNVector4 Transform(SCNVector4 vec, SCNMatrix4 mat)
|
||||
public static SCNVector4 Transform (SCNVector4 vec, SCNMatrix4 mat)
|
||||
{
|
||||
Transform(ref vec, ref mat, out var result);
|
||||
Transform (ref vec, ref mat, out var result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -864,7 +856,7 @@ namespace SceneKit
|
|||
#endif
|
||||
/// <param name="mat">The desired transformation</param>
|
||||
/// <param name="result">The transformed vector</param>
|
||||
public static void Transform(ref SCNVector4 vec, ref SCNMatrix4 mat, out SCNVector4 result)
|
||||
public static void Transform (ref SCNVector4 vec, ref SCNMatrix4 mat, out SCNVector4 result)
|
||||
{
|
||||
#if NET
|
||||
result.X = vec.X * mat.Column0.X +
|
||||
|
@ -919,13 +911,13 @@ namespace SceneKit
|
|||
/// Gets or sets an OpenTK.Vector2 with the X and Y components of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector2 Xy { get { return new Vector2((float)X, (float)Y); } set { X = value.X; Y = value.Y; } }
|
||||
public Vector2 Xy { get { return new Vector2 ((float) X, (float) Y); } set { X = value.X; Y = value.Y; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public SCNVector3 Xyz { get { return new SCNVector3(X, Y, Z); } set { X = value.X; Y = value.Y; Z = value.Z; } }
|
||||
public SCNVector3 Xyz { get { return new SCNVector3 (X, Y, Z); } set { X = value.X; Y = value.Y; Z = value.Z; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -937,7 +929,7 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector4 operator +(SCNVector4 left, SCNVector4 right)
|
||||
public static SCNVector4 operator + (SCNVector4 left, SCNVector4 right)
|
||||
{
|
||||
left.X += right.X;
|
||||
left.Y += right.Y;
|
||||
|
@ -952,7 +944,7 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector4 operator -(SCNVector4 left, SCNVector4 right)
|
||||
public static SCNVector4 operator - (SCNVector4 left, SCNVector4 right)
|
||||
{
|
||||
left.X -= right.X;
|
||||
left.Y -= right.Y;
|
||||
|
@ -966,7 +958,7 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector4 operator -(SCNVector4 vec)
|
||||
public static SCNVector4 operator - (SCNVector4 vec)
|
||||
{
|
||||
vec.X = -vec.X;
|
||||
vec.Y = -vec.Y;
|
||||
|
@ -981,7 +973,7 @@ namespace SceneKit
|
|||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector4 operator *(SCNVector4 vec, pfloat scale)
|
||||
public static SCNVector4 operator * (SCNVector4 vec, pfloat scale)
|
||||
{
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
|
@ -996,7 +988,7 @@ namespace SceneKit
|
|||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector4 operator *(pfloat scale, SCNVector4 vec)
|
||||
public static SCNVector4 operator * (pfloat scale, SCNVector4 vec)
|
||||
{
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
|
@ -1011,7 +1003,7 @@ namespace SceneKit
|
|||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static SCNVector4 operator /(SCNVector4 vec, pfloat scale)
|
||||
public static SCNVector4 operator / (SCNVector4 vec, pfloat scale)
|
||||
{
|
||||
pfloat mult = 1.0f / scale;
|
||||
vec.X *= mult;
|
||||
|
@ -1027,9 +1019,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(SCNVector4 left, SCNVector4 right)
|
||||
public static bool operator == (SCNVector4 left, SCNVector4 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
return left.Equals (right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1038,9 +1030,9 @@ namespace SceneKit
|
|||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equa lright; false otherwise.</returns>
|
||||
public static bool operator !=(SCNVector4 left, SCNVector4 right)
|
||||
public static bool operator != (SCNVector4 left, SCNVector4 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
return !left.Equals (right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1048,8 +1040,8 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="v">The instance.</param>
|
||||
/// <returns>A pointer to the first element of v.</returns>
|
||||
[CLSCompliant(false)]
|
||||
unsafe public static explicit operator pfloat*(SCNVector4 v)
|
||||
[CLSCompliant (false)]
|
||||
unsafe public static explicit operator pfloat* (SCNVector4 v)
|
||||
{
|
||||
return &v.X;
|
||||
}
|
||||
|
@ -1059,11 +1051,10 @@ namespace SceneKit
|
|||
/// </summary>
|
||||
/// <param name="v">The instance.</param>
|
||||
/// <returns>A pointer to the first element of v.</returns>
|
||||
public static explicit operator IntPtr(SCNVector4 v)
|
||||
public static explicit operator IntPtr (SCNVector4 v)
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
return (IntPtr)(&v.X);
|
||||
unsafe {
|
||||
return (IntPtr) (&v.X);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1077,9 +1068,9 @@ namespace SceneKit
|
|||
/// Returns a System.String that represents the current SCNVector4.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
public override string ToString ()
|
||||
{
|
||||
return String.Format("({0}, {1}, {2}, {3})", X, Y, Z, W);
|
||||
return String.Format ("({0}, {1}, {2}, {3})", X, Y, Z, W);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1090,9 +1081,9 @@ namespace SceneKit
|
|||
/// Returns the hashcode for this instance.
|
||||
/// </summary>
|
||||
/// <returns>A System.Int32 containing the unique hashcode for this instance.</returns>
|
||||
public override int GetHashCode()
|
||||
public override int GetHashCode ()
|
||||
{
|
||||
return X.GetHashCode() ^ Y.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
|
||||
return X.GetHashCode () ^ Y.GetHashCode () ^ Z.GetHashCode () ^ W.GetHashCode ();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1109,7 +1100,7 @@ namespace SceneKit
|
|||
if (!(obj is SCNVector4))
|
||||
return false;
|
||||
|
||||
return this.Equals((SCNVector4)obj);
|
||||
return this.Equals ((SCNVector4) obj);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1123,7 +1114,7 @@ namespace SceneKit
|
|||
/// <summary>Indicates whether the current vector is equal to another vector.</summary>
|
||||
/// <param name="other">A vector to compare with this vector.</param>
|
||||
/// <returns>true if the current vector is equal to the vector parameter; otherwise, false.</returns>
|
||||
public bool Equals(SCNVector4 other)
|
||||
public bool Equals (SCNVector4 other)
|
||||
{
|
||||
return
|
||||
X == other.X &&
|
||||
|
@ -1141,7 +1132,7 @@ namespace SceneKit
|
|||
|
||||
public static explicit operator Vector4 (SCNVector4 source)
|
||||
{
|
||||
return new Vector4 ((float)source.X, (float)source.Y, (float)source.Z, (float)source.W);
|
||||
return new Vector4 ((float) source.X, (float) source.Y, (float) source.Z, (float) source.W);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ namespace Security {
|
|||
{
|
||||
}
|
||||
#if !COREBUILD
|
||||
[DllImport (Constants.SecurityLibrary, EntryPoint="SecCertificateGetTypeID")]
|
||||
[DllImport (Constants.SecurityLibrary, EntryPoint = "SecCertificateGetTypeID")]
|
||||
public extern static nint GetTypeID ();
|
||||
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
|
@ -76,7 +76,7 @@ namespace Security {
|
|||
Initialize (data);
|
||||
}
|
||||
|
||||
public SecCertificate (byte[] data)
|
||||
public SecCertificate (byte [] data)
|
||||
{
|
||||
if (data is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
|
@ -169,7 +169,7 @@ namespace Security {
|
|||
}
|
||||
}
|
||||
|
||||
byte[] GetRawData ()
|
||||
byte [] GetRawData ()
|
||||
{
|
||||
using (NSData data = DerData)
|
||||
return data.ToArray ();
|
||||
|
@ -210,7 +210,7 @@ namespace Security {
|
|||
|
||||
if (firstData.Length != secondData.Length)
|
||||
return false;
|
||||
nint length = (nint)firstData.Length;
|
||||
nint length = (nint) firstData.Length;
|
||||
for (nint i = 0; i < length; i++) {
|
||||
if (firstData [i] != secondData [i])
|
||||
return false;
|
||||
|
@ -267,11 +267,11 @@ namespace Security {
|
|||
[ObsoletedOSPlatform ("tvos12.0")]
|
||||
[ObsoletedOSPlatform ("ios12.0")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[TV (10,3)]
|
||||
[Deprecated (PlatformName.iOS, 12,0)]
|
||||
[Deprecated (PlatformName.TvOS, 12,0)]
|
||||
[Deprecated (PlatformName.WatchOS, 5,0)]
|
||||
[iOS (10, 3)]
|
||||
[TV (10, 3)]
|
||||
[Deprecated (PlatformName.iOS, 12, 0)]
|
||||
[Deprecated (PlatformName.TvOS, 12, 0)]
|
||||
[Deprecated (PlatformName.WatchOS, 5, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* __nullable SecKeyRef */ IntPtr SecCertificateCopyPublicKey (IntPtr /* SecCertificateRef */ certificate);
|
||||
|
@ -286,11 +286,11 @@ namespace Security {
|
|||
[ObsoletedOSPlatform ("tvos12.0", "Use 'GetKey' instead.")]
|
||||
[ObsoletedOSPlatform ("ios12.0", "Use 'GetKey' instead.")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[TV (10,3)]
|
||||
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'GetKey' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12,0, message: "Use 'GetKey' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 5,0, message: "Use 'GetKey' instead.")]
|
||||
[iOS (10, 3)]
|
||||
[TV (10, 3)]
|
||||
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'GetKey' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'GetKey' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'GetKey' instead.")]
|
||||
#endif
|
||||
public SecKey? GetPublicKey ()
|
||||
{
|
||||
|
@ -306,10 +306,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios12.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (12,0)]
|
||||
[Mac (10,14)]
|
||||
[iOS (12,0)]
|
||||
[Watch (5,0)]
|
||||
[TV (12, 0)]
|
||||
[Mac (10, 14)]
|
||||
[iOS (12, 0)]
|
||||
[Watch (5, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern IntPtr /* SecKeyRef* */ SecCertificateCopyKey (IntPtr /* SecKeyRef* */ key);
|
||||
|
@ -320,10 +320,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios12.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[TV (12,0)]
|
||||
[Mac (10,14)]
|
||||
[iOS (12,0)]
|
||||
[Watch (5,0)]
|
||||
[TV (12, 0)]
|
||||
[Mac (10, 14)]
|
||||
[iOS (12, 0)]
|
||||
[Watch (5, 0)]
|
||||
#endif
|
||||
public SecKey? GetKey ()
|
||||
{
|
||||
|
@ -337,9 +337,9 @@ namespace Security {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (10,3)] // [Mac (10,5)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)] // [Mac (10,5)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* OSStatus */ int SecCertificateCopyCommonName (IntPtr /* SecCertificateRef */ certificate, out IntPtr /* CFStringRef * __nonnull CF_RETURNS_RETAINED */ commonName);
|
||||
|
@ -350,9 +350,9 @@ namespace Security {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
public string? GetCommonName ()
|
||||
{
|
||||
|
@ -367,9 +367,9 @@ namespace Security {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (10,3)] // [Mac (10,5)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)] // [Mac (10,5)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* OSStatus */ int SecCertificateCopyEmailAddresses (IntPtr /* SecCertificateRef */ certificate, out IntPtr /* CFArrayRef * __nonnull CF_RETURNS_RETAINED */ emailAddresses);
|
||||
|
@ -380,11 +380,11 @@ namespace Security {
|
|||
[SupportedOSPlatform ("maccatalyst")]
|
||||
[SupportedOSPlatform ("macos")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
public string?[]? GetEmailAddresses ()
|
||||
public string? []? GetEmailAddresses ()
|
||||
{
|
||||
if (SecCertificateCopyEmailAddresses (Handle, out var emails) == 0)
|
||||
return CFArray.StringArrayFromHandle (emails, true);
|
||||
|
@ -397,10 +397,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("tvos10.3")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[Mac (10,12,4)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)]
|
||||
[Mac (10, 12, 4)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* __nullable CFDataRef */ IntPtr SecCertificateCopyNormalizedIssuerSequence (IntPtr /* SecCertificateRef */ certificate);
|
||||
|
@ -411,10 +411,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("tvos10.3")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[Mac (10,12,4)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)]
|
||||
[Mac (10, 12, 4)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
public NSData? GetNormalizedIssuerSequence ()
|
||||
{
|
||||
|
@ -428,10 +428,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("tvos10.3")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[Mac (10,12,4)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)]
|
||||
[Mac (10, 12, 4)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* __nullable CFDataRef */ IntPtr SecCertificateCopyNormalizedSubjectSequence (IntPtr /* SecCertificateRef */ certificate);
|
||||
|
@ -442,10 +442,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("tvos10.3")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[Mac (10,12,4)]
|
||||
[TV (10,3)]
|
||||
[Watch (3,3)]
|
||||
[iOS (10, 3)]
|
||||
[Mac (10, 12, 4)]
|
||||
[TV (10, 3)]
|
||||
[Watch (3, 3)]
|
||||
#endif
|
||||
public NSData? GetNormalizedSubjectSequence ()
|
||||
{
|
||||
|
@ -477,11 +477,11 @@ namespace Security {
|
|||
[ObsoletedOSPlatform ("tvos11.0", "Use 'GetSerialNumber' instead.")]
|
||||
[ObsoletedOSPlatform ("ios11.0", "Use 'GetSerialNumber' instead.")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'GetSerialNumber' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'GetSerialNumber' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 4,0, message: "Use 'GetSerialNumber' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 11,0, message: "Use 'GetSerialNumber' instead.")]
|
||||
[iOS (10, 3)]
|
||||
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'GetSerialNumber' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'GetSerialNumber' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'GetSerialNumber' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'GetSerialNumber' instead.")]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* __nullable CFDataRef */ IntPtr SecCertificateCopySerialNumber (IntPtr /* SecCertificateRef */ certificate);
|
||||
|
@ -498,11 +498,11 @@ namespace Security {
|
|||
[ObsoletedOSPlatform ("tvos11.0", "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[ObsoletedOSPlatform ("ios11.0", "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
#else
|
||||
[iOS (10,3)]
|
||||
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10,13, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 4,0, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 11,0, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[iOS (10, 3)]
|
||||
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[Deprecated (PlatformName.WatchOS, 4, 0, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
[Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'GetSerialNumber(out NSError)' instead.")]
|
||||
#endif
|
||||
public NSData? GetSerialNumber ()
|
||||
{
|
||||
|
@ -520,10 +520,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("macos10.13")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (11,0)]
|
||||
[TV (11,0)]
|
||||
[Watch (4,0)]
|
||||
[Mac (10,13)]
|
||||
[iOS (11, 0)]
|
||||
[TV (11, 0)]
|
||||
[Watch (4, 0)]
|
||||
[Mac (10, 13)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* __nullable CFDataRef */ IntPtr SecCertificateCopySerialNumberData (IntPtr /* SecCertificateRef */ certificate, ref IntPtr /* CFErrorRef * */ error);
|
||||
|
@ -534,10 +534,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("macos10.13")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[iOS (11,0)]
|
||||
[TV (11,0)]
|
||||
[Watch (4,0)]
|
||||
[Mac (10,13)]
|
||||
[iOS (11, 0)]
|
||||
[TV (11, 0)]
|
||||
[Watch (4, 0)]
|
||||
[Mac (10, 13)]
|
||||
#endif
|
||||
public NSData? GetSerialNumber (out NSError? error)
|
||||
{
|
||||
|
@ -565,7 +565,7 @@ namespace Security {
|
|||
}
|
||||
|
||||
#if !COREBUILD
|
||||
[DllImport (Constants.SecurityLibrary, EntryPoint="SecIdentityGetTypeID")]
|
||||
[DllImport (Constants.SecurityLibrary, EntryPoint = "SecIdentityGetTypeID")]
|
||||
public extern static nint GetTypeID ();
|
||||
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
|
@ -580,7 +580,7 @@ namespace Security {
|
|||
}
|
||||
}
|
||||
|
||||
public static SecIdentity Import (byte[] data, string password)
|
||||
public static SecIdentity Import (byte [] data, string password)
|
||||
{
|
||||
if (data is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (data));
|
||||
|
@ -588,7 +588,7 @@ namespace Security {
|
|||
throw new ArgumentException (nameof (password));
|
||||
using (var pwstring = new NSString (password))
|
||||
using (var options = NSDictionary.FromObjectAndKey (pwstring, SecImportExport.Passphrase)) {
|
||||
NSDictionary[] array;
|
||||
NSDictionary [] array;
|
||||
SecStatusCode result = SecImportExport.ImportPkcs12 (data, options, out array);
|
||||
if (result != SecStatusCode.Success)
|
||||
throw new InvalidOperationException (result.ToString ());
|
||||
|
@ -634,7 +634,7 @@ namespace Security {
|
|||
}
|
||||
|
||||
#if !COREBUILD
|
||||
[DllImport (Constants.SecurityLibrary, EntryPoint="SecKeyGetTypeID")]
|
||||
[DllImport (Constants.SecurityLibrary, EntryPoint = "SecKeyGetTypeID")]
|
||||
public extern static nint GetTypeID ();
|
||||
|
||||
#if NET
|
||||
|
@ -690,7 +690,7 @@ namespace Security {
|
|||
IntPtr pub, priv;
|
||||
|
||||
var res = SecKeyGeneratePair (parameters.Handle, out pub, out priv);
|
||||
if (res == SecStatusCode.Success){
|
||||
if (res == SecStatusCode.Success) {
|
||||
publicKey = new SecKey (pub, true);
|
||||
privateKey = new SecKey (priv, true);
|
||||
} else
|
||||
|
@ -798,7 +798,7 @@ namespace Security {
|
|||
if (dataToSign is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (dataToSign));
|
||||
|
||||
fixed (byte *bp = dataToSign)
|
||||
fixed (byte* bp = dataToSign)
|
||||
return _RawSign (padding, (IntPtr) bp, dataToSign.Length, out result);
|
||||
}
|
||||
|
||||
|
@ -807,7 +807,7 @@ namespace Security {
|
|||
SecStatusCode status;
|
||||
nint len = 1024;
|
||||
result = new byte [len];
|
||||
fixed (byte *p = result) {
|
||||
fixed (byte* p = result) {
|
||||
status = SecKeyRawSign (GetCheckedHandle (), padding, dataToSign, dataToSignLen, (IntPtr) p, ref len);
|
||||
Array.Resize (ref result, (int) len);
|
||||
}
|
||||
|
@ -868,8 +868,8 @@ namespace Security {
|
|||
// so if length is 0, then pass an array with one element.
|
||||
var signatureArray = signature.Length == 0 ? new byte [] { 0 } : signature;
|
||||
var signedDataArray = signedData.Length == 0 ? new byte [] { 0 } : signedData;
|
||||
fixed (byte *sp = signatureArray)
|
||||
fixed (byte *dp = signedDataArray) {
|
||||
fixed (byte* sp = signatureArray)
|
||||
fixed (byte* dp = signedDataArray) {
|
||||
return SecKeyRawVerify (GetCheckedHandle (), padding, (IntPtr) dp, (nint) signedData.Length, (IntPtr) sp, (nint) signature.Length);
|
||||
}
|
||||
}
|
||||
|
@ -924,8 +924,8 @@ namespace Security {
|
|||
if (plainText is null)
|
||||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (plainText));
|
||||
unsafe {
|
||||
fixed (byte *cp = cipherText)
|
||||
fixed (byte *pp = plainText) {
|
||||
fixed (byte* cp = cipherText)
|
||||
fixed (byte* pp = plainText) {
|
||||
nint len = (nint) cipherText.Length;
|
||||
return SecKeyEncrypt (GetCheckedHandle (), padding, (IntPtr) pp, (nint) plainText.Length, (IntPtr) cp, ref len);
|
||||
}
|
||||
|
@ -986,13 +986,13 @@ namespace Security {
|
|||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (cipherText));
|
||||
|
||||
unsafe {
|
||||
fixed (byte *cp = cipherText) {
|
||||
fixed (byte* cp = cipherText) {
|
||||
if (plainText is null)
|
||||
plainText = new byte [cipherText.Length];
|
||||
nint len = plainText.Length;
|
||||
SecStatusCode status;
|
||||
fixed (byte *pp = plainText)
|
||||
status = SecKeyDecrypt (GetCheckedHandle (), padding, (IntPtr)cp, (nint)cipherText.Length, (IntPtr)pp, ref len);
|
||||
fixed (byte* pp = plainText)
|
||||
status = SecKeyDecrypt (GetCheckedHandle (), padding, (IntPtr) cp, (nint) cipherText.Length, (IntPtr) pp, ref len);
|
||||
if (len < plainText.Length)
|
||||
Array.Resize<byte> (ref plainText, (int) len);
|
||||
return status;
|
||||
|
@ -1012,10 +1012,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern IntPtr /* SecKeyRef _Nullable */ SecKeyCreateRandomKey (IntPtr /* CFDictionaryRef* */ parameters, out IntPtr /* CFErrorRef** */ error);
|
||||
|
@ -1026,10 +1026,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
static public SecKey? CreateRandomKey (NSDictionary parameters, out NSError? error)
|
||||
{
|
||||
|
@ -1048,10 +1048,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
static public SecKey? CreateRandomKey (SecKeyType keyType, int keySizeInBits, NSDictionary? parameters, out NSError? error)
|
||||
{
|
||||
|
@ -1092,10 +1092,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern IntPtr /* SecKeyRef _Nullable */ SecKeyCreateWithData (IntPtr /* CFDataRef* */ keyData, IntPtr /* CFDictionaryRef* */ attributes, out IntPtr /* CFErrorRef** */ error);
|
||||
|
@ -1106,10 +1106,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
static public SecKey? Create (NSData keyData, NSDictionary parameters, out NSError? error)
|
||||
{
|
||||
|
@ -1130,10 +1130,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
static public SecKey? Create (NSData keyData, SecKeyType keyType, SecKeyClass keyClass, int keySizeInBits, NSDictionary parameters, out NSError? error)
|
||||
{
|
||||
|
@ -1152,10 +1152,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern IntPtr /* CFDataRef _Nullable */ SecKeyCopyExternalRepresentation (IntPtr /* SecKeyRef* */ key, out IntPtr /* CFErrorRef** */ error);
|
||||
|
@ -1166,10 +1166,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? GetExternalRepresentation (out NSError? error)
|
||||
{
|
||||
|
@ -1184,10 +1184,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? GetExternalRepresentation ()
|
||||
{
|
||||
|
@ -1201,10 +1201,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern IntPtr /* CFDictionaryRef _Nullable */ SecKeyCopyAttributes (IntPtr /* SecKeyRef* */ key);
|
||||
|
@ -1215,10 +1215,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSDictionary? GetAttributes ()
|
||||
{
|
||||
|
@ -1232,10 +1232,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern IntPtr /* SecKeyRef* */ SecKeyCopyPublicKey (IntPtr /* SecKeyRef* */ key);
|
||||
|
@ -1246,10 +1246,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public SecKey? GetPublicKey ()
|
||||
{
|
||||
|
@ -1263,10 +1263,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.U1)]
|
||||
|
@ -1278,10 +1278,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public bool IsAlgorithmSupported (SecKeyOperationType operation, SecKeyAlgorithm algorithm)
|
||||
{
|
||||
|
@ -1294,10 +1294,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCreateSignature (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr dataToSign, /* CFErrorRef* */ out IntPtr error);
|
||||
|
@ -1308,10 +1308,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? CreateSignature (SecKeyAlgorithm algorithm, NSData dataToSign, out NSError? error)
|
||||
{
|
||||
|
@ -1329,10 +1329,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
[return: MarshalAs (UnmanagedType.U1)]
|
||||
|
@ -1344,10 +1344,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public bool VerifySignature (SecKeyAlgorithm algorithm, NSData signedData, NSData signature, out NSError? error)
|
||||
{
|
||||
|
@ -1367,10 +1367,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCreateEncryptedData (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr plaintext, /* CFErrorRef* */ out IntPtr error);
|
||||
|
@ -1381,10 +1381,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? CreateEncryptedData (SecKeyAlgorithm algorithm, NSData plaintext, out NSError? error)
|
||||
{
|
||||
|
@ -1402,10 +1402,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCreateDecryptedData (/* SecKeyRef */ IntPtr key, /* SecKeyAlgorithm */ IntPtr algorithm, /* CFDataRef */ IntPtr ciphertext, /* CFErrorRef* */ out IntPtr error);
|
||||
|
@ -1416,10 +1416,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? CreateDecryptedData (SecKeyAlgorithm algorithm, NSData ciphertext, out NSError? error)
|
||||
{
|
||||
|
@ -1437,10 +1437,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
[DllImport (Constants.SecurityLibrary)]
|
||||
static extern /* CFDataRef _Nullable */ IntPtr SecKeyCopyKeyExchangeResult (/* SecKeyRef */ IntPtr privateKey, /* SecKeyAlgorithm */ IntPtr algorithm, /* SecKeyRef */ IntPtr publicKey, /* CFDictionaryRef */ IntPtr parameters, /* CFErrorRef* */ out IntPtr error);
|
||||
|
@ -1451,10 +1451,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? GetKeyExchangeResult (SecKeyAlgorithm algorithm, SecKey publicKey, NSDictionary parameters, out NSError? error)
|
||||
{
|
||||
|
@ -1474,10 +1474,10 @@ namespace Security {
|
|||
[SupportedOSPlatform ("ios10.0")]
|
||||
[SupportedOSPlatform ("maccatalyst")]
|
||||
#else
|
||||
[Watch (3,0)]
|
||||
[TV (10,0)]
|
||||
[Mac (10,12)]
|
||||
[iOS (10,0)]
|
||||
[Watch (3, 0)]
|
||||
[TV (10, 0)]
|
||||
[Mac (10, 12)]
|
||||
[iOS (10, 0)]
|
||||
#endif
|
||||
public NSData? GetKeyExchangeResult (SecKeyAlgorithm algorithm, SecKey publicKey, SecKeyKeyExchangeParameter parameters, out NSError? error)
|
||||
{
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче