nah, spezifisch was willst du erreichen ( Collsionweise )? ich kann die nötigen funktionen auch schnell beschreiben . Siehe unten. Sollt mal Dinge bissl vereinfachen bis ich zum rest komm.
EDIT: ( working on... )
Mal etwas haesslich - aber imo hab ich nur zeit zwischen den reboots des servers an dem ich hier arbeite was zu hacken.
Code: Alles auswählen
NAME
IrrGetCollisionGroupFromComplexMesh() - creates a collision selector from a complex node like a map
SYNOPSIS
*Collision = IrrGetCollisionGroupFromComplexMesh( *BSPMesh, *BSPNode )
INPUTS
*BSPMesh - pointer to our MeshObject
*BSPNode - pointer to our Octree Scenenode
FUNCTION
Creates a Triangle Selector, optimized by an octtree.
Triangle selectors can be used for doing collision detection. This triangle selector is optimized for huge amounts of triangles, it
organizes them in an octtree.
EXAMPLE
*BSPMesh = IrrGetMesh( "media\map.dmf" ) ; This can be any Object or for example a precompiled Quake3 BSP Map
*BSPNode = IrrAddMeshToSceneAsOcttree( *BSPMesh ) ; We add the mesh as Octree, because a map usually has alots of Triangles.
; the first thing we need to do with collision is to create an object called a
; selector that contains a selection of triangle to be used in the collision
; calculations there are a number of different ways of doing this depending on
; the type of mesh you are working with. in this example we are using the
; complex BSP map and therefore should use the following command
*MapCollision = IrrGetCollisionGroupFromComplexMesh( *BSPMesh, *BSPNode )
; now we can add the sixth and final animator to our camera object, the collision
; animator...
; See Example 12 for action. ;) .
RESULT
Pointer to a Triangle-Selector
--
NAME
IrrGetCollisionGroupFromBox() - Creates a simple dynamic TriangleSelector, based on a axis aligned bounding box.
SYNOPSIS
*Collision = IrrGetCollisionGroupFromBox( *SceneNode )
INPUTS
*SceneNode - pointer to our SceneObject
FUNCTION
Creates a simple dynamic TriangleSelector, based on a axis aligned bounding box.
Triangle selectors can be used for doing collision detection. Every time when triangles are queried, the triangle selector gets the bounding box
of the scene node, and creates new triangles. In this way, it works fine with animated scene nodes.
EXAMPLE
RESULT
Pointer to a Triangle-Selector
--
NAME
IrrGetCollisionGroupFromTerrain() - Creates a triangle selector which can select triangles from a terrain scene node.
SYNOPSIS
*Collision = IrrGetCollisionGroupFromTerrain( *TerrainSceneNode, LevelOfDetail.l )
INPUTS
*TerrainSceneNode - pointer to our TerrainSceneNode
LevelOfDetail.l - Level of detail, 0 for highest detail.
FUNCTION
Creates a triangle selector which can select triangles from a terrain scene node.
EXAMPLE
RESULT
Pointer to a Triangle-Selector
--
NAME
IrrCreateCombinedCollisionGroup() - Creates a meta triangle selector.
SYNOPSIS
*CollisionGroup = IrrCreateCombinedCollisionGroup( )
INPUTS
- NONE
FUNCTION
A meta triangle selector is nothing more than a collection of one or more triangle selectors providing together the interface of one
triangle selector. In this way, collision tests can be done with different triangle groups in one pass.
EXAMPLE
; build collision information for the BSP map
*IrrMapSelector = IrrGetCollisionGroupFromComplexMesh( *IrrMesh, *IrrMap)
; creates a meta-selector that is a group of selector objects
Define *IrrCombinedCollision.irr_selector
*IrrCombinedCollision = IrrCreateCombinedCollisionGroup ()
Define *IrrTerrainCollision.irr_selector
*IrrTerrainCollision = IrrGetCollisionGroupFromTerrain ( *IrrTerrainNode, 1 )
; creates a meta-selector that is a group of selector objects
IrrAddCollisionGroupToCombination ( *IrrCombinedCollision, *IrrMapSelector )
IrrAddCollisionGroupToCombination ( *IrrCombinedCollision, *IrrTerrainCollision )
; add a collision animator to the camera that interacts with the map
; parameters define: camera radius, gravity and offset
*IrrCollisionAnimator = IrrAddCollisionAnimator( *IrrCombinedCollision, *IrrCameraNode, 30.0,30.0,30.0, 0.0,-3.0,0.0, 0.0,50.0,0.0 )
RESULT
Pointer to a MetaTriangle-Selector
--
NAME
IrrAddCollisionGroupToCombination() - Adds a triangle selector to the collection of triangle selectors in this metaTriangleSelector.
SYNOPSIS
IrrAddCollisionGroupToCombination( *CollisionGroup, *Collision )
INPUTS
*CollisionGroup - pointer to our meta triangle selector
*Collision - pointer to our Terrain, Mesh, Octree, Box , youNameit Triangle Selector.
FUNCTION
Adds a triangle selector to the collection of triangle selectors in this metaTriangleSelector.
a metaTriangleSelector is basically a Group of selectors packed together. Useful to for example check
a collision with a Terrain and an MeshObject in a single Pass.
EXAMPLE
; build collision information for the BSP map
*IrrMapSelector = IrrGetCollisionGroupFromComplexMesh( *IrrMesh, *IrrMap)
; creates a meta-selector that is a group of selector objects
Define *IrrCombinedCollision.irr_selector
*IrrCombinedCollision = IrrCreateCombinedCollisionGroup ()
Define *IrrTerrainCollision.irr_selector
*IrrTerrainCollision = IrrGetCollisionGroupFromTerrain ( *IrrTerrainNode, 1 )
; creates a meta-selector that is a group of selector objects
IrrAddCollisionGroupToCombination ( *IrrCombinedCollision, *IrrMapSelector )
IrrAddCollisionGroupToCombination ( *IrrCombinedCollision, *IrrTerrainCollision )
; add a collision animator to the camera that interacts with the map
; parameters define: camera radius, gravity and offset
*IrrCollisionAnimator = IrrAddCollisionAnimator( *IrrCombinedCollision, *IrrCameraNode, 30.0,30.0,30.0, 0.0,-3.0,0.0, 0.0,50.0,0.0 )
RESULT
NONE
--
NAME
IrrRemoveAllCollisionGroupsFromCombination() - Removes all triangle selectors from the collection.
SYNOPSIS
IrrRemoveAllCollisionGroupsFromCombination( *CollisionGroup )
INPUTS
*CollisionGroup - pointer to a meta triangle selector
FUNCTION
Removes all triangle selectors from the collection.
a metaTriangleSelector is basically a Group of selectors packed together. Useful to for example check
a collision with a Terrain and an MeshObject in a single Pass.
EXAMPLE
RESULT
NONE
--
NAME
IrrRemoveCollisionGroupFromCombination() - Removes all triangle selectors from the collection.
SYNOPSIS
IrrRemoveCollisionGroupFromCombination( *CollisionGroup, *Collision )
INPUTS
*CollisionGroup - pointer to a meta triangle selector
*Collision - pointer to our Terrain, Mesh, Octree, Box , youNameit Triangle Selector.
FUNCTION
Removes a specific triangle selector which was added before from the collection.
a metaTriangleSelector is basically a Group of selectors packed together. Useful to for example check
a collision with a Terrain and an MeshObject in a single Pass.
EXAMPLE
RESULT
NONE
--
Thalius