SetTriangleSelector in .NET?

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.
dp

SetTriangleSelector in .NET?

Post by dp »

hi, i noticed that the SetTriangleSelector method or TriangleSelector property of the node class is not there in the .net wrapper version.

is it somewhere else? am i missing it? i believe it is required in order to do basic collision detection, correct?

thanks
instruo

Post by instruo »

Was just about to post about the very same thing... hopefully someone can give us an answer :)
HantaCore

Post by HantaCore »

Maybe a stupid question, anyway, here I go:

is it just a strange beahviour of IntelliSense, or are some elements of the GUI just "not implemented yet" in the .NET wrapper?

especially thinking about tabcontrols i.e.

thanks for any answer
HantaCore

Post by HantaCore »

Ooops,

I had two tabs opened, and answered in the bad one.

I also wanted to know if SetTriangleSelector was wrapped ni Irrlicht.NET at all ^^

if not, i'll have to modify the wrapper by myself 'sigh'

oh, and btw, nice job, Nikolaus, this engine is absolutely great!

sorry for the inconvenience
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

I am about to upload one application made using vb.net that shows the usage of several functions in vb.net! But for now this is going to help:

Code: Select all

    Dim BSP As Irrlicht.Scene.IAnimatedMesh
    Dim Node As Irrlicht.Scene.ISceneNode
    Public Selector As Irrlicht.Scene.ITriangleSelector
    Dim ColAnim As Irrlicht.Scene.ISceneNodeAnimator

    Public Sub LoadPK3(ByVal FilePath As String, ByVal BSPFile As String)
        Device.FileSystem.AddZipFileArchive(FilePath)

        BSP = Device.SceneManager.GetMesh(BSPFile)
        If Not BSP Is Nothing Then
            Node = Device.SceneManager.AddOctTreeSceneNode(BSP, Nothing, -1, 128)
        End If
    End Sub

    Public Sub SetCollision(ByVal SphereRadiusX As Single, ByVal SphereRadiusY As Single, ByVal SphereRadiusZ As Single, ByVal Gravity As Single)
        If Not Node Is Nothing Then
            Selector = Device.SceneManager.CreateOctTreeTriangleSelector(BSP.GetMesh(0), Node, 128)
        End If

        ColAnim = Device.SceneManager.CreateCollisionResponseAnimator(Selector, Cam, _
         New Vector3D(SphereRadiusX, SphereRadiusY, SphereRadiusZ), _
         New Vector3D(0, Gravity, 0), _
         New Vector3D(0, 50, 0), _
         0.0005F)

        If ColAnim Is Nothing Then
            MsgBox("Error creating collision manager! Did you setup the camera after loading the map?")
            Return
        End If

        Cam.AddAnimator(ColAnim)
        ColAnim = Nothing
    End Sub
cam is the camera! I hope this was helpful!
HantaCore

Post by HantaCore »

I will give it a try, after translating it in C# :p

anyway I'll have to modify the wrapper, what will be 'easy' now that I finally could compile it :)

thank you for your help

also a great thank to the guy that noticed that the .sln was in 0.12 version, that was a worry! :D
HantaCore

Post by HantaCore »

Ok, so far I recompiled my modified wrapper, to which I added support for the TabControl and the TriangleSelector

TabControl works ok, but I couldn't do extensive tests on triangle selectors, since I could not (at least in my project) build a correct line for the intersection so far (but hey, I could only code & compile it yesterday 11pm, so please be patient)

Is anyone interested in the code?

I'm also working on a port of the grass node to c# .NET, cause I need it in my c# project, more info soon :mrgreen:
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Very interesting! I liked the grass node! It would be cool to see it in .net!
HantaCore
Posts: 21
Joined: Wed Mar 22, 2006 4:38 pm

Post by HantaCore »

First problem encountered: the grass node uses the IImage, which is not included in the standard version of Irrlicht.NET

I'm currently adding the class before continuing :roll:

Stay tuned!
Currently working on a C# MMORPG using Irrlicht.NET
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Why dont u make a thread on that as soon as you make the first workable edition! You will get a good response then!
HantaCore
Posts: 21
Joined: Wed Mar 22, 2006 4:38 pm

Post by HantaCore »

Yep i'll try and do that

see you soon
Currently working on a C# MMORPG using Irrlicht.NET
HantaCore
Posts: 21
Joined: Wed Mar 22, 2006 4:38 pm

Post by HantaCore »

ok, here I am so far:

- could modify Irrlicht.NET to add the TriangleSelector
- could get an instance of the triangle selector
- still could not get an intersection point...

I'm now struggling with the getTriangles method, since the first parameter seems to be an array, but is referenced as a triangle3df* pointer, and I don't really know how to translate that into .NET, but with an Array... which I would fill within this method, and return as an out param, or even just an array param...

has anyone already tried that? also, I'm suprised in my client App to have my getCollisionPoint always returning false, but I guess it's due to my bad implementation of getTriangles...
Currently working on a C# MMORPG using Irrlicht.NET
RapchikProgrammer
Posts: 279
Joined: Fri Dec 24, 2004 6:37 pm

Post by RapchikProgrammer »

Hey its nice to see progress with your work! And by the way how do you modify for irrlicht.net! I went into the source folder and in the irrlicht folder there is a project file of irrlicht but in the irrlicht.net there is no project file for it? How are you modifying it?
HantaCore
Posts: 21
Joined: Wed Mar 22, 2006 4:38 pm

Post by HantaCore »

actually I used the project file in Irrlicht.NET 0.12 and added the files found in the 0.14 archive. The problem is that the source files don't implement all functionnalities (i recently found out that the DLL version implemented AddParticlSceneNode, whereas the sources don't... Niko? :p )
Currently working on a C# MMORPG using Irrlicht.NET
Guest

Post by Guest »

The complete 0.14 inluding the project files can be pulled from the source repository on sourceforge.
Locked