Function _IrrGetCollisionGroupFromComplexMesh

au3Irr2

au3Irr2 Function Reference

_IrrGetCollisionGroupFromComplexMesh

Creates an optimized triangle selection group from a large complex mesh like a map.

#Include <au3Irrlicht2.au3>
_IrrGetCollisionGroupFromComplexMesh($h_Mesh, $h_Node, $i_Frame = 0)

 

Parameters

$h_Mesh Handle of mesh the node was created from.
$h_Node Handle of the node to create a selector from.
$i_Frame [optional] Number of mesh frame to use.

 

Return Value

success: Handle to a selector object
failure: False

 

Remarks

The returned triangle selection group can then be used in collision functions to collide objects against this node.

 

Related

_IrrGetCollisionGroupFromMesh, _IrrGetCollisionGroupFromBox, _IrrGetCollisionGroupFromTerrain, _IrrRemoveCollisionGroup, _IrrCreateCombinedCollisionGroup

 

Example


#include "au3Irrlicht2.au3"

_IrrStart()

_IrrAddZipFile( "./media/map-20kdm2.pk3", $IRR_IGNORE_CASE, $IRR_IGNORE_PATHS )
$meshBSP = _IrrGetMesh( "20kdm2.bsp" )
local $nodeBSP = _IrrAddMeshToSceneAsOcttree( $meshBSP )

local $nodeCamera = _IrrAddFPSCamera()
_IrrSetNodePosition( $nodeCamera, 1750, 149, 1369 )

local $selectorMap = _IrrGetCollisionGroupFromComplexMesh( $meshBSP, $nodeBSP )
local $animator = _IrrAddCollisionAnimator($selectorMap, $nodeCamera, _
                         30.0,30.0,30.0,   0.0,-9.8,0.0,   0.0,50.0,0.0 )

WHILE _IrrRunning()
    _IrrBeginScene(50, 50, 50)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()