Tip for VB.NET Irrlicht Developers

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
Ash Moollan

Tip for VB.NET Irrlicht Developers

Post by Ash Moollan »

Hi Fellow VB Developers!

Operator Overloading isn't supported in VB, so stuff like

Dim v1 As Vector3D
Dim v2 As Vector3D
Dim v3 As Vector3D = v1 - v2 ' this wont work!

The minus operator is defined in the Irrlicht.NET assembly as

Public Static Vector3D Operator -(Vector3D o1, Vectr3D ) {...}

And because Operator Overloading isnt CLS-Compliant per se, you cannot call that from a .NET language that does not support it (e.g. VB.NET)

However, by default, when the c# is compiled, the compiler by will add special methods for the overloaded operators
op_Addition()
op_Substraction() etc

so we should be doing something like
VB:
Dim v1 As Vector3D
Dim v2 As Vector3D
Dim v3 As Vector3D = Vector3D.op_Substractio(v1, v2)

While this *should* work, by default it doesn't, even though these methods are added (and documented in IrrLicht .NET CHM documentation) these methods do not come up in VB.

Here's the Tip:
Click on Tools>Options (Inside Visual Studio)
Text Editor>Basic
and UnCheck "Hide advanced members"

and that should do the trick!

Cheers
Ash Moollan
Blog: www.moollan.net
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Hey nice tip bro! But as i am an old programmer of vb6 i always create a helper module in which these kind of stuff could be done like add, subtract or multiply matrices or vectors!
Locked