Loading...
Searching...
No Matches
Tutorial 7: Collision

We will describe 2 methods: Automatic collision detection for moving through 3d worlds with stair climbing and sliding, and manual scene node and triangle picking using a ray. In this case, we will use a ray coming out from the camera, but you can use any ray.

To start, we take the program from tutorial 2, which loads and displays a quake 3 level. We will use the level to walk in it and to pick triangles from. In addition we'll place 3 animated models into it for triangle picking. The following code starts up the engine and loads the level, as per tutorial 2.

#include <irrlicht.h>
#include "driverChoice.h"
using namespace irr;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif
enum
{
// I use this ISceneNode ID to indicate a scene node that is
// not pickable by getSceneNodeAndCollisionPointFromRay()
ID_IsNotPickable = 0,
// I use this flag in ISceneNode IDs to indicate that the
// scene node can be picked by ray selection.
IDFlag_IsPickable = 1 << 0,
// I use this flag in ISceneNode IDs to indicate that the
// scene node can be highlighted. In this example, the
// homonids can be highlighted, but the level mesh can't.
IDFlag_IsHighlightable = 1 << 1
};
int main()
{
// ask user for driver
video::E_DRIVER_TYPE driverType=driverChoiceConsole();
if (driverType==video::EDT_COUNT)
return 1;
// create device
IrrlichtDevice *device =
createDevice(driverType, core::dimension2d<u32>(640, 480), 16, false);
if (device == 0)
return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addFileArchive("../../media/map-20kdm2.pk3");
scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp");
scene::IMeshSceneNode* q3node = 0;
// The Quake mesh is pickable, but doesn't get highlighted.
if (q3levelmesh)
q3node = smgr->addOctreeSceneNode(q3levelmesh->getMesh(0), 0, IDFlag_IsPickable);
irr::IrrlichtDevice
The Irrlicht device. You can create it with createDevice() or createDeviceEx().
Definition IrrlichtDevice.h:44
irr::IrrlichtDevice::getSceneManager
virtual scene::ISceneManager * getSceneManager()=0
Provides access to the scene manager.
irr::IrrlichtDevice::getVideoDriver
virtual video::IVideoDriver * getVideoDriver()=0
Provides access to the video driver for drawing 3d and 2d geometry.
irr::IrrlichtDevice::getFileSystem
virtual io::IFileSystem * getFileSystem()=0
Provides access to the virtual file system.
irr::core::dimension2d
Specifies a 2 dimensional size.
Definition dimension2d.h:21
irr::io::IFileSystem::addFileArchive
virtual bool addFileArchive(const path &filename, bool ignoreCase=true, bool ignorePaths=true, E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN, const core::stringc &password="", IFileArchive **retArchive=0)=0
Adds an archive to the file system.
irr::scene::IAnimatedMesh
Interface for an animated mesh.
Definition IAnimatedMesh.h:63
irr::scene::IAnimatedMesh::getMesh
virtual IMesh * getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1)=0
Returns the IMesh interface for a frame.
irr::scene::IMeshSceneNode
A scene node displaying a static mesh.
Definition IMeshSceneNode.h:21
irr::scene::ISceneManager
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
Definition ISceneManager.h:151
irr::scene::ISceneManager::getMesh
virtual IAnimatedMesh * getMesh(const io::path &filename)=0
Get pointer to an animateable mesh. Loads the file if not loaded already.
irr::scene::ISceneManager::addOctreeSceneNode
virtual IMeshSceneNode * addOctreeSceneNode(IAnimatedMesh *mesh, ISceneNode *parent=0, s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false)=0
Adds a scene node for rendering using a octree to the scene graph.
irr::video::IVideoDriver
Interface to driver which is able to perform 2d and 3d graphics functions.
Definition IVideoDriver.h:257
driverChoice.h
irrlicht.h
Main header file of the irrlicht, the only file needed to include.
irr::video::E_DRIVER_TYPE
E_DRIVER_TYPE
An enum for all types of drivers the Irrlicht Engine supports.
Definition EDriverTypes.h:15
irr::video::EDT_COUNT
@ EDT_COUNT
No driver, just for counting the elements.
Definition EDriverTypes.h:56
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::createDevice
IRRLICHT_API IrrlichtDevice *IRRCALLCONV createDevice(video::E_DRIVER_TYPE deviceType=video::EDT_SOFTWARE, const core::dimension2d< u32 > &windowSize=(core::dimension2d< u32 >(640, 480)), u32 bits=16, bool fullscreen=false, bool stencilbuffer=false, bool vsync=false, IEventReceiver *receiver=0)
Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.

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 OctreeTriangleSelector, 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. After we created the triangle selector, we attach it to the q3node. This is not necessary, but in this way, we do not need to care for the selector, for example dropping it after we do not need it anymore.

scene::ITriangleSelector* selector = 0;
if (q3node)
{
q3node->setPosition(core::vector3df(-1350,-130,-1400));
selector = smgr->createOctreeTriangleSelector(
q3node->getMesh(), q3node, 128);
q3node->setTriangleSelector(selector);
// We're not done with this selector yet, so don't drop it.
}
irr::scene::IMeshSceneNode::getMesh
virtual IMesh * getMesh(void)=0
Get the currently defined mesh for display.
irr::scene::ISceneManager::createOctreeTriangleSelector
virtual ITriangleSelector * createOctreeTriangleSelector(IMesh *mesh, ISceneNode *node, s32 minimalPolysPerNode=32)=0
Creates a Triangle Selector, optimized by an octree.
irr::scene::ISceneNode::setPosition
virtual void setPosition(const core::vector3df &newpos)
Sets the position of the node relative to its parent.
Definition ISceneNode.h:507
irr::scene::ISceneNode::setTriangleSelector
virtual void setTriangleSelector(ITriangleSelector *selector)
Sets the triangle selector of the scene node.
Definition ISceneNode.h:635
irr::scene::ITriangleSelector
Interface to return triangles with specific properties.
Definition ITriangleSelector.h:29
irr::core::vector3df
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445

We add a first person shooter camera to the scene so that we can see and 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 animator modifies the scene node to which it is attached to in order to prevent it moving through walls, and to add gravity to it. The only thing we have to tell the animator is how the world looks like, how big the scene node is, how much gravity to apply 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 automatically. The rest of the collision detection code below is for picking. And please note another cool feature: The collision 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 engine is really easy.

Now we'll take a closer look on the parameters of createCollisionResponseAnimator(). The first parameter is the TriangleSelector, which specifies how the world, against collision detection is done looks like. The second parameter is the scene node, which is the object, which is affected by collision detection, in our case it is the camera. The third defines how big the object is, it is the radius of an ellipsoid. Try it out and change the radius to smaller values, the camera will be able to move closer to walls after this. The next parameter is the direction and speed of gravity. We'll set it to (0, -10, 0), which approximates to realistic gravity, assuming that our units are metres. You could set it to (0,0,0) to disable gravity. And the last value is just a translation: Without this, the ellipsoid with which collision detection is done would be around the camera, and the camera would be in the middle of the ellipsoid. But as human beings, we are used to have our eyes on top of the body, with which we collide with our world, not in the middle of it. So we place the scene node 50 units over the center of the ellipsoid with this parameter. And that's it, collision detection works now.

// Set a jump speed of 3 units per second, which gives a fairly realistic jump
// when used with the gravity of (0, -10, 0) in the collision response animator.
scene::ICameraSceneNode* camera =
smgr->addCameraSceneNodeFPS(0, 100.0f, .3f, ID_IsNotPickable, 0, 0, true, 3.f);
camera->setPosition(core::vector3df(50,50,-60));
camera->setTarget(core::vector3df(-70,30,-60));
if (selector)
{
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-10,0), core::vector3df(0,30,0));
selector->drop(); // As soon as we're done with the selector, drop it.
camera->addAnimator(anim);
anim->drop(); // And likewise, drop the animator when we're done referring to it.
}
// Now I create three animated characters which we can pick, a dynamic light for
// lighting them, and a billboard for drawing where we found an intersection.
// First, let's get rid of the mouse cursor. We'll use a billboard to show
// what we're looking at.
device->getCursorControl()->setVisible(false);
// Add the billboard.
scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode();
bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
bill->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
bill->setMaterialFlag(video::EMF_LIGHTING, false);
bill->setMaterialFlag(video::EMF_ZBUFFER, false);
bill->setSize(core::dimension2d<f32>(20.0f, 20.0f));
bill->setID(ID_IsNotPickable); // This ensures that we don't accidentally ray-pick it
irr::IReferenceCounted::drop
bool drop() const
Drops the object. Decrements the reference counter by one.
Definition IReferenceCounted.h:116
irr::IrrlichtDevice::getCursorControl
virtual gui::ICursorControl * getCursorControl()=0
Provides access to the cursor control.
irr::gui::ICursorControl::setVisible
virtual void setVisible(bool visible)=0
Changes the visible state of the mouse cursor.
irr::scene::IBillboardSceneNode
A billboard scene node.
Definition IBillboardSceneNode.h:21
irr::scene::IBillboardSceneNode::setSize
virtual void setSize(const core::dimension2d< f32 > &size)=0
Sets the size of the billboard, making it rectangular.
irr::scene::ICameraSceneNode
Scene Node which is a (controlable) camera.
Definition ICameraSceneNode.h:24
irr::scene::ICameraSceneNode::setTarget
virtual void setTarget(const core::vector3df &pos)=0
Sets the look at target of the camera.
irr::scene::ISceneManager::createCollisionResponseAnimator
virtual ISceneNodeAnimatorCollisionResponse * createCollisionResponseAnimator(ITriangleSelector *world, ISceneNode *sceneNode, const core::vector3df &ellipsoidRadius=core::vector3df(30, 60, 30), const core::vector3df &gravityPerSecond=core::vector3df(0,-10.0f, 0), const core::vector3df &ellipsoidTranslation=core::vector3df(0, 0, 0), f32 slidingValue=0.0005f)=0
Creates a special scene node animator for doing automatic collision detection and response.
irr::scene::ISceneManager::addCameraSceneNodeFPS
virtual ICameraSceneNode * addCameraSceneNodeFPS(ISceneNode *parent=0, f32 rotateSpeed=100.0f, f32 moveSpeed=0.5f, s32 id=-1, SKeyMap *keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false, f32 jumpSpeed=0.f, bool invertMouse=false, bool makeActive=true)=0
Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for f...
irr::scene::ISceneManager::addBillboardSceneNode
virtual IBillboardSceneNode * addBillboardSceneNode(ISceneNode *parent=0, const core::dimension2d< f32 > &size=core::dimension2d< f32 >(10.0f, 10.0f), const core::vector3df &position=core::vector3df(0, 0, 0), s32 id=-1, video::SColor colorTop=0xFFFFFFFF, video::SColor colorBottom=0xFFFFFFFF)=0
Adds a billboard scene node to the scene graph.
irr::scene::ISceneNodeAnimator
Animates a scene node. Can animate position, rotation, material, and so on.
Definition ISceneNodeAnimator.h:31
irr::scene::ISceneNode::setMaterialTexture
void setMaterialTexture(u32 textureLayer, video::ITexture *texture)
Sets the texture of the specified layer in all materials of this scene node to the new texture.
Definition ISceneNode.h:436
irr::scene::ISceneNode::addAnimator
virtual void addAnimator(ISceneNodeAnimator *animator)
Adds an animator which should animate this node.
Definition ISceneNode.h:348
irr::scene::ISceneNode::setMaterialFlag
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
Sets all material flags at once to a new value.
Definition ISceneNode.h:425
irr::scene::ISceneNode::setMaterialType
void setMaterialType(video::E_MATERIAL_TYPE newType)
Sets the material type of all materials in this scene node to a new material type.
Definition ISceneNode.h:448
irr::scene::ISceneNode::setID
virtual void setID(s32 id)
Sets the id of the scene node.
Definition ISceneNode.h:270
irr::video::IVideoDriver::getTexture
virtual ITexture * getTexture(const io::path &filename)=0
Get access to a named texture.
irr::video::EMF_ZBUFFER
@ EMF_ZBUFFER
Is the ZBuffer enabled? Default: true.
Definition EMaterialFlags.h:29
irr::video::EMF_LIGHTING
@ EMF_LIGHTING
Will this material be lighted? Default: true.
Definition EMaterialFlags.h:26
irr::video::EMT_TRANSPARENT_ADD_COLOR
@ EMT_TRANSPARENT_ADD_COLOR
A transparent material.
Definition EMaterialTypes.h:88

Add 3 animated hominids, which we can pick using a ray-triangle intersection. They all animate quite slowly, to make it easier to see that accurate triangle selection is being performed.

scene::IAnimatedMeshSceneNode* node = 0;
video::SMaterial material;
// Add an MD2 node, which uses vertex-based animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/faerie.md2"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setPosition(core::vector3df(-90,-15,-140)); // Put its feet on the floor.
node->setScale(core::vector3df(1.6f)); // Make it appear realistically scaled
node->setMD2Animation(scene::EMAT_POINT);
node->setAnimationSpeed(20.f);
material.setTexture(0, driver->getTexture("../../media/faerie2.bmp"));
material.Lighting = true;
material.NormalizeNormals = true;
node->getMaterial(0) = material;
// Now create a triangle selector for it. The selector will know that it
// is associated with an animated node, and will update itself as necessary.
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop(); // We're done with this selector, so drop it now.
// And this B3D file uses skinned skeletal animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/ninja.b3d"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setScale(core::vector3df(10));
node->setPosition(core::vector3df(-75,-66,-80));
node->setRotation(core::vector3df(0,90,0));
node->setAnimationSpeed(8.f);
node->getMaterial(0).NormalizeNormals = true;
node->getMaterial(0).Lighting = true;
// Just do the same as we did above.
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
// This X files uses skeletal animation, but without skinning.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/dwarf.x"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setPosition(core::vector3df(-70,-66,-30)); // Put its feet on the floor.
node->setRotation(core::vector3df(0,-90,0)); // And turn it towards the camera.
node->setAnimationSpeed(20.f);
node->getMaterial(0).Lighting = true;
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
// And this mdl file uses skinned skeletal animation.
node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../../media/yodan.mdl"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setPosition(core::vector3df(-90,-25,20));
node->setScale(core::vector3df(0.8f));
node->getMaterial(0).Lighting = true;
node->setAnimationSpeed(20.f);
// Just do the same as we did above.
selector = smgr->createTriangleSelector(node);
node->setTriangleSelector(selector);
selector->drop();
material.setTexture(0, 0);
material.Lighting = false;
// Add a light, so that the unselected nodes aren't completely dark.
scene::ILightSceneNode * light = smgr->addLightSceneNode(0, core::vector3df(-60,100,400),
video::SColorf(1.0f,1.0f,1.0f,1.0f), 600.0f);
light->setID(ID_IsNotPickable); // Make it an invalid target for selection.
// Remember which scene node is highlighted
scene::ISceneNode* highlightedSceneNode = 0;
scene::ISceneCollisionManager* collMan = smgr->getSceneCollisionManager();
int lastFPS = -1;
// draw the selection triangle only as wireframe
material.Wireframe=true;
while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0);
smgr->drawAll();
// Unlight any currently highlighted scene node
if (highlightedSceneNode)
{
highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, true);
highlightedSceneNode = 0;
}
// All intersections in this example are done with a ray cast out from the camera to
// a distance of 1000. You can easily modify this to check (e.g.) a bullet
// trajectory or a sword's position, or create a ray from a mouse click position using
// ISceneCollisionManager::getRayFromScreenCoordinates()
core::line3d<f32> ray;
ray.start = camera->getPosition();
ray.end = ray.start + (camera->getTarget() - ray.start).normalize() * 1000.0f;
// Tracks the current intersection point with the level or a mesh
core::vector3df intersection;
// Used to show with triangle has been hit
core::triangle3df hitTriangle;
// This call is all you need to perform ray/triangle collision on every scene node
// that has a triangle selector, including the Quake level mesh. It finds the nearest
// collision point/triangle, and returns the scene node containing that point.
// Irrlicht provides other types of selection, including ray/triangle selector,
// ray/box and ellipse/triangle selector, plus associated helpers.
// See the methods of ISceneCollisionManager
scene::ISceneNode * selectedSceneNode =
collMan->getSceneNodeAndCollisionPointFromRay(
ray,
intersection, // This will be the position of the collision
hitTriangle, // This will be the triangle hit in the collision
IDFlag_IsPickable, // This ensures that only nodes that we have
// set up to be pickable are considered
0); // Check the entire scene (this is actually the implicit default)
// If the ray hit anything, move the billboard to the collision position
// and draw the triangle that was hit.
if(selectedSceneNode)
{
bill->setPosition(intersection);
// We need to reset the transform before doing our own rendering.
driver->setTransform(video::ETS_WORLD, core::matrix4());
driver->setMaterial(material);
driver->draw3DTriangle(hitTriangle, video::SColor(0,255,0,0));
// We can check the flags for the scene node that was hit to see if it should be
// highlighted. The animated nodes can be highlighted, but not the Quake level mesh
if((selectedSceneNode->getID() & IDFlag_IsHighlightable) == IDFlag_IsHighlightable)
{
highlightedSceneNode = selectedSceneNode;
// Highlighting in this case means turning lighting OFF for this node,
// which means that it will be drawn with full brightness.
highlightedSceneNode->setMaterialFlag(video::EMF_LIGHTING, false);
}
}
// We're all done drawing, so end the scene.
driver->endScene();
int fps = driver->getFPS();
if (lastFPS != fps)
{
core::stringw str = L"Collision detection example - Irrlicht Engine [";
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
device->drop();
return 0;
}
irr::IrrlichtDevice::run
virtual bool run()=0
Runs the device.
irr::IrrlichtDevice::setWindowCaption
virtual void setWindowCaption(const wchar_t *text)=0
Sets the caption of the window.
irr::IrrlichtDevice::isWindowActive
virtual bool isWindowActive() const =0
Returns if the window is active.
irr::core::line3d
3D line between two points with intersection methods.
Definition line3d.h:19
irr::core::line3d::start
vector3d< T > start
Start point of line.
Definition line3d.h:130
irr::core::line3d::end
vector3d< T > end
End point of line.
Definition line3d.h:132
irr::core::string::c_str
const T * c_str() const
Returns character string.
Definition irrString.h:495
irr::scene::IAnimatedMeshSceneNode
Scene node capable of displaying an animated mesh and its shadow.
Definition IAnimatedMeshSceneNode.h:54
irr::scene::IAnimatedMeshSceneNode::setAnimationSpeed
virtual void setAnimationSpeed(f32 framesPerSecond)=0
Sets the speed with which the animation is played.
irr::scene::IAnimatedMeshSceneNode::setMD2Animation
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim)=0
Starts a default MD2 animation.
irr::scene::ICameraSceneNode::getTarget
virtual const core::vector3df & getTarget() const =0
Gets the current look at target of the camera.
irr::scene::ILightSceneNode
Scene node which is a dynamic light.
Definition ILightSceneNode.h:23
irr::scene::ISceneCollisionManager
The Scene Collision Manager provides methods for performing collision tests and picking on scene node...
Definition ISceneCollisionManager.h:25
irr::scene::ISceneCollisionManager::getSceneNodeAndCollisionPointFromRay
virtual ISceneNode * getSceneNodeAndCollisionPointFromRay(core::line3df ray, core::vector3df &outCollisionPoint, core::triangle3df &outTriangle, s32 idBitMask=0, ISceneNode *collisionRootNode=0, bool noDebugObjects=false)=0
Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes.
irr::scene::ISceneManager::createTriangleSelector
virtual ITriangleSelector * createTriangleSelector(IMesh *mesh, ISceneNode *node)=0
Creates a simple ITriangleSelector, based on a mesh.
irr::scene::ISceneManager::drawAll
virtual void drawAll()=0
Draws all the scene nodes.
irr::scene::ISceneManager::getSceneCollisionManager
virtual ISceneCollisionManager * getSceneCollisionManager()=0
Get pointer to the scene collision manager.
irr::scene::ISceneManager::addAnimatedMeshSceneNode
virtual IAnimatedMeshSceneNode * addAnimatedMeshSceneNode(IAnimatedMesh *mesh, ISceneNode *parent=0, s32 id=-1, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &rotation=core::vector3df(0, 0, 0), const core::vector3df &scale=core::vector3df(1.0f, 1.0f, 1.0f), bool alsoAddIfMeshPointerZero=false)=0
Adds a scene node for rendering an animated mesh model.
irr::scene::ISceneManager::addLightSceneNode
virtual ILightSceneNode * addLightSceneNode(ISceneNode *parent=0, const core::vector3df &position=core::vector3df(0, 0, 0), video::SColorf color=video::SColorf(1.0f, 1.0f, 1.0f), f32 radius=100.0f, s32 id=-1)=0
Adds a dynamic light scene node to the scene graph.
irr::scene::ISceneNode
Scene node interface.
Definition ISceneNode.h:41
irr::scene::ISceneNode::getID
virtual s32 getID() const
Get the id of the scene node.
Definition ISceneNode.h:261
irr::scene::ISceneNode::setScale
virtual void setScale(const core::vector3df &scale)
Sets the relative scale of the scene node.
Definition ISceneNode.h:468
irr::scene::ISceneNode::getMaterial
virtual video::SMaterial & getMaterial(u32 num)
Returns the material based on the zero based index i.
Definition ISceneNode.h:406
irr::scene::ISceneNode::getPosition
virtual const core::vector3df & getPosition() const
Gets the position of the node relative to its parent.
Definition ISceneNode.h:498
irr::scene::ISceneNode::setRotation
virtual void setRotation(const core::vector3df &rotation)
Sets the rotation of the node relative to its parent.
Definition ISceneNode.h:488
irr::video::IVideoDriver::beginScene
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, SColor color=SColor(255, 0, 0, 0), const SExposedVideoData &videoData=SExposedVideoData(), core::rect< s32 > *sourceRect=0)=0
Applications must call this method before performing any rendering.
irr::video::IVideoDriver::getFPS
virtual s32 getFPS() const =0
Returns current frames per second value.
irr::video::IVideoDriver::getName
virtual const wchar_t * getName() const =0
Gets name of this video driver.
irr::video::IVideoDriver::endScene
virtual bool endScene()=0
Presents the rendered image to the screen.
irr::video::IVideoDriver::setMaterial
virtual void setMaterial(const SMaterial &material)=0
Sets a material.
irr::video::IVideoDriver::setTransform
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4 &mat)=0
Sets transformation matrices.
irr::video::IVideoDriver::draw3DTriangle
virtual void draw3DTriangle(const core::triangle3df &triangle, SColor color=SColor(255, 255, 255, 255))=0
Draws a 3d triangle.
irr::video::SColor
Class representing a 32 bit ARGB color.
Definition SColor.h:202
irr::video::SColorf
Class representing a color with four floats.
Definition SColor.h:459
irr::video::SMaterial
Struct for holding parameters for a material renderer.
Definition SMaterial.h:227
irr::video::SMaterial::setTexture
void setTexture(u32 i, ITexture *tex)
Sets the i-th texture.
Definition SMaterial.h:482
irr::video::SMaterial::Wireframe
bool Wireframe
Draw as wireframe or filled triangles? Default: false.
Definition SMaterial.h:407
irr::video::SMaterial::NormalizeNormals
bool NormalizeNormals
Should normals be normalized?
Definition SMaterial.h:435
irr::video::SMaterial::Lighting
bool Lighting
Will this material be lighted? Default: true.
Definition SMaterial.h:416
irr::core::triangle3df
triangle3d< f32 > triangle3df
Typedef for a f32 3d triangle.
Definition triangle3d.h:270
irr::core::matrix4
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2235
irr::core::stringw
string< wchar_t > stringw
Typedef for wide character strings.
Definition irrString.h:1361
irr::scene::EMAT_POINT
@ EMAT_POINT
Definition IAnimatedMeshMD2.h:29
irr::video::ETS_WORLD
@ ETS_WORLD
World transformation.
Definition IVideoDriver.h:57
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0