Rekindled Phoenix Posted December 14, 2009 Share Posted December 14, 2009 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. Quote Link to comment Share on other sites More sharing options...
L B Posted December 14, 2009 Share Posted December 14, 2009 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. Quote Link to comment Share on other sites More sharing options...
Rekindled Phoenix Posted December 15, 2009 Author Share Posted December 15, 2009 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) Quote Link to comment Share on other sites More sharing options...
L B Posted December 15, 2009 Share Posted December 15, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.