Jump to content

Recommended Posts

Posted

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.

Posted

This is honestly a mistake from my part, thanks for pointing it out.

Until I update it on the website, you can use

 

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

 

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

Posted

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)

Posted

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.

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.

×
×
  • Create New...