What is the proper way to load .OBJ files for use with a selector?
>> Opening Network Port for clients...
>> Server started...
>> Public Sub StartListener()
Could not load mesh, because file could not be opened: : E:\Program Files\Microsoft Visual Studio 10
.0\My Documents\Projects\DUST\DustServer\Bin\Release\Bin\Release\Bin\maps\Landscape1.obj
>> SentPings
(VB.NET 2010 code)
Code: Select all
Public Sub LoadMap(ByRef MapName As String, ByRef q3node As MeshSceneNode, ByRef Camera As CameraSceneNode, ByRef device As IrrlichtDevice, ByRef anim As SceneNodeAnimator, ByRef q3LevelMesh As AnimatedMesh, ByRef selector As TriangleSelector)
Dim x As Integer
x = 0
Dim driver As VideoDriver = device.VideoDriver
Dim smgr As SceneManager = device.SceneManager
smgr.MeshCache.Clear()
Debug.Print("LOADING CUSTOM MAP=============")
smgr.AddToDeletionQueue(q3node)
Debug.Print("LOADING CUSTOM MAP")
q3LevelMesh = smgr.GetMesh(MyPath + "\Bin\Release\Bin\maps\" + MapName + ".obj")
q3node = Nothing
If q3LevelMesh IsNot Nothing Then
Application.DoEvents()
'/ old BSP q3node = smgr.AddOctreeSceneNode(q3LevelMesh.GetMesh(0), Nothing, 1)
q3node = smgr.AddMeshSceneNode(q3LevelMesh.GetMesh(0), Nothing, 1)
End If
If q3node IsNot Nothing Then
q3node.Position = New Vector3Df(0, 0, 0)
selector = smgr.CreateOctreeTriangleSelector(q3node.Mesh, q3node, 128)
q3node.TriangleSelector = selector
End If
Camera.Position = New Vector3Df(0, -15000, 0)
Camera.FarValue = 6000
Camera.RemoveAnimator(anim)
If selector IsNot Nothing Then
svEntityClass.BulletSelector = selector
anim = smgr.CreateCollisionResponseAnimator(selector, Camera, New Vector3Df(30, 50, 30), New Vector3Df(0, -10, 0), New Vector3Df(0, 30, 0), 0.0F)
Camera.AddAnimator(anim)
anim.Drop() '
MyMap = MapName
ChangeServerMap(MapName)
End Sub