// WARNING - AUTOGENERATED - DO NOT EDIT
//
// Generated using `sharpie urho`
//
// StaticModel.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
{
///
/// Static model component.
///
public unsafe partial class StaticModel : Drawable
{
unsafe partial void OnStaticModelCreated ();
[Preserve]
public StaticModel (IntPtr handle) : base (handle)
{
OnStaticModelCreated ();
}
[Preserve]
protected StaticModel (UrhoObjectFlag emptyFlag) : base (emptyFlag)
{
OnStaticModelCreated ();
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern int StaticModel_GetType (IntPtr handle);
private StringHash UrhoGetType ()
{
Runtime.ValidateRefCounted (this);
return new StringHash (StaticModel_GetType (handle));
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr StaticModel_GetTypeName (IntPtr handle);
private string GetTypeName ()
{
Runtime.ValidateRefCounted (this);
return Marshal.PtrToStringAnsi (StaticModel_GetTypeName (handle));
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern int StaticModel_GetTypeStatic ();
private static StringHash GetTypeStatic ()
{
Runtime.Validate (typeof(StaticModel));
return new StringHash (StaticModel_GetTypeStatic ());
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr StaticModel_GetTypeNameStatic ();
private static string GetTypeNameStatic ()
{
Runtime.Validate (typeof(StaticModel));
return Marshal.PtrToStringAnsi (StaticModel_GetTypeNameStatic ());
}
[Preserve]
public StaticModel () : this (Application.CurrentContext)
{
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr StaticModel_StaticModel (IntPtr context);
[Preserve]
public StaticModel (Context context) : base (UrhoObjectFlag.Empty)
{
Runtime.Validate (typeof(StaticModel));
handle = StaticModel_StaticModel ((object)context == null ? IntPtr.Zero : context.Handle);
Runtime.RegisterObject (this);
OnStaticModelCreated ();
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void StaticModel_RegisterObject (IntPtr context);
///
/// Register object factory. Drawable must be registered first.
///
public new static void RegisterObject (Context context)
{
Runtime.Validate (typeof(StaticModel));
StaticModel_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr StaticModel_GetLodGeometry (IntPtr handle, uint batchIndex, uint level);
///
/// Return the geometry for a specific LOD level.
///
public override Geometry GetLodGeometry (uint batchIndex, uint level)
{
Runtime.ValidateRefCounted (this);
return Runtime.LookupObject (StaticModel_GetLodGeometry (handle, batchIndex, level));
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern uint StaticModel_GetNumOccluderTriangles (IntPtr handle);
///
/// Return number of occlusion geometry triangles.
///
private uint GetNumOccluderTriangles ()
{
Runtime.ValidateRefCounted (this);
return StaticModel_GetNumOccluderTriangles (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool StaticModel_DrawOcclusion (IntPtr handle, IntPtr buffer);
///
/// Draw to occlusion buffer. Return true if did not run out of triangles.
///
public override bool DrawOcclusion (OcclusionBuffer buffer)
{
Runtime.ValidateRefCounted (this);
return StaticModel_DrawOcclusion (handle, (object)buffer == null ? IntPtr.Zero : buffer.Handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void StaticModel_SetModel (IntPtr handle, IntPtr model);
///
/// Set model.
///
private void SetModel (Model model)
{
Runtime.ValidateRefCounted (this);
StaticModel_SetModel (handle, (object)model == null ? IntPtr.Zero : model.Handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void StaticModel_SetMaterial (IntPtr handle, IntPtr material);
///
/// Set material on all geometries.
///
public void SetMaterial (Material material)
{
Runtime.ValidateRefCounted (this);
StaticModel_SetMaterial (handle, (object)material == null ? IntPtr.Zero : material.Handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool StaticModel_SetMaterial0 (IntPtr handle, uint index, IntPtr material);
///
/// Set material on one geometry. Return true if successful.
///
public bool SetMaterial (uint index, Material material)
{
Runtime.ValidateRefCounted (this);
return StaticModel_SetMaterial0 (handle, index, (object)material == null ? IntPtr.Zero : material.Handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void StaticModel_SetOcclusionLodLevel (IntPtr handle, uint level);
///
/// Set occlusion LOD level. By default (M_MAX_UNSIGNED) same as visible.
///
private void SetOcclusionLodLevel (uint level)
{
Runtime.ValidateRefCounted (this);
StaticModel_SetOcclusionLodLevel (handle, level);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void StaticModel_ApplyMaterialList (IntPtr handle, string fileName);
///
/// Apply default materials from a material list file. If filename is empty (default), the model's resource name with extension .txt will be used.
///
public void ApplyMaterialList (string fileName = "")
{
Runtime.ValidateRefCounted (this);
StaticModel_ApplyMaterialList (handle, fileName);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr StaticModel_GetModel (IntPtr handle);
///
/// Return model.
///
private Model GetModel ()
{
Runtime.ValidateRefCounted (this);
return Runtime.LookupObject (StaticModel_GetModel (handle));
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern uint StaticModel_GetNumGeometries (IntPtr handle);
///
/// Return number of geometries.
///
private uint GetNumGeometries ()
{
Runtime.ValidateRefCounted (this);
return StaticModel_GetNumGeometries (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr StaticModel_GetMaterial (IntPtr handle, uint index);
///
/// Return material by geometry index.
///
public Material GetMaterial (uint index = 0)
{
Runtime.ValidateRefCounted (this);
return Runtime.LookupObject (StaticModel_GetMaterial (handle, index));
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern uint StaticModel_GetOcclusionLodLevel (IntPtr handle);
///
/// Return occlusion LOD level.
///
private uint GetOcclusionLodLevel ()
{
Runtime.ValidateRefCounted (this);
return StaticModel_GetOcclusionLodLevel (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool StaticModel_IsInside (IntPtr handle, ref Urho.Vector3 point);
///
/// Determines if the given world space point is within the model geometry.
///
public bool IsInside (Urho.Vector3 point)
{
Runtime.ValidateRefCounted (this);
return StaticModel_IsInside (handle, ref point);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool StaticModel_IsInsideLocal (IntPtr handle, ref Urho.Vector3 point);
///
/// Determines if the given local space point is within the model geometry.
///
public bool IsInsideLocal (Urho.Vector3 point)
{
Runtime.ValidateRefCounted (this);
return StaticModel_IsInsideLocal (handle, ref point);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern ResourceRef StaticModel_GetModelAttr (IntPtr handle);
///
/// Return model attribute.
///
private ResourceRef GetModelAttr ()
{
Runtime.ValidateRefCounted (this);
return StaticModel_GetModelAttr (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 ();
}
}
///
/// Return number of occlusion geometry triangles.
///
public override uint NumOccluderTriangles {
get {
return GetNumOccluderTriangles ();
}
}
///
/// Return model.
/// Or
/// Set model.
///
public Model Model {
get {
return GetModel ();
}
set {
SetModel (value);
}
}
///
/// Return occlusion LOD level.
/// Or
/// Set occlusion LOD level. By default (M_MAX_UNSIGNED) same as visible.
///
public uint OcclusionLodLevel {
get {
return GetOcclusionLodLevel ();
}
set {
SetOcclusionLodLevel (value);
}
}
///
/// Return number of geometries.
///
public uint NumGeometries {
get {
return GetNumGeometries ();
}
}
///
/// Return model attribute.
///
public virtual ResourceRef ModelAttr {
get {
return GetModelAttr ();
}
}
}
}