| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278 |
- // WARNING - AUTOGENERATED - DO NOT EDIT
- //
- // Generated using `sharpie urho`
- //
- // Camera.cs
- //
- // Copyright 2015 Xamarin Inc. All rights reserved.
- using System;
- using System.Runtime.InteropServices;
- using System.Collections.Generic;
- using Urho.Urho2D;
- using Urho.Gui;
- using Urho.Resources;
- using Urho.IO;
- using Urho.Navigation;
- using Urho.Network;
- namespace Urho
- {
- /// <summary>
- /// %Camera component.
- /// </summary>
- public unsafe partial class Camera : Component
- {
- unsafe partial void OnCameraCreated ();
- [Preserve]
- public Camera (IntPtr handle) : base (handle)
- {
- OnCameraCreated ();
- }
- [Preserve]
- protected Camera (UrhoObjectFlag emptyFlag) : base (emptyFlag)
- {
- OnCameraCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Camera_GetType (IntPtr handle);
- private StringHash UrhoGetType ()
- {
- Runtime.ValidateRefCounted (this);
- return new StringHash (Camera_GetType (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_GetTypeName (IntPtr handle);
- private string GetTypeName ()
- {
- Runtime.ValidateRefCounted (this);
- return Marshal.PtrToStringAnsi (Camera_GetTypeName (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern int Camera_GetTypeStatic ();
- private static StringHash GetTypeStatic ()
- {
- Runtime.Validate (typeof(Camera));
- return new StringHash (Camera_GetTypeStatic ());
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_GetTypeNameStatic ();
- private static string GetTypeNameStatic ()
- {
- Runtime.Validate (typeof(Camera));
- return Marshal.PtrToStringAnsi (Camera_GetTypeNameStatic ());
- }
- [Preserve]
- public Camera () : this (Application.CurrentContext)
- {
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_Camera (IntPtr context);
- [Preserve]
- public Camera (Context context) : base (UrhoObjectFlag.Empty)
- {
- Runtime.Validate (typeof(Camera));
- handle = Camera_Camera ((object)context == null ? IntPtr.Zero : context.Handle);
- Runtime.RegisterObject (this);
- OnCameraCreated ();
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_RegisterObject (IntPtr context);
- /// <summary>
- /// Register object factory.
- /// </summary>
- public new static void RegisterObject (Context context)
- {
- Runtime.Validate (typeof(Camera));
- Camera_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
- /// <summary>
- /// Visualize the component as debug geometry.
- /// </summary>
- public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
- {
- Runtime.ValidateRefCounted (this);
- Camera_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetNearClip (IntPtr handle, float nearClip);
- /// <summary>
- /// Set near clip distance.
- /// </summary>
- private void SetNearClip (float nearClip)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetNearClip (handle, nearClip);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetFarClip (IntPtr handle, float farClip);
- /// <summary>
- /// Set far clip distance.
- /// </summary>
- private void SetFarClip (float farClip)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetFarClip (handle, farClip);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetFov (IntPtr handle, float fov);
- /// <summary>
- /// Set vertical field of view in degrees.
- /// </summary>
- private void SetFov (float fov)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetFov (handle, fov);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetSkew (IntPtr handle, float skew);
- /// <summary>
- /// Set skew
- /// </summary>
- private void SetSkew (float skew)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetSkew (handle, skew);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetOrthoSize (IntPtr handle, float orthoSize);
- /// <summary>
- /// Set orthographic mode view uniform size.
- /// </summary>
- private void SetOrthoSize (float orthoSize)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetOrthoSize (handle, orthoSize);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetOrthoSize0 (IntPtr handle, ref Urho.Vector2 orthoSize);
- /// <summary>
- /// Set orthographic mode view non-uniform size. Disables the auto aspect ratio -mode.
- /// </summary>
- public void SetOrthoSize (Urho.Vector2 orthoSize)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetOrthoSize0 (handle, ref orthoSize);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetAspectRatio (IntPtr handle, float aspectRatio);
- /// <summary>
- /// Set aspect ratio manually. Disables the auto aspect ratio -mode.
- /// </summary>
- private void SetAspectRatio (float aspectRatio)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetAspectRatio (handle, aspectRatio);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetFillMode (IntPtr handle, FillMode mode);
- /// <summary>
- /// Set polygon fill mode to use when rendering a scene.
- /// </summary>
- private void SetFillMode (FillMode mode)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetFillMode (handle, mode);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetZoom (IntPtr handle, float zoom);
- /// <summary>
- /// Set zoom.
- /// </summary>
- private void SetZoom (float zoom)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetZoom (handle, zoom);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetLodBias (IntPtr handle, float bias);
- /// <summary>
- /// Set LOD bias.
- /// </summary>
- private void SetLodBias (float bias)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetLodBias (handle, bias);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetViewMask (IntPtr handle, uint mask);
- /// <summary>
- /// Set view mask. Will be and'ed with object's view mask to see if the object should be rendered.
- /// </summary>
- private void SetViewMask (uint mask)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetViewMask (handle, mask);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetViewOverrideFlags (IntPtr handle, uint flags);
- /// <summary>
- /// Set view override flags.
- /// </summary>
- private void SetViewOverrideFlags (uint flags)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetViewOverrideFlags (handle, flags);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetOrthographic (IntPtr handle, bool enable);
- /// <summary>
- /// Set orthographic mode enabled/disabled.
- /// </summary>
- private void SetOrthographic (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetOrthographic (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetAutoAspectRatio (IntPtr handle, bool enable);
- /// <summary>
- /// Set automatic aspect ratio based on viewport dimensions. Enabled by default.
- /// </summary>
- private void SetAutoAspectRatio (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetAutoAspectRatio (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetProjectionOffset (IntPtr handle, ref Urho.Vector2 offset);
- /// <summary>
- /// Set projection offset. It needs to be calculated as (offset in pixels) / (viewport dimensions.)
- /// </summary>
- private void SetProjectionOffset (Urho.Vector2 offset)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetProjectionOffset (handle, ref offset);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetUseReflection (IntPtr handle, bool enable);
- /// <summary>
- /// Set reflection mode.
- /// </summary>
- private void SetUseReflection (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetUseReflection (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetReflectionPlane (IntPtr handle, ref Urho.Plane plane);
- /// <summary>
- /// Set reflection plane in world space for reflection mode.
- /// </summary>
- private void SetReflectionPlane (Urho.Plane plane)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetReflectionPlane (handle, ref plane);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetUseClipping (IntPtr handle, bool enable);
- /// <summary>
- /// Set whether to use a custom clip plane.
- /// </summary>
- private void SetUseClipping (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetUseClipping (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetClipPlane (IntPtr handle, ref Urho.Plane plane);
- /// <summary>
- /// Set custom clipping plane in world space.
- /// </summary>
- private void SetClipPlane (Urho.Plane plane)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetClipPlane (handle, ref plane);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetFlipVertical (IntPtr handle, bool enable);
- /// <summary>
- /// Set vertical flipping mode. Called internally by View to resolve OpenGL / Direct3D9 rendertarget sampling differences.
- /// </summary>
- private void SetFlipVertical (bool enable)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetFlipVertical (handle, enable);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetProjection (IntPtr handle, ref Urho.Matrix4 projection);
- /// <summary>
- /// Set custom projection matrix, which should be specified in D3D convention with depth range 0 - 1. Disables auto aspect ratio.
- /// Change any of the standard view parameters (FOV, far clip, zoom etc.) to revert to the standard projection.
- /// Note that the custom projection is not serialized or replicated through the network.
- /// </summary>
- public void SetProjection (Urho.Matrix4 projection)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetProjection (handle, ref projection);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetFarClip (IntPtr handle);
- /// <summary>
- /// Return far clip distance. If a custom projection matrix is in use, is calculated from it instead of the value assigned with SetFarClip().
- /// </summary>
- private float GetFarClip ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetFarClip (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetNearClip (IntPtr handle);
- /// <summary>
- /// Return near clip distance. If a custom projection matrix is in use, is calculated from it instead of the value assigned with SetNearClip().
- /// </summary>
- private float GetNearClip ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetNearClip (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetSkew (IntPtr handle);
- /// <summary>
- /// Return skew.
- /// </summary>
- private float GetSkew ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetSkew (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetFov (IntPtr handle);
- /// <summary>
- /// Return vertical field of view in degrees.
- /// </summary>
- private float GetFov ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetFov (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetOrthoSize (IntPtr handle);
- /// <summary>
- /// Return orthographic mode size.
- /// </summary>
- private float GetOrthoSize ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetOrthoSize (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetAspectRatio (IntPtr handle);
- /// <summary>
- /// Return aspect ratio.
- /// </summary>
- private float GetAspectRatio ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetAspectRatio (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetZoom (IntPtr handle);
- /// <summary>
- /// Return zoom.
- /// </summary>
- private float GetZoom ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetZoom (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetLodBias (IntPtr handle);
- /// <summary>
- /// Return LOD bias.
- /// </summary>
- private float GetLodBias ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetLodBias (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint Camera_GetViewMask (IntPtr handle);
- /// <summary>
- /// Return view mask.
- /// </summary>
- private uint GetViewMask ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetViewMask (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint Camera_GetViewOverrideFlags (IntPtr handle);
- /// <summary>
- /// Return view override flags.
- /// </summary>
- private uint GetViewOverrideFlags ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetViewOverrideFlags (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern FillMode Camera_GetFillMode (IntPtr handle);
- /// <summary>
- /// Return fill mode.
- /// </summary>
- private FillMode GetFillMode ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetFillMode (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_IsOrthographic (IntPtr handle);
- /// <summary>
- /// Return orthographic flag.
- /// </summary>
- private bool IsOrthographic ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_IsOrthographic (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_GetAutoAspectRatio (IntPtr handle);
- /// <summary>
- /// Return auto aspect ratio flag.
- /// </summary>
- private bool GetAutoAspectRatio ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetAutoAspectRatio (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_GetFrustum (IntPtr handle);
- /// <summary>
- /// Return frustum in world space.
- /// </summary>
- private Frustum GetFrustum ()
- {
- Runtime.ValidateRefCounted (this);
- return new Frustum (Camera_GetFrustum (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Matrix4 Camera_GetProjection (IntPtr handle);
- /// <summary>
- /// Return projection matrix. It's in D3D convention with depth range 0 - 1.
- /// </summary>
- private Matrix4 GetProjection ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetProjection (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Matrix4 Camera_GetGPUProjection (IntPtr handle);
- /// <summary>
- /// Return projection matrix converted to API-specific format for use as a shader parameter.
- /// </summary>
- private Matrix4 GetGPUProjection ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetGPUProjection (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.Matrix3x4 Camera_GetView (IntPtr handle);
- /// <summary>
- /// Return view matrix.
- /// </summary>
- private Urho.Matrix3x4 GetView ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetView (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetHalfViewSize (IntPtr handle);
- /// <summary>
- /// Return half view size.
- /// </summary>
- private float GetHalfViewSize ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetHalfViewSize (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_GetSplitFrustum (IntPtr handle, float nearClip, float farClip);
- /// <summary>
- /// Return frustum split by custom near and far clip distances.
- /// </summary>
- public Frustum GetSplitFrustum (float nearClip, float farClip)
- {
- Runtime.ValidateRefCounted (this);
- return new Frustum (Camera_GetSplitFrustum (handle, nearClip, farClip));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_GetViewSpaceFrustum (IntPtr handle);
- /// <summary>
- /// Return frustum in view space.
- /// </summary>
- private Frustum GetViewSpaceFrustum ()
- {
- Runtime.ValidateRefCounted (this);
- return new Frustum (Camera_GetViewSpaceFrustum (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr Camera_GetViewSpaceSplitFrustum (IntPtr handle, float nearClip, float farClip);
- /// <summary>
- /// Return split frustum in view space.
- /// </summary>
- public Frustum GetViewSpaceSplitFrustum (float nearClip, float farClip)
- {
- Runtime.ValidateRefCounted (this);
- return new Frustum (Camera_GetViewSpaceSplitFrustum (handle, nearClip, farClip));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Ray Camera_GetScreenRay (IntPtr handle, float x, float y);
- /// <summary>
- /// Return ray corresponding to normalized screen coordinates (0 - 1), with origin on the near clip plane.
- /// </summary>
- public Ray GetScreenRay (float x, float y)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetScreenRay (handle, x, y);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Vector2 Camera_WorldToScreenPoint (IntPtr handle, ref Urho.Vector3 worldPos);
- /// <summary>
- /// Convert a world space point to normalized screen coordinates (0 - 1).
- /// </summary>
- public Vector2 WorldToScreenPoint (Urho.Vector3 worldPos)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_WorldToScreenPoint (handle, ref worldPos);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Vector3 Camera_ScreenToWorldPoint (IntPtr handle, ref Urho.Vector3 screenPos);
- /// <summary>
- /// Convert normalized screen coordinates (0 - 1) and distance along view Z axis (in Z coordinate) to a world space point. The distance can not be closer than the near clip plane.
- /// Note that a HitDistance() from the camera screen ray is not the same as distance along the view Z axis, as under a perspective projection the ray is likely to not be Z-aligned.
- /// </summary>
- public Vector3 ScreenToWorldPoint (Urho.Vector3 screenPos)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_ScreenToWorldPoint (handle, ref screenPos);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.Vector2 Camera_GetProjectionOffset (IntPtr handle);
- /// <summary>
- /// Return projection offset.
- /// </summary>
- private Urho.Vector2 GetProjectionOffset ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetProjectionOffset (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_GetUseReflection (IntPtr handle);
- /// <summary>
- /// Return whether is using reflection.
- /// </summary>
- private bool GetUseReflection ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetUseReflection (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.Plane Camera_GetReflectionPlane (IntPtr handle);
- /// <summary>
- /// Return the reflection plane.
- /// </summary>
- private Urho.Plane GetReflectionPlane ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetReflectionPlane (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_GetUseClipping (IntPtr handle);
- /// <summary>
- /// Return whether is using a custom clipping plane.
- /// </summary>
- private bool GetUseClipping ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetUseClipping (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Urho.Plane Camera_GetClipPlane (IntPtr handle);
- /// <summary>
- /// Return the custom clipping plane.
- /// </summary>
- private Urho.Plane GetClipPlane ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetClipPlane (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_GetFlipVertical (IntPtr handle);
- /// <summary>
- /// Return vertical flipping mode.
- /// </summary>
- private bool GetFlipVertical ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetFlipVertical (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_GetReverseCulling (IntPtr handle);
- /// <summary>
- /// Return whether to reverse culling; affected by vertical flipping and reflection.
- /// </summary>
- private bool GetReverseCulling ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetReverseCulling (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetDistance (IntPtr handle, ref Urho.Vector3 worldPos);
- /// <summary>
- /// Return distance to position. In orthographic mode uses only Z coordinate.
- /// </summary>
- public float GetDistance (Urho.Vector3 worldPos)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetDistance (handle, ref worldPos);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetDistanceSquared (IntPtr handle, ref Urho.Vector3 worldPos);
- /// <summary>
- /// Return squared distance to position. In orthographic mode uses only Z coordinate.
- /// </summary>
- public float GetDistanceSquared (Urho.Vector3 worldPos)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetDistanceSquared (handle, ref worldPos);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern float Camera_GetLodDistance (IntPtr handle, float distance, float scale, float bias);
- /// <summary>
- /// Return a scene node's LOD scaled distance.
- /// </summary>
- public float GetLodDistance (float distance, float scale, float bias)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetLodDistance (handle, distance, scale, bias);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Quaternion Camera_GetFaceCameraRotation (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation, FaceCameraMode mode, float minAngle);
- /// <summary>
- /// Return a world rotation for facing a camera on certain axes based on the existing world rotation.
- /// </summary>
- public Quaternion GetFaceCameraRotation (Urho.Vector3 position, Urho.Quaternion rotation, FaceCameraMode mode, float minAngle = 0f)
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetFaceCameraRotation (handle, ref position, ref rotation, mode, minAngle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Matrix3x4 Camera_GetEffectiveWorldTransform (IntPtr handle);
- /// <summary>
- /// Get effective world transform for matrix and frustum calculations including reflection but excluding node scaling.
- /// </summary>
- private Matrix3x4 GetEffectiveWorldTransform ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetEffectiveWorldTransform (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool Camera_IsProjectionValid (IntPtr handle);
- /// <summary>
- /// Return if projection parameters are valid for rendering and raycasting.
- /// </summary>
- private bool IsProjectionValid ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_IsProjectionValid (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetAspectRatioInternal (IntPtr handle, float aspectRatio);
- /// <summary>
- /// Set aspect ratio without disabling the "auto aspect ratio" mode. Called internally by View.
- /// </summary>
- public void SetAspectRatioInternal (float aspectRatio)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetAspectRatioInternal (handle, aspectRatio);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetOrthoSizeAttr (IntPtr handle, float orthoSize);
- /// <summary>
- /// Set orthographic size attribute without forcing the aspect ratio.
- /// </summary>
- public void SetOrthoSizeAttr (float orthoSize)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetOrthoSizeAttr (handle, orthoSize);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetReflectionPlaneAttr (IntPtr handle, ref Urho.Vector4 value);
- /// <summary>
- /// Set reflection plane attribute.
- /// </summary>
- public void SetReflectionPlaneAttr (Urho.Vector4 value)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetReflectionPlaneAttr (handle, ref value);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Vector4 Camera_GetReflectionPlaneAttr (IntPtr handle);
- /// <summary>
- /// Return reflection plane attribute.
- /// </summary>
- private Vector4 GetReflectionPlaneAttr ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetReflectionPlaneAttr (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void Camera_SetClipPlaneAttr (IntPtr handle, ref Urho.Vector4 value);
- /// <summary>
- /// Set clipping plane attribute.
- /// </summary>
- public void SetClipPlaneAttr (Urho.Vector4 value)
- {
- Runtime.ValidateRefCounted (this);
- Camera_SetClipPlaneAttr (handle, ref value);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern Vector4 Camera_GetClipPlaneAttr (IntPtr handle);
- /// <summary>
- /// Return clipping plane attribute.
- /// </summary>
- private Vector4 GetClipPlaneAttr ()
- {
- Runtime.ValidateRefCounted (this);
- return Camera_GetClipPlaneAttr (handle);
- }
- public override StringHash Type {
- get {
- return UrhoGetType ();
- }
- }
- public override string TypeName {
- get {
- return GetTypeName ();
- }
- }
- [Preserve]
- public new static StringHash TypeStatic {
- get {
- return GetTypeStatic ();
- }
- }
- public new static string TypeNameStatic {
- get {
- return GetTypeNameStatic ();
- }
- }
- /// <summary>
- /// Return near clip distance. If a custom projection matrix is in use, is calculated from it instead of the value assigned with SetNearClip().
- /// Or
- /// Set near clip distance.
- /// </summary>
- public float NearClip {
- get {
- return GetNearClip ();
- }
- set {
- SetNearClip (value);
- }
- }
- /// <summary>
- /// Return far clip distance. If a custom projection matrix is in use, is calculated from it instead of the value assigned with SetFarClip().
- /// Or
- /// Set far clip distance.
- /// </summary>
- public float FarClip {
- get {
- return GetFarClip ();
- }
- set {
- SetFarClip (value);
- }
- }
- /// <summary>
- /// Return vertical field of view in degrees.
- /// Or
- /// Set vertical field of view in degrees.
- /// </summary>
- public float Fov {
- get {
- return GetFov ();
- }
- set {
- SetFov (value);
- }
- }
- /// <summary>
- /// Return skew.
- /// Or
- /// Set skew
- /// </summary>
- public float Skew {
- get {
- return GetSkew ();
- }
- set {
- SetSkew (value);
- }
- }
- /// <summary>
- /// Return orthographic mode size.
- /// Or
- /// Set orthographic mode view uniform size.
- /// </summary>
- public float OrthoSize {
- get {
- return GetOrthoSize ();
- }
- set {
- SetOrthoSize (value);
- }
- }
- /// <summary>
- /// Return aspect ratio.
- /// Or
- /// Set aspect ratio manually. Disables the auto aspect ratio -mode.
- /// </summary>
- public float AspectRatio {
- get {
- return GetAspectRatio ();
- }
- set {
- SetAspectRatio (value);
- }
- }
- /// <summary>
- /// Return fill mode.
- /// Or
- /// Set polygon fill mode to use when rendering a scene.
- /// </summary>
- public FillMode FillMode {
- get {
- return GetFillMode ();
- }
- set {
- SetFillMode (value);
- }
- }
- /// <summary>
- /// Return zoom.
- /// Or
- /// Set zoom.
- /// </summary>
- public float Zoom {
- get {
- return GetZoom ();
- }
- set {
- SetZoom (value);
- }
- }
- /// <summary>
- /// Return LOD bias.
- /// Or
- /// Set LOD bias.
- /// </summary>
- public float LodBias {
- get {
- return GetLodBias ();
- }
- set {
- SetLodBias (value);
- }
- }
- /// <summary>
- /// Return view mask.
- /// Or
- /// Set view mask. Will be and'ed with object's view mask to see if the object should be rendered.
- /// </summary>
- public uint ViewMask {
- get {
- return GetViewMask ();
- }
- set {
- SetViewMask (value);
- }
- }
- /// <summary>
- /// Return view override flags.
- /// Or
- /// Set view override flags.
- /// </summary>
- public ViewOverrideFlags ViewOverrideFlags {
- get {
- return (ViewOverrideFlags)GetViewOverrideFlags ();
- }
- set {
- SetViewOverrideFlags ((uint)value);
- }
- }
- /// <summary>
- /// Return orthographic flag.
- /// Or
- /// Set orthographic mode enabled/disabled.
- /// </summary>
- public bool Orthographic {
- get {
- return IsOrthographic ();
- }
- set {
- SetOrthographic (value);
- }
- }
- /// <summary>
- /// Return auto aspect ratio flag.
- /// Or
- /// Set automatic aspect ratio based on viewport dimensions. Enabled by default.
- /// </summary>
- public bool AutoAspectRatio {
- get {
- return GetAutoAspectRatio ();
- }
- set {
- SetAutoAspectRatio (value);
- }
- }
- /// <summary>
- /// Return projection offset.
- /// Or
- /// Set projection offset. It needs to be calculated as (offset in pixels) / (viewport dimensions.)
- /// </summary>
- public Urho.Vector2 ProjectionOffset {
- get {
- return GetProjectionOffset ();
- }
- set {
- SetProjectionOffset (value);
- }
- }
- /// <summary>
- /// Return whether is using reflection.
- /// Or
- /// Set reflection mode.
- /// </summary>
- public bool UseReflection {
- get {
- return GetUseReflection ();
- }
- set {
- SetUseReflection (value);
- }
- }
- /// <summary>
- /// Return the reflection plane.
- /// Or
- /// Set reflection plane in world space for reflection mode.
- /// </summary>
- public Urho.Plane ReflectionPlane {
- get {
- return GetReflectionPlane ();
- }
- set {
- SetReflectionPlane (value);
- }
- }
- /// <summary>
- /// Return whether is using a custom clipping plane.
- /// Or
- /// Set whether to use a custom clip plane.
- /// </summary>
- public bool UseClipping {
- get {
- return GetUseClipping ();
- }
- set {
- SetUseClipping (value);
- }
- }
- /// <summary>
- /// Return the custom clipping plane.
- /// Or
- /// Set custom clipping plane in world space.
- /// </summary>
- public Urho.Plane ClipPlane {
- get {
- return GetClipPlane ();
- }
- set {
- SetClipPlane (value);
- }
- }
- /// <summary>
- /// Return vertical flipping mode.
- /// Or
- /// Set vertical flipping mode. Called internally by View to resolve OpenGL / Direct3D9 rendertarget sampling differences.
- /// </summary>
- public bool FlipVertical {
- get {
- return GetFlipVertical ();
- }
- set {
- SetFlipVertical (value);
- }
- }
- /// <summary>
- /// Return projection matrix. It's in D3D convention with depth range 0 - 1.
- /// </summary>
- public Matrix4 Projection {
- get {
- return GetProjection ();
- }
- }
- /// <summary>
- /// Return frustum in world space.
- /// </summary>
- public Frustum Frustum {
- get {
- return GetFrustum ();
- }
- }
- /// <summary>
- /// Return projection matrix converted to API-specific format for use as a shader parameter.
- /// </summary>
- public Matrix4 GPUProjection {
- get {
- return GetGPUProjection ();
- }
- }
- /// <summary>
- /// Return view matrix.
- /// </summary>
- public Urho.Matrix3x4 View {
- get {
- return GetView ();
- }
- }
- /// <summary>
- /// Return half view size.
- /// </summary>
- public float HalfViewSize {
- get {
- return GetHalfViewSize ();
- }
- }
- /// <summary>
- /// Return frustum in view space.
- /// </summary>
- public Frustum ViewSpaceFrustum {
- get {
- return GetViewSpaceFrustum ();
- }
- }
- /// <summary>
- /// Return whether to reverse culling; affected by vertical flipping and reflection.
- /// </summary>
- public bool ReverseCulling {
- get {
- return GetReverseCulling ();
- }
- }
- /// <summary>
- /// Get effective world transform for matrix and frustum calculations including reflection but excluding node scaling.
- /// </summary>
- public Matrix3x4 EffectiveWorldTransform {
- get {
- return GetEffectiveWorldTransform ();
- }
- }
- /// <summary>
- /// Return if projection parameters are valid for rendering and raycasting.
- /// </summary>
- public bool ProjectionValid {
- get {
- return IsProjectionValid ();
- }
- }
- /// <summary>
- /// Return reflection plane attribute.
- /// </summary>
- public Vector4 ReflectionPlaneAttr {
- get {
- return GetReflectionPlaneAttr ();
- }
- }
- /// <summary>
- /// Return clipping plane attribute.
- /// </summary>
- public Vector4 ClipPlaneAttr {
- get {
- return GetClipPlaneAttr ();
- }
- }
- }
- }
|