From 959831f4ef5a3e797f576c3de08cd65032c997ad Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 13 Jan 2013 18:54:10 +1000 Subject: Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard. --- .../examples/07.Collision/tutorial.html | 616 ++++++++++----------- 1 file changed, 308 insertions(+), 308 deletions(-) (limited to 'libraries/irrlicht-1.8/examples/07.Collision/tutorial.html') diff --git a/libraries/irrlicht-1.8/examples/07.Collision/tutorial.html b/libraries/irrlicht-1.8/examples/07.Collision/tutorial.html index c04fce9..7ea292c 100644 --- a/libraries/irrlicht-1.8/examples/07.Collision/tutorial.html +++ b/libraries/irrlicht-1.8/examples/07.Collision/tutorial.html @@ -1,308 +1,308 @@ - -
-
- Lets start! |
- ||||||||
-
-
-
- To start, we take the program from tutorial 2, which loaded and displayed - a quake 3 level. We will use the level to walk in it and to pick triangles - from it. In addition we'll place 3 animated models into it for scene - node picking. The following code starts up the engine and loads a - quake 3 level. I will not explain it, because it should already be - known from tutorial 2. -
So far so good, we've loaded the quake 3 level like in tutorial
- 2. Now, here comes something different: We create a triangle selector.
- A triangle selector is a class which can fetch the triangles from
- scene nodes for doing different things with them, for example collision
- detection. There are different triangle selectors, and all can be
- created with the ISceneManager. In this example, we create an OctTreeTriangleSelector,
- which optimizes the triangle output a little bit by reducing it like
- an octree. This is very useful for huge meshes like quake 3 levels.
We add a first person shooter camera to the scene for being able
- to move in the quake 3 level like in tutorial 2. But this, time, we
- add a special animator to the camera: A Collision Response animator.
- This thing modifies the scene node to which it is attached to in that
- way, that it may no more move through walls and is affected by gravity.
- The only thing we have to tell the animator is how the world looks
- like, how big the scene node is, how gravity and so on. After the
- collision response animator is attached to the camera, we do not have
- to do anything more for collision detection, anything is done automaticly,
- all other collision detection code below is for picking. And please
- note another cool feature: The collsion response animator can be attached
- also to all other scene nodes, not only to cameras. And it can be
- mixed with other scene node animators. In this way, collision detection
- and response in the Irrlicht
Because collision detection is no big deal in irrlicht, I'll describe
- how to do two different types of picking in the next section. But
- before this, I'll prepare the scene a little. I need three animated
- characters which we
For not making it to complicated, I'm doing picking inside the drawing - loop. We take two pointers for storing the current and the last selected - scene node and start the loop. -
After we've drawn the whole scene whit smgr->drawAll(), we'll do - the first picking: We want to know which triangle of the world we are - looking at. In addition, we want the exact point of the quake 3 level - we are looking at. For this, we create a 3d line starting at the position - of the camera and going through the lookAt-target of it. Then we ask - the collision manager if this line collides with a triangle of the world - stored in the triangle selector. If yes, we draw the 3d triangle and - set the position of the billboard to the intersection point. -
Another type of picking supported by the Irrlicht Engine is scene
- node picking based on bouding boxes. Every scene node has got a bounding
- box, and because of that, it's very fast for example to get the scene
- node which the camera looks
That's it, we just have to finish drawing. -
- - |
-
- - + + +
+ Lets start! |
+ ||||||||
+
+
+
+ To start, we take the program from tutorial 2, which loaded and displayed + a quake 3 level. We will use the level to walk in it and to pick triangles + from it. In addition we'll place 3 animated models into it for scene + node picking. The following code starts up the engine and loads a + quake 3 level. I will not explain it, because it should already be + known from tutorial 2. +
So far so good, we've loaded the quake 3 level like in tutorial
+ 2. Now, here comes something different: We create a triangle selector.
+ A triangle selector is a class which can fetch the triangles from
+ scene nodes for doing different things with them, for example collision
+ detection. There are different triangle selectors, and all can be
+ created with the ISceneManager. In this example, we create an OctTreeTriangleSelector,
+ which optimizes the triangle output a little bit by reducing it like
+ an octree. This is very useful for huge meshes like quake 3 levels.
We add a first person shooter camera to the scene for being able
+ to move in the quake 3 level like in tutorial 2. But this, time, we
+ add a special animator to the camera: A Collision Response animator.
+ This thing modifies the scene node to which it is attached to in that
+ way, that it may no more move through walls and is affected by gravity.
+ The only thing we have to tell the animator is how the world looks
+ like, how big the scene node is, how gravity and so on. After the
+ collision response animator is attached to the camera, we do not have
+ to do anything more for collision detection, anything is done automaticly,
+ all other collision detection code below is for picking. And please
+ note another cool feature: The collsion response animator can be attached
+ also to all other scene nodes, not only to cameras. And it can be
+ mixed with other scene node animators. In this way, collision detection
+ and response in the Irrlicht
Because collision detection is no big deal in irrlicht, I'll describe
+ how to do two different types of picking in the next section. But
+ before this, I'll prepare the scene a little. I need three animated
+ characters which we
For not making it to complicated, I'm doing picking inside the drawing + loop. We take two pointers for storing the current and the last selected + scene node and start the loop. +
After we've drawn the whole scene whit smgr->drawAll(), we'll do + the first picking: We want to know which triangle of the world we are + looking at. In addition, we want the exact point of the quake 3 level + we are looking at. For this, we create a 3d line starting at the position + of the camera and going through the lookAt-target of it. Then we ask + the collision manager if this line collides with a triangle of the world + stored in the triangle selector. If yes, we draw the 3d triangle and + set the position of the billboard to the intersection point. +
Another type of picking supported by the Irrlicht Engine is scene
+ node picking based on bouding boxes. Every scene node has got a bounding
+ box, and because of that, it's very fast for example to get the scene
+ node which the camera looks
That's it, we just have to finish drawing. +
+ + |
+
+ + -- cgit v1.1