Jump to content

C# Mesh


Rekindled Phoenix
 Share

Recommended Posts

I'm creating a mesh from scratch and wondering why the default empty Constructor is not accessible.

 

Here are the available constructors:

Protected Sub New()
Private Sub New(ByVal entity As IntPtr)

 

Why are they not accessible?

If this is done on purpose, what is the best method for creating a new mesh using the header library? I can't seem to create one from scratch.

Link to comment
Share on other sites

Mesh mesh = (Mesh)new Entity(Core.CreateMesh(Entity.NullPointer));

Sorry, I don't know the VB equivalent to this.

 

Thanks! I didn't think that Casting the object would actually work, but I forgot they all inherit the Entity class... and thus never gave it a try.

 

I use this to convert all my code to C# and back for use on the forums.

CSharp to VB / VB to CSharp

 

VB equivilant

(I inserted a zero because the method takes an IntPtr):

Dim mesh As Mesh = DirectCast(New Entity(Core.CreateMesh(0)), Mesh)

Link to comment
Share on other sites

Thanks! I didn't think that Casting the object would actually work, but I forgot they all inherit the Entity class... and thus never gave it a try.

 

I use this to convert all my code to C# and back for use on the forums.

CSharp to VB / VB to CSharp

 

VB equivilant

(I inserted a zero because the method takes an IntPtr):

Dim mesh As Mesh = DirectCast(New Entity(Core.CreateMesh(0)), Mesh)

 

Entity.NullPointer is a redef for IntPtr.Zero.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...