I'm not sure how this can be implemented in irrlicht. I would like to get a basic character which can move and collide with the environment. I know there's an elementary setposition function and theoretically, any type of movement or collision system can be written based off that, but I'm curious about how to use irrlicht's built-in animators to do the job.
In the examples I've seen, the collisionResponseAnimator is only applied to the fps camera which moves automatically based on user input. the flyStraightAnimator is only used for a mesh which doesn't seem to really interact or collide with the environment. using setposition, in conjunction with an animator seems counterproductive as one will probably override or overwrite the other. what I'm looking for is the common sense way of having a moving object which is influenced by gravity and collides with the environment. is it possible to use a collisionResponseAnimator along with a flyStraightAnimator for this? how can this be done?
entity movement + collision
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
I probably will end up using the collision response animator, the question is how do I then move the mesh? from what I've seen, there isn't a general 'move' function which will work in conjunction with the collision response animator. the only facilities for moving a mesh is setposition() and flyStraightAnimator. I dont think either of these are designed to work in conjunction with the collision response animator. correct me if I'm wrong about any of this...
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
u are wrong because these 2 work with the collistion animator so the collistion animator will work with setpostion and with flyscene animatorSean H. wrote:I probably will end up using the collision response animator, the question is how do I then move the mesh? from what I've seen, there isn't a general 'move' function which will work in conjunction with the collision response animator. the only facilities for moving a mesh is setposition() and flyStraightAnimator. I dont think either of these are designed to work in conjunction with the collision response animator. correct me if I'm wrong about any of this...
Ok. Just so I can be sure Im understanding this correctly, let's say I have an airplane. I give the airplane a flyStraightAnimator, and a collisionResponseAnimator. I set the flyStraightAnimator so that it flies from point A to point B high up in the air. Will the collisionResponseAnimator make the plane fall due to gravity such that it ends up flying to a point below point B?
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
yes but u can disable gravity and if the point b is on the ground so the gravity will not affectSean H. wrote:Ok. Just so I can be sure Im understanding this correctly, let's say I have an airplane. I give the airplane a flyStraightAnimator, and a collisionResponseAnimator. I set the flyStraightAnimator so that it flies from point A to point B high up in the air. Will the collisionResponseAnimator make the plane fall due to gravity such that it ends up flying to a point below point B?
Ok after searching the forums and looking through the API a bit, I came across another function:
irr::scene::ISceneCollisionManager::getCollisionResultPosition ()
this function seems perfect for what I need; sliding collision under the influence of gravity and an intial impulse. Ive read in as few threads that people have trouble with terrain collision on inclines using the regular collision animator. is using this function any different from or better than using the regular collisionResponseAnimator? any kind feedback would be appreciated.
irr::scene::ISceneCollisionManager::getCollisionResultPosition ()
this function seems perfect for what I need; sliding collision under the influence of gravity and an intial impulse. Ive read in as few threads that people have trouble with terrain collision on inclines using the regular collision animator. is using this function any different from or better than using the regular collisionResponseAnimator? any kind feedback would be appreciated.
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact: