Hey Leute,
Ich verzweifle gerade an der Funktion getCollisionResultPosition in ISceneCollisionManager.h :
Code:
//! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.
/** This can be used for moving a character in a 3d world: The
character will slide at walls and is able to walk up stairs.
The method used how to calculate the collision result position
is based on the paper "Improved Collision detection and
Response" by Kasper Fauerby.
\param selector: TriangleSelector containing the triangles of
the world. It can be created for example using
ISceneManager::createTriangleSelector() or
ISceneManager::createTriangleOctreeSelector().
\param ellipsoidPosition: Position of the ellipsoid.
\param ellipsoidRadius: Radius of the ellipsoid.
\param ellipsoidDirectionAndSpeed: Direction and speed of the
movement of the ellipsoid.
\param triout: Optional parameter where the last triangle
causing a collision is stored, if there is a collision.
\param hitPosition: Return value for the position of the collision
\param outFalling: Is set to true if the ellipsoid is falling
down, caused by gravity.
\param outNode: the node with which the ellipoid collided (if any)
\param slidingSpeed: DOCUMENTATION NEEDED.
\param gravityDirectionAndSpeed: Direction and force of gravity.
\return New position of the ellipsoid. */
virtual core::vector3df getCollisionResultPosition(
ITriangleSelector* selector,
const core::vector3df &ellipsoidPosition,
const core::vector3df& ellipsoidRadius,
const core::vector3df& ellipsoidDirectionAndSpeed,
core::triangle3df& triout,
core::vector3df& hitPosition,
bool& outFalling,
const ISceneNode*& outNode,
f32 slidingSpeed = 0.0005f,
const core::vector3df& gravityDirectionAndSpeed
= core::vector3df(0.0f, 0.0f, 0.0f)) = 0;
Der Compiler bringt keine Fehlermeldung, sondern das Programm stürzt einfach ab, sobald es zur gennanten Funktion kommt.
Hier wie ich sie eingesetzt habe:
Code:
triangle3df s;
vector3df d;
const ISceneNode *coll_node;
bool f;
vector3df sdf = collMan->getCollisionResultPosition(selector,node->getPosition(),vector3df(5,5,5),
vector3df(1,1,1),
s,
d,
f,
coll_node);
Bitte helft mir.