![]() |
Wrapper Library for IrrlichtReference Manual |
![]() |
IrrStart |
Syntax IrrStart ( device type , screen width as integer, screen height as integer, bits per pixel, full screen, use shadows, capture mouse and keyboard, vertical syncronisation ) Description Starts the Irrlicht interface and opens a window for rendering. device type specifies the renderer to use when drawing to the display this may be one of the following types: - IRR_EDT_NULL A NULL device with no display IRR_EDT_SOFTWARE Irrlichts default software renderer IRR_EDT_SOFTWARE2 An improved quality software renderer IRR_EDT_OPENGL Hardware accelerated OpenGL renderer IRR_EDT_DIRECT3D8 Hardware accelerated DirectX 8 renderer (not included in the Wrappers 'Irlicht.dll' distribution) IRR_EDT_DIRECT3D9 Hardware accelerated DirectX 9 renderer (not included in the Wrappers 'Irlicht.dll' distribution) screen width specifies the width of the viewport in pixels screen height specifies the height of the viewport in pixels The number of color bits that is used for each pixel 32 bit color gives 24 million different colors whereas 16 bit color gives only 32,000 colors. However the advantage of 16 bit color is that some operations use half the memory and can run at up to twice the speed. This setting can be either of: - IRR_BITS_PER_PIXEL_16 IRR_BITS_PER_PIXEL_32 Full screen specifies whether the display is to opened in full screen mode or in a window IRR_WINDOWED For window mode IRR_FULLSCREEN For fullscreen mode. When using full screen mode you will need to adjust the window size to the same dimensions as a supported screen resolution on the target display 640x400 for example. Use shadows starts the engine in a mode that supports the rendering of stencil shadows. IRR_NO_SHADOWS For a display that does not support shadows. IRR_SHADOWS For a display that supports shadows. Capture mouse and keyboard specified whether you want to capture keyboard and mouse events, if you choose to ignore them they will be handled by Irrlicht for FPS camera control. This parameter should be either of: - IRR_IGNORE_EVENTS IRR_CAPTURE_EVENTS vertical syncronisation specifies whether the display of each new frame is syncronised with vertical refresh of the graphics card. This produces a smoother display and avoids 'tearing' where the viewer can see parts of two different frames at the same time. The setting can be either of :- IRR_VERTICAL_SYNC_OFF IRR_VERTICAL_SYNC_ON Example |
IrrStart( IRR_EDT_OPENGL, screen_width, screen_height,
IRR_BITS_PER_PIXEL_32,
IRR_WINDOWED, IRR_SHADOWS, IRR_IGNORE_EVENTS, IRR_VERTICAL_SYNC_ON ) IrrStop |
IrrStartAdvanced |
Syntax integer = IrrStart ( _ drivertype as IRR_DEVICE_TYPES, _ scrWidth as integer, _ scrHeight as integer, _ bits as uinteger, _ fullscreen as uinteger, _ shadows as uinteger, _ dontignoreinput as uinteger, _ vsyncenabled as uinteger = IRR_OFF, _ devicetype as uinteger = 0, _ doublebufferenabled as uinteger = IRR_ON, _ antialiasenabled as uinteger = 0, _ highprecisionfpu as uinteger = IRR_OFF ) Description An advanced call for starting the Irrlicht interface and opens a window for rendering. device type specifies the renderer to use when drawing to the display this may be one of the following types: - IRR_EDT_NULL A NULL device with no display IRR_EDT_SOFTWARE Irrlichts default software renderer IRR_EDT_SOFTWARE2 An improved quality software renderer IRR_EDT_OPENGL Hardware accelerated OpenGL renderer IRR_EDT_DIRECT3D8 Hardware accelerated DirectX 8 renderer (not included in the Wrappers 'Irlicht.dll' distribution) IRR_EDT_DIRECT3D9 Hardware accelerated DirectX 9 renderer (not included in the Wrappers 'Irlicht.dll' distribution) screen width specifies the width of the viewport in pixels screen height specifies the height of the viewport in pixels The number of color bits that is used for each pixel 32 bit color gives 24 million different colors whereas 16 bit color gives only 32,000 colors. However the advantage of 16 bit color is that some operations use half the memory and can run at up to twice the speed. This setting can be either of: - IRR_BITS_PER_PIXEL_16 IRR_BITS_PER_PIXEL_32 Full screen specifies whether the display is to opened in full screen mode or in a window IRR_WINDOWED For window mode IRR_FULLSCREEN For fullscreen mode. When using full screen mode you will need to adjust the window size to the same dimensions as a supported screen resolution on the target display 640x400 for example. Use shadows starts the engine in a mode that supports the rendering of stencil shadows. IRR_NO_SHADOWS For a display that does not support shadows. IRR_SHADOWS For a display that supports shadows. Capture mouse and keyboard specified whether you want to capture keyboard and mouse events, if you choose to ignore them they will be handled by Irrlicht for FPS camera control. This parameter should be either of: - IRR_IGNORE_EVENTS IRR_CAPTURE_EVENTS vertical syncronisation specifies whether the display of each new frame is syncronised with vertical refresh of the graphics card. This produces a smoother display and avoids 'tearing' where the viewer can see parts of two different frames at the same time. The setting can be either of :- IRR_VERTICAL_SYNC_OFF IRR_VERTICAL_SYNC_ON devicetype allows a specific type of device for example a windows screen or a console to be selected. For the time being this should be set to 0 which automatically selects the best device doublebufferenabled is used to control whether double buffering is used. When double buffering is used two drawing surfaces are created one for display and the other that is used for drawing too. Double buffering is required for anit-aliasing the options are: IRR_ON or IRR_OFF antialiasenabled is used to enable the antialiasing effect, this effect produces a blurring at the edges of object giving their lines a smooth natural appearence. There is usually a big penalty for using this effect though sometimes as high as 30% of the frame rate or more. This is a value for the anti-aliasing and should be a power of 2. (e.g: 2, 4, 8, 16) highprecisionfpu is used to enable high precision Floating point calculations, that produce more accurate result at the expense of a slower operating speed. Example |
IrrStartAdvanced ( _ IRR_EDT_OPENGL, _ ' Use OpenGL 512, 512, _ ' in a window 640x480 IRR_BITS_PER_PIXEL_32, _' using 32 bit true color IRR_WINDOWED, _ ' in a window IRR_NO_SHADOWS, _ ' without stencil shadows IRR_IGNORE_EVENTS, _ ' dont capture keystrokes and mouse IRR_ON, _ ' sync to the monitor refresh rate 0, _ ' 0 = use the most appropriate window device IRR_ON, _ ' Switch on double buffering of the display 4, _ ' Anti-aliasing level 4 IRR_ON ) ' use high precision floating point math |
IrrRunning |
Syntax IrrRunning Description Used to determine if the Irrlicht engine is still running. Example |
IrrStart(
IRR_EDT_OPENGL, screen_width, screen_height, IRR_WINDOWED, IRR_SHADOWS,
IRR_IGNORE_EVENTS ) While IrrRunning Wend IrrStop |
IrrSetViewPort |
Syntax IrrSetViewPort( topX as integer, topY as integer, bottomX as integer, bottomY as integer ) Description Define the area of the screen into which elements are going to be drawn. This can be used to draw the scene multiple times for split screen effects. Example |
IrrSetActiveCamera(
FirstCamera ) IrrSetViewPort( 0,0, 200,200 ) IrrDrawScene |
IrrSetRenderTarget |
Syntax IrrSetRenderTarget (texture As irr_texture, sceneBackgroundColor As Uinteger = 0, clearBackBuffer As Ubyte = 1, clearZBuffer As Ubyte = 1) Description Set the target surface for rendering, this allows objects to be rendered to a texture that can then be drawn to the screen or displayed on other objects. Calling this function with texture set to 0 sets the drawing target back to the screen,. Texture is a texture created with the special .IrrCreateRenderTargetTexture call. scene background color is generated with the FreeBasic RGBA call and defines the colour used in any clear operation. clean back buffer when set to IRR_ON erases the background of the texture clear z buffer when set to IRR_ON erases the depth buffer (used by stencil shadows and some shaders) Example |
Texture
= IrrCreateRenderTargetTexture( 512, 512 ) IrrSetRenderTarget( Texture, RGBA( 0,0,0,0), IRR_ON, IRR_ON ) IrrDrawScene |
IrrBeginScene |
Syntax IrrBeginScene( Red as integer, Green as integer, Blue as integer ) Description Starts to draw a frame, erasing the canvas with the specified color. The colors are integer values in the range from 0 (black) to 255 (full intensity) Example |
IrrStart(
IRR_EDT_OPENGL, screen_width, screen_height, IRR_WINDOWED, IRR_SHADOWS,
IRR_IGNORE_EVENTS ) While IrrRunning IrrBeginScene( 255, 255, 255 ) IrrDrawScene IrrEndScene Wend IrrStop |
IrrDrawScene |
Syntax IrrDrawScene Description This renders the 3D scene to the canvas, drawing all 3D elements: nodes, particles, billboards, etc .... Example |
IrrStart(
IRR_EDT_OPENGL, screen_width, screen_height, IRR_WINDOWED, IRR_SHADOWS,
IRR_IGNORE_EVENTS ) While IrrRunning IrrBeginScene( 255, 255, 255 ) IrrDrawScene IrrEndScene Wend IrrStop |
IrrDrawSceneToTexture |
Syntax IrrDrawSceneToTexture( render_texture as irr_texture ) Description Draw scene manager objects to a texture surface, the texture must have been created with a call to IrrCreateRenderTargetTexture. This is useful for creating textures from 3D objects in your scene perhaps nameplates in the interface for characters for example. NoteThe target texture must be smaller than the view window as some resources are shared between the two. Example |
IrrSetActiveCamera
( StaticCamera ) IrrDrawSceneToTexture ( RenderTexture ) IrrBeginScene( 240, 255, 255 ) IrrSetActiveCamera ( FPSCamera ) IrrDrawScene |
IrrDrawGUI |
Syntax IrrDrawGUI Description This renders the 2D graphical user interface that has been created to the scene. At the moment this wrapper only supports a static text object for experimentation purposes only. Example |
IrrStart(
IRR_EDT_OPENGL, screen_width, screen_height, IRR_WINDOWED, IRR_SHADOWS,
IRR_IGNORE_EVENTS ) While IrrRunning IrrBeginScene( 255, 255, 255 ) IrrDrawScene IrrDrawGUI IrrEndScene Wend IrrStop |
IrrEndScene |
Syntax IrrEndScene Description This renders the 3D scene to the canvas, drawing all 3D elements: nodes, particles, billboards, etc .... Example |
IrrStart( IRR_EDT_OPENGL, screen_width, screen_height,
IRR_WINDOWED, IRR_SHADOWS, IRR_IGNORE_EVENTS ) While IrrRunning IrrBeginScene( 255, 255, 255 ) IrrDrawScene IrrEndScene Wend IrrStop |
IrrStop |
Syntax IrrStop Description Stop the Irrlicht Engine freeing all of the resources and closing the display window. Example |
IrrStart( IRR_EDT_OPENGL, screen_width, screen_height,
IRR_WINDOWED, IRR_SHADOWS, IRR_IGNORE_EVENTS ) While IrrRunning IrrBeginScene( 255, 255, 255 ) IrrDrawScene IrrEndScene Wend IrrStop |
IrrTransparentZWrite |
Syntax IrrTransparentZWrite Description Allow transparency to write to the z buffer, this is nessecary sometimes to correct problems with the ordering of transparent objects in the scene, it may also have an effect of performance however. Example |
IrrTransparentZWrite |
IrrGetFPS |
Syntax Integer_variable = IrrGetFPS Description Get the current frame rate. This is determined by the number of times the IrrEndScene is called per second. Example |
frame_rate = IrrGetFPS IrrStop() Print “Frame Rate was “;frame_rate Sleep |
IrrGetScreenSize |
Syntax IrrGetScreenSize( width as integer, height as integer ) Description Gets the screen side into the two supplied variables. Example |
IrrGetScreenSize( ScreenWidth, ScreenHeight ) |
IrrGetPrimitivesDrawn |
Syntax unsigned_Integer_variable = IrrGetPrimitivesDrawn Description Get the current frame rate. This is determined by the number of times the IrrEndScene is called per second. Example |
polygons = IrrGetPrimitivesDrawn IrrStop() Print “The system drew about “;polygons;" triangles" Sleep |
IrrSetWindowCaption |
Syntax IrrSetWindowCaption( caption text as wide string ) Description Set the caption in the Irrlicht window title bar.. Example |
IrrSetWindowCaption(
“Irrlicht in Free Basic” ) |
IrrMakeARGB |
Syntax unsigned_integer = IrrMakeARGB ( Alpha, Red, Green, Blue ) Description Takes four values representing a colors Alpha, Red, Green and Blue intensity and returns them as a 32bit unsigned integer. Typically used for working with colors in IRR_VECT structures. Example |
vcolor
= IrrMakeARGB( 0, 255, 128, 128 ) |
IrrQueryFeature |
Syntax uinteger IrrQueryFeature( Feature as IRR_VIDEO_FEATURE_QUERY ) Description Used to determine if a particular video feature is supported by the graphics card. The function will return (1) if the feature is supported and (0) if it isnt. The feature parameter should be either of the following values: - EVDF_RENDER_TO_TARGET Is driver able to render to a surface? EVDF_HARDWARE_TL Is hardeware transform and lighting supported? EVDF_MULTITEXTURE Are multiple textures per material possible? EVDF_BILINEAR_FILTER Is driver able to render with a bilinear filter applied? EVDF_MIP_MAP Can the driver handle mip maps? EVDF_MIP_MAP_AUTO_UPDATE Can the driver update mip maps automatically? EVDF_STENCIL_BUFFER Are stencilbuffers switched on and does the device support stencil buffers? EVDF_VERTEX_SHADER_1_1 Is Vertex Shader 1.1 supported? EVDF_VERTEX_SHADER_2_0 Is Vertex Shader 2.0 supported? EVDF_VERTEX_SHADER_3_0 Is Vertex Shader 3.0 supported? EVDF_PIXEL_SHADER_1_1 Is Pixel Shader 1.1 supported? EVDF_PIXEL_SHADER_1_2 Is Pixel Shader 1.2 supported? EVDF_PIXEL_SHADER_1_3 Is Pixel Shader 1.3 supported? EVDF_PIXEL_SHADER_1_4 Is Pixel Shader 1.4 supported? EVDF_PIXEL_SHADER_2_0 Is Pixel Shader 2.0 supported? EVDF_PIXEL_SHADER_3_0 Is Pixel Shader 3.0 supported? EVDF_ARB_VERTEX_PROGRAM_1 Are ARB vertex programs v1.0 supported? EVDF_ARB_FRAGMENT_PROGRAM_1 Are ARB fragment programs v1.0 supported? EVDF_ARB_GLSL Is GLSL supported? EVDF_HLSL Is HLSL supported? EVDF_TEXTURE_NPOT Are non-power-of-two textures supported? EVDF_FRAMEBUFFER_OBJECT Are framebuffer objects supported? EVDF_VERTEX_BUFFER_OBJECT Are vertex buffer objects supported? EVDF_ALPHA_TO_COVERAGE Is alpha to coverage supported? EVDF_COLOR_MASK Are color masks supported? EVDF_MULTIPLE_RENDER_TARGETS Are multiple render targets supported? EVDF_MRT_BLEND Are seperate blend settings for render targets supported? EVDF_MRT_COLOR_MASK Are seperate color masks for render targets supported? EVDF_MRT_BLEND_FUNC Are seperate blend functions for render targets supported? EVDF_GEOMETRY_SHADER Are geometry shaders supported? Example |
if
IrrQueryFeature( EVDF_MULTITEXTURE ) = 0 then ? "MultiTexture is NOT supported" End if |
IrrDisableFeature |
Syntax uinteger IrrDisableFeature( Feature as IRR_VIDEO_FEATURE_QUERY, state as uinteger ) Description Used to disable a particular video feature on the graphics card. The feature parameter is identical to IrrQueryFeature. State should be either IRR_ON or IRR_OFF Example |
IrrDisableFeature(
EVDF_MULTITEXTURE, IRR_OFF ) |
IrrGetTime |
Syntax unsigned_integer = IrrGetTime Description Get the current time in milliseconds. Example |
time
= IrrGetTime |
IrrSetTime |
Syntax IrrGetTime( time as uinteger ) Description Set the current animation time in milliseconds. Example |
IrrSetTime(
2500 ) |
IrrIsFullscreen |
Syntax IrrIsFullscreen() as integer Description Checks if the Irrlicht window is running in fullscreen mode. Returns 0 if the application is windowed any other value indicates full screen mode Example |
if
IrrIsFullscreen = IRR_OFF Then Print "Windowed Mode" |
IrrIsWindowActive |
Syntax IrrIsWindowActive() as integer Description Checks if Irrlicht window is active. Returns 0 if the application is windowed any other value indicates full screen mode Example |
if
IrrIsWindowActive > 0 Then Print IrrDrawScene |
IrrIsWindowFocused |
Syntax IrrIsWindowFocused() as integer Description Checks if the Irrlicht window has focus. Returns 0 if the application is windowed any other value indicates full screen mode Example |
if
IrrIsWindowFocused > 0 Then Print IrrDrawScene |
IrrIsWindowMinimized |
Syntax IrrIsWindowMinimized() as integer Description Checks if the Irrlicht window is minimized. Returns 0 if the application is windowed any other value indicates full screen mode Example |
if
IrrIsWindowMinimized = 0 Then Print IrrDrawScene |
IrrMaximizeWindow |
Syntax IrrMaximizeWindow() Description Maximizes the window if possible. Example |
IrrMaximizeWindow |
IrrMinimizeWindow |
Syntax IrrMinimizeWindow() Description Minimizes the window if possible. Example |
IrrMinimizeWindow |
IrrRestoreWindow |
Syntax IrrRestoreWindow() Description Restore the window to normal size if possible. Example |
IrrRestoreWindow |
IrrResizableWindow |
Syntax IrrResizableWindow() Description Make the irrlicht window resizable by dragging on the corner of the window. Example |
IrrResizableWindow |
IrrKeyEventAvailable |
Syntax IrrSetWindowCaption Description Determine if there are any keystrokes waiting to be read.. Example |
while IrrKeyEventAvailable KeyEvent = IrrReadKeyEvent Wend |
IrrReadKeyEvent |
Syntax irr_key_event_pointer = IrrReadKeyEvent Description Read a key event from the Irrlicht window the properties of the key event are stored in the returned type. Example |
While IrrKeyEventAvailable KeyEvent = IrrReadKeyEvent If KeyEvent->key = IRR_KEY_DOWN then Movement = DOWN End If Wend |
IrrMouseEventAvailable |
Syntax IrrMouseEventAvailable Description Determine if there are any mouse actions waiting to be read. Example |
while IrrMouseEventAvailable MouseEvent = IrrReadMouseEvent Wend |
IrrReadMouseEvent |
Syntax irr_mouse_event_pointer = IrrReadMouseEvent Description Read a mouse event from the Irrlicht window the properties of the mouse event are stored in the returned type. Example |
while
IrrMouseEventAvailable ' read the mouse event out MouseEvent = IrrReadMouseEvent if MouseEvent->action = IRR_EMIE_MOUSE_MOVED then SPIN = MouseEvent->x endif wend |
IrrSetMousePosition |
Syntax IrrSetMousePosition( x as single, y as single ) Description Set the position of the mouse pointer and return the relative change in position. Example |
IrrSetMousePosition( XPosition, YPosition ) |
IrrGetAbsoluteMousePosition |
Syntax IrrGetAbsoluteMousePosition( x as single, y as single ) Description Gets the absoloute position of the mouse pointer. Example |
IrrGetAbsoluteMousePosition( XPosition, YPosition ) |
IrrHideMouse |
Syntax IrrHideMouse Description Hide the mouse pointer Example |
IrrHideMouse |
IrrShowMouse |
Syntax IrrShowMouse Description Shows the mouse pointer Example |
IrrShowMouse |
IrrDisplayMouse |
Syntax IrrDisplayMouse( hide or show the mouse as integer ) Description Hide or show the mouse pointer while it is within the Irrlicht display. There are two macro's available for the function IrrHideMouse and IrrShowMouse to simply hide or show the mouse. 1 shows the mouse pointer and 0 hides it. Example |
IrrDisplayMouse( 0 ) |
IrrAddZipFile |
Syntax IrrAddZipFile( zip file as zstring, ignore case, ignore paths ) Description Adds a zip archive to the filing system allowing you to load files straight out of the zip file. Common pk3 files are simply zip files Ignore case should be one of the following values: - IRR_USE_CASE IRR_IGNORE_CASE Ignore paths allows you to simply use the filename without the path, the filename should always be unique in the archive when using this option. The value should be one of the following: - IRR_USE_PATHS IRR_IGNORE_PATHS Example |
IrrAddZipFile( "data.pk3", IRR_IGNORE_CASE, IRR_IGNORE_PATHS ) |
IrrChangeWorkingDirectory |
Syntax IrrChangeWorkingDirectory( New directory as zstring ) Description Change the working directory of the Irrlicht Environment. Example |
IrrChangeWorkingDirectory( "c:\media" ) |
IrrGetWorkingDirectory |
Syntax string = IrrGetWorkingDirectory Description Get the current working directory of the Irrlicht Environment. Example |
CurrentDirectory = IrrGetWorkingDirectory |
IrrSetTextureCreationFlag |
Syntax IrrSetTextureCreationFlag( flag_to_set as IRR_TEXTURE_CREATION_FLAG, flag_value as uinteger ) Description Sets texture creation flags controlling how textures are handled when they are created. The following flags can be set: - ETCF_ALWAYS_16_BIT ETCF_ALWAYS_32_BIT ETCF_OPTIMIZED_FOR_QUALITY ETCF_OPTIMIZED_FOR_SPEED ETCF_CREATE_MIP_MAPS ETCF_NO_ALPHA_CHANNEL |
IrrSetTextureCreationFlag( ETCF_ALWAYS_32_BIT, IRR_ON ) |
IrrGetTexture |
Syntax irr_texture = IrrGetTexture( Texture file name as zstring ) Description Load a 2D texture from a bitmap file into video memoy that can then be used to texture a model or to draw onto the screen. Example |
IrrlichtLogo = IrrGetTexture( "irrlicht.bmp" ) |
IrrGetImage |
Syntax irr_texture = IrrGetImage( Texture file name as zstring ) Description Load a 2D texture from a bitmap file into main memory that can then be used to supply a heightmap to a terrain or other similar CPU based operations. The images can not be used to texture 3D objects. Example |
TerrainMap = IrrGetImage( "heightmap.bmp" ) |
IrrCreateTexture |
Syntax irr_texture = IrrCreateTexture( texture_name as zstring, x_size as integer, y_size as integer, format as IRR_COLOR_FORMAT ) Description Creates a blank texture. The format of the texture can be one of the following: - ECF_A1R5G5B5 ECF_R5G6B5 ECF_R8G8B8 ECF_A8R8G8B8 |
IrrlichtLogo = IrrCreateTexture( "mytexture", 128, 128, ECF_A8R8G8B8 ) |
IrrCreateImage |
Syntax irr_image = IrrCreateImage( x_size as integer, y_size as integer, format as IRR_COLOR_FORMAT ) Description Creates a blank image, does not use video memory. The format of the image can be one of the following: - ECF_A1R5G5B5 ECF_R5G6B5 ECF_R8G8B8 ECF_A8R8G8B8 |
BlankPicture = IrrCreateImage( 128, 128, ECF_A8R8G8B8 ) |
IrrRemoveTexture |
Syntax IrrRemoveTexture( texture as irr_texture ) Description Removes the texture from memory freeing up the space it occupied. You should ensure that the texture is not in use by materials assigned to nodes. Example |
DIM
MyTexture as irr_texture MyTexture = IrrGetTexture( "irrlicht.bmp" ) IrrRemoveTexture( MyTexture ) |
IrrRemoveImage |
Syntax IrrRemoveImage( image as irr_image ) Description Removes the image from memory freeing up the space it occupied. You should ensure that the image is not in use by other functions. Example |
DIM
MyImage as irr_image MyImage = IrrGetImage( "irrlicht.bmp" ) IrrRemoveImage( MyImage ) |
IrrLockTexture |
Syntax pixels_ptr = IrrLockTexture( texture as irr_texture ) Description Locks the texture and returns a pointer to the pixels. Example |
DIM
texture_pixels as uinteger ptr texture_pixels = IrrLockTexture( MyTexture ) |
IrrUnlockTexture |
Syntax IrrUnlockTexture( texture as irr_texture ) Description Unlock the texture, presumably after it has been modified and recreate the mipmap levels. Example |
IrrUnlockTexture( MyTexture ) |
IrrLockImage |
Syntax pixels_ptr = IrrLockImage( image as irr_image ) Description Locks the image and returns a pointer to the pixels. Example |
DIM
image_pixels as uinteger ptr image_pixels = IrrLockImage( MyImage ) |
IrrUnlockImage |
Syntax IrrUnlockImage( image as irr_image ) Description Unlock the image, presumably after it has been modified. Example |
IrrUnlockImage( MyImage ) |
IrrCreateRenderTargetTexture |
Syntax irr_texture = IrrCreateRenderTargetTexture( x_size as integer, y_size as integer ) Description Create a texture that is suitable for the scene manager to use as a surface to which it can render its 3d object. Each of the dimentions must be of a power of two for example 128x128 or 256x256. This function is very important when producing texture maps for special effects for example a rendering of a model for a 2D image displayed in the HUD, the rendering of a model for display on a 3D surface for example a video display of virtual camera, the rendering of the texture for the reflection of a mirror, the rendering of the environment for use in a water or chrome shader. Most cards, even old cards, will support this very important function. Example |
RenderTexture = IrrCreateRenderTargetTexture ( 256, 256 ) |
IrrMakeNormalMapTexture |
Syntax IrrMakeNormalMapTexture( Texture object as irr_texture, Amplitude as single ) Description Create a normal map from a gray-scale height map texture. Normal maps are used to add a high level of surface lighting detail to what are normally low resolution models. They can have a massive effect on the realism of an object, the model you create will have to be created in "tangent" space to support this. Example |
IrrMakeNormalMapTexture( WallBumps, 0.9 ) |
IrrColorKeyTexture |
Syntax IrrColorKeyTexture( Texture object as irr_texture, Red as integer, Green as integer, Blue as integer ) Description Copies any parts of the texture that are the same as the specified color into the textures alpha channel. This can then be used for special effects or to make these regions transparent. Example |
IrrColorKeyTexture( IrrlichtLogo, 255, 255, 255 ) |
IrrDraw2DImage |
Syntax IrrDraw2DImage( Texture to draw as irr_texture, X position as integer, Y position as integer ) Description Draws the texture to the display at the supplied co-ordinates. Example |
IrrDraw2DImage( IrrlichtLogo, 4, 4 ) |
IrrDraw2DImageElement |
Syntax IrrDraw2DImageElement( Texture to draw as irr_texture, X position as integer, Y position as integer, Source top X as integer, Source top Y as integer, Source bottom X as integer, Source bottom Y as integer, whether to use alpha as integer ) Description Draws the texture to the display at the supplied co-ordinates, the image is copied from the specified rectangle in the source texture, this enables you to put many images onto a single texture. This function also supports the alpha channel when drawing the image to the display and can draw the image transparently. The value for whether or not to use the alpha channel should be one of the following values: - IRR_IGNORE_ALPHA IRR_USE_ALPHA Example |
IrrDraw2DImageElement( FreeBasicLogo, screen_width - 60 - 4, 4,0,0,60,31, IRR_USE_ALPHA ) |
IrrDraw2DImageElementStretch |
Syntax IrrDraw2DImageElementStretch (texture as irr_texture, destination top X as integer, destination top Yas integer, destination bottom X as integer, destination bottom Y as integer, source top X as integer, source top Y as integer, source bottom X as integer, source bottom Y as integer, use Alpha as integer ) Description Draws the texture to the display into the supplied rectangle, the image is copied from the specified rectangle in the source texture, this enables you to put many images onto a single texture. If the rectangles are different sizes this function will scale the images appropriately. This function also supports the alpha channel when drawing the image to the display and can draw the image transparently. The value for whether or not to use the alpha channel should be one of the following values: - IRR_IGNORE_ALPHA IRR_USE_ALPHA Example |
IrrDraw2DImageElementStretch( FreeBasicLogo, 16, 16, 80, 80, 0, 0, 32, 32, IRR_USE_ALPHA ) |
IrrGetFont |
Syntax irr_font = IrrGetFont( Filename of the bitmap font file as zstring ) Description Loads a bitmap containing a bitmap font. Example |
BitmapFont = IrrGetFont ( "bitmapfont.bmp" ) |
Irr2DFontDraw |
Syntax Irr2DFontDraw ( Font Object as irr_texture, The text to display as wstring ptr, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer) Description Draws the text into the supplied rectangular area using the supplied font object. Example |
Irr2DFontDraw ( BitmapFont, "SIMPLE MONOCHROME FONT", 120, 80, 250, 96 ) |
IrrSaveScreenShot |
Syntax IrrSaveScreenShot( filename as zstring) Description Save a screenshot out to a file, the image format is defined by the extension applied to the filename. Irrlicht currently supports: bmp, png, tga, ppm and jpg Example |
IrrSaveScreenShot( "c:\myscreen.bmp" ) |
IrrGetScreenShot |
Syntax texture = IrrGetScreenShot( x as uinteger, y as uinteger, width as uinteger, height as uinteger ) Description Return a pointer to a texture containing a rectangular portion of a screenshot. Example |
DIM texture as irr_texture = IrrGetScreenShot( 0,0, 256,256) |
IrrGetTextureInformation |
Syntax texture = IrrGetTextureInformation ( texture as irr_texture, textureWidth as unsigned integer, textureHeight as unsigned integer, texturePitch as unsigned integer,textureFormat as IRR_COLOR_FORMAT ) Description Get information on a texture. The width, height, pitch and color format is returned in the supplied variables. Example |
IrrGetTextureInformation ( selectedTexture, width, height, pitch, col_format ) |
IrrGetImageInformation |
Syntax texture = IrrGetImageInformation ( image as irr_image, textureWidth as unsigned integer, textureHeight as unsigned integer, texturePitch as unsigned integer,textureFormat as IRR_COLOR_FORMAT ) Description Get information on an image. The width, height, pitch and color format is returned in the supplied variables. Example |
IrrGetImageInformation ( selectedImage, width, height, pitch, col_format ) |
IrrSetNodeAmbientColor |
Syntax IrrSetNodeAmbientColor ( node As irr_node, uColor As Uinteger) Description Sets the ambient color of all materials in a node. This color value is created with the FreeBasic RGBA call. The ambient color is a color applied to the whole node as a simulation of ambient lighting reflected from the objects around it. Example |
IrrSetNodeAmbientColor ( object_material, RGBA( 128,0,0,0 )) |
IrrSetNodeDiffuseColor |
Syntax IrrSetNodeDiffuseColor ( node As irr_node, uColor As Uinteger) Description Sets the diffuse color of all materials in a node. This color value is created with the FreeBasic RGBA call. The diffuse color is the indirectly lit surface colour. Example |
IrrSetNodeDiffuseColor ( object_material, RGBA( 128,0,0,0 )) |
IrrSetNodeSpecularColor |
Syntax IrrSetNodeSpecularColor ( node As irr_node, uColor As Uinteger) Description Sets the specilar color of all materials in a node. This color value is created with the FreeBasic RGBA call. The specular color is the color of the highlights on the node representing reflections of light sources. Example |
IrrSetNodeSpecularColor ( object_material, RGBA( 128,0,0,0 )) |
IrrSetNodeEmissiveColor |
Syntax IrrSetNodeEmissiveColor ( node As irr_node, uColor As Uinteger) Description Sets the emissive color of all materials in a node. This color value is created with the FreeBasic RGBA call. The emissive colour is the light 'generated within' the node. Setting this to 255,255,255,255 will make the node appear as though it has the no lighting effect applied to it. Example |
IrrSetNodeEmissiveColor ( object_material, RGBA( 128,0,0,0 )) |
IrrSetNodeColorByVertex |
Syntax IrrSetNodeColorByVertex ( material as irr_material, affected_property as IRR_COLOR_MATERIAL ) Description Sets which aspect of all of the materials in a node is affected by the vertex colour. affected_property can be one of: - ECM_NONE Dont use vertex color for lighting ECM_DIFFUSE Use vertex color for diffuse light, (the default value) ECM_AMBIENT Use vertex color for ambient light ECM_EMISSIVE Use vertex color for emissive light ECM_SPECULAR Use vertex color for specular light ECM_DIFFUSE_AND_AMBIENT Use vertex color for both diffuse and ambient light Example |
IrrSetNodeColorByVertex ( object_material, ECM_NONE ) |
IrrMaterialVertexColorAffects |
Syntax IrrMaterialVertexColorAffects ( material as irr_material, affected_property as IRR_COLOR_MATERIAL ) Description Sets which aspect of the material is affected by the vertex colour. affected_property can be one of: - ECM_NONE Dont use vertex color for lighting ECM_DIFFUSE Use vertex color for diffuse light, (the default value) ECM_AMBIENT Use vertex color for ambient light ECM_EMISSIVE Use vertex color for emissive light ECM_SPECULAR Use vertex color for specular light ECM_DIFFUSE_AND_AMBIENT Use vertex color for both diffuse and ambient light Example |
IrrMaterialVertexColorAffects ( object_material, ECM_NONE ) |
IrrSetMaterialBlend |
Syntax IrrSetMaterialBlend ( material as irr_material, source as IRR_BLEND_FACTOR, destination as IRR_BLEND_FACTOR ) Description Sets the source and destination surface blend factors for the ONETEXTURE_BLEND material. This is mainly useful in multi-pass rendering, where you render the scene to the display and then render the scene a second time with the ONETEXTURE_BLEND material setting which mixes the existing pixels and the new pixels using the blend setting defined here. IRR_BLEND_FACTOR can be one of the following values: - EBF_ZERO A fixed value of zero EBF_ONE A fixed value of one EBF_DST_COLOR The destination color EBF_ONE_MINUS_DST_COLOR The inverted destination color EBF_SRC_COLOR The source color EBF_ONE_MINUS_SRC_COLOR The inverted source color EBF_SRC_ALPHA The source alpha value EBF_ONE_MINUS_SRC_ALPHA The inverted source alpha value EBF_DST_ALPHA The destination alpha value EBF_ONE_MINUS_DST_ALPHA The inverted destination alpha value EBF_SRC_ALPHA_SATURATE Example |
IrrSetMaterialBlend ( object_material, EBF_SOURCE_COLOR, EFB_DST_COLOR ) |
IrrMaterialSetShininess |
Syntax IrrMaterialSetShininess ( material as irr_material, shininess as single ) Description Set how shiny the material is, the higher the value the more defined the highlights. Example |
IrrMaterialSetShininess ( object_material, 20.0 ) |
IrrMaterialSetSpecularColor |
Syntax IrrMaterialSetSpecularColor ( material as irr_material, Alpha as uinteger, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Set the color of specular highlights on objects with this material applied. Example |
IrrMaterialSetSpecularColor ( object_material, 0, 255, 128, 128 ) |
IrrMaterialSetDiffuseColor |
Syntax IrrMaterialSetDiffuseColor ( material as irr_material, Alpha as uinteger, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Set the color of diffuse lighting on objects with this material applied. Example |
IrrMaterialSetDiffuseColor ( object_material, 0, 255, 128, 255 ) |
IrrMaterialSetAmbientColor |
Syntax IrrMaterialSetAmbientColor ( material as irr_material, Alpha as uinteger, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Set the color of ambient light reflected by objects with this material applied. Example |
IrrMaterialSetAmbientColor ( object_material, 0, 64, 128, 255 ) |
IrrMaterialSetEmissiveColor |
Syntax IrrMaterialSetEmissiveColor ( material as irr_material, Alpha as uinteger, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Set the color of light emitted by objects with this material applied. Example |
IrrMaterialSetEmissiveColor ( object_material, 0, 64, 128, 255 ) |
IrrMaterialSetMaterialTypeParam |
Syntax IrrMaterialSetMaterialTypeParam( material as irr_material, value as single ) Description Set material specific parameter. Used in a couple of vertex alpha and normal mapping material types. Example |
IrrMaterialSetMaterialTypeParam( object_material, 0.357 ) |
IrrSetMaterialLineThickness |
Syntax IrrSetMaterialLineThickness( material as irr_material, thickness as single ) Description Sets the line thickness of none 3D elements associated with this material. Example |
IrrSetMaterialLineThickness( object_material, 2.0 ) |
IrrAddHighLevelShaderMaterial |
Syntax irr_shader = IrrAddHighLevelShaderMaterial ( vertex_program as zstring ptr, vertex_start_function as zstring ptr, vertex_prog_type as uinteger, pixel_program as zstring ptr, pixel_start_function as zstring ptr, pixel_prog_type as uinteger, material_type as uinteger ) Description Creates a new material using a high level shading language. vertex program: String containing the source of the vertex shader program. This can be 0 if no vertex program shall be used. vertex_start_function: Name of the entry function of the vertex shader program vertex_program_type: Vertex shader version used to compile the GPU program pixel_program: String containing the source of the pixel shader program. This can be 0 if no pixel shader shall be used. pixel_start_function: Entry name of the function of the pixel shader program pixel_program_type: Pixel shader version used to compile the GPU program baseMaterial: Base material which renderstates will be used to shade the material. Returns a type that contains a material_type number that can be used to shade nodes with this new material. If the shader could not be created it will return 0 Example |
shader = IrrAddHighLevelShaderMaterial ( _ vertex_program, "main", IRR_EVST_VS_1_1, _ pixel_program, "main", IRR_EPST_PS_1_1, _ IRR_EMT_SOLID ) |
IrrAddHighLevelShaderMaterialFromFiles |
Syntax irr_mesh = IrrAddHighLevelShaderMaterialFromFiles ( vertex_program_filename as zstring ptr, vertex_start_function as zstring ptr, vertex_prog_type as uinteger, pixel_program_filename as zstring ptr, pixel_start_function as zstring ptr, pixel_prog_type as uinteger, material_type as uinteger ) Description Creates a new material using a high level shading language stored in files. vertex program_filename: String containing the filename of the vertex shader program. This can be 0 if no vertex program shall be used. vertex_start_function: Name of the entry function of the vertex shader program vertex_program_type: Vertex shader version used to compile the GPU program pixel_program_filename: String containing the filename of the pixel shader program. This can be 0 if no pixel shader shall be used. pixel_start_function: Entry name of the function of the pixel shader program pixel_program_type: Pixel shader version used to compile the GPU program baseMaterial: Base material which renderstates will be used to shade the material. Returns a type that contains a material_type number that can be used to shade nodes with this new material. If the shader could not be created it will return 0. Example |
shader = IrrAddHighLevelShaderMaterialFromFiles ( _ ".\media\wood.vertex", "main", IRR_EVST_VS_1_1, _ ".\media\wood.pixel", "main", IRR_EPST_PS_1_1, _ IRR_EMT_SOLID ) |
IrrAddShaderMaterial |
Syntax irr_shader = IrrAddShaderMaterial ( vertex_program as zstring ptr, pixel_program as zstring ptr, material_type as uinteger ) Description Creates a new material using a shading language program stored in a string. vertex program: String containing the source of the vertex shader program. This can be 0 if no vertex program shall be used. For DX8 programs, the will always input registers look like this: v0: position, v1: normal, v2: color, v3: texture cooridnates, v4: texture coordinates 2 if available. For DX9 programs, you can manually set the registers using the dcl_ statements. pixel_program: String containing the source of the pixel shader program. This can be 0 if no pixel shader shall be used. baseMaterial: Base material which renderstates will be used to shade the material. Return: Returns a type that contains a material_type number that can be used to shade nodes with this new material. If the shader could not be created it will return 0 Example |
shader = IrrAddShaderMaterial ( vertex_program,
pixel_program, IRR_EMT_SOLID ) |
IrrAddShaderMaterialFromFiles |
Syntax irr_shader = IrrAddShaderMaterialFromFiles ( vertex_program_filename as zstring ptr, pixel_program_filename as zstring ptr, material_type as uinteger ) Description Creates a new material using a shading language program stored in files. vertex program: String containing the source of the vertex shader program. This can be 0 if no vertex program shall be used. For DX8 programs, the will always input registers look like this: v0: position, v1: normal, v2: color, v3: texture cooridnates, v4: texture coordinates 2 if available. For DX9 programs, you can manually set the registers using the dcl_ statements. pixel_program: String containing the source of the pixel shader program. This can be 0 if no pixel shader shall be used. baseMaterial: Base material which renderstates will be used to shade the material. Return: Returns a type that contains a material_type number that can be used to shade nodes with this new material. If the shader could not be created it will return 0 Example |
shader = IrrAddShaderMaterialFromFiles ( ".\media\wood_low.vtx", ".\media\wood_low.pxl" IRR_EMT_SOLID ) |
IrrCreateNamedVertexShaderConstant |
Syntax result = IrrCreateNamedVertexShaderConstant ( shader as IRR_SHADER, const_name as zstring ptr, const_preset as integer, const_data as single, data_count as integer ) Description Creates a Vertex shader constant that allows you to change the value of a constant inside a shader during the execution of the program, simply assign one of the preset constants to the constant name or attach the constant to an array of floats and change the constant simply by changing the values in your array Returns: 1 if the constant was sucessfully created Example |
IrrCreateNamedVertexShaderConstant ( shader, "Time", byval IRR_NO_PRESET, @time, 1 ) |
IrrCreateNamedPixelShaderConstant |
Syntax result = IrrCreateNamedPixelShaderConstant ( shader as IRR_SHADER, const_name as zstring ptr, const_preset as integer, const_data as single, data_count as integer ) Description Creates a Pixel shader constant that allows you to change the value of a constant inside a shader during the execution of the program, simply assign one of the preset constants to the constant name or attach the constant to an array of floats and change the constant simply by changing the values in your array Returns: 1 if the constant was sucessfully created Example |
dim color(4) as Single => { 1.0, 1.0, 1.0, 1.0 } IrrCreateNamedPixelShaderConstant ( shader, "color", IRR_NO_PRESET, @color, 4 ) |
IrrCreateAddressedVertexShaderConstant |
Syntax result = IrrCreateAddressedVertexShaderConstant ( shader as IRR_SHADER, const_address as integer, const_preset as integer, const_data as single, data_count as integer ) Description Creates a Vertex shader constant that allows you to change the value of a constant inside a shader during the execution of the program, simply assign one of the preset constants to the constant name or attach the constant to an array of floats and change the constant simply by changing the values in your array Returns: 1 if the constant was sucessfully created Example |
IrrCreateAddressedVertexShaderConstant ( shader, 4,
IRR_NO_PRESET, @time, 1 ) |
IrrCreateAddressedPixelShaderConstant |
Syntax result = IrrCreateAddressedPixelShaderConstant ( shader as IRR_SHADER, const_address as integer, const_preset as integer, const_data as single, data_count as integer ) Description Creates a Pixel shader constant that allows you to change the value of a constant inside a shader during the execution of the program, simply assign one of the preset constants to the constant name or attach the constant to an array of floats and change the constant simply by changing the values in your array Returns: 1 if the constant was sucessfully created Example |
dim position(3) as Single => { 0.0, 0.0, 0.0 } IrrCreateAddressedPixelShaderConstant ( shader, 2, IRR_NO_PRESET, @position, 3 ) |
IrrXEffectsStart |
Syntax IrrXEffectsStart ( vsm as integer = IRR_OFF, softShadows as integer = IRR_OFF, bitdepth32 as integer = IRR_OFF ) Description Starts the XEffects advanced shader extension provided by Bitplane from the Irrlicht Forums. This must be called before any other XEffects calls. The first parameter 'vsm' is used to turn on the 'Variance Shadow Maps' feature. VSM is an advanced form of shading used to avoid aliasing problems that can be seen with the other shadowing function. It can create clear sharp shadowing. Use IRR_ON to enable this feature. The second parameter 'soft shadows' provides blurred shadows, similar as those cast by a large source. Use IRR_ON to enable this feature. The last parameter 'bit depth 32' enables 32 bit buffers for the internal processes. While this will use more video memory it can produce improved results. Example |
IrrXEffectsStart ( IRR_OFF, IRR_ON ) |
IrrXEffectsEnableDepthPass |
Syntax IrrXEffectsEnableDepthPass( enable as integer ) Description Enables a depth rendering pass. This is required for shaders that rely on depth information. Use IRR_ON to enable the function. Example |
IrrXEffectsEnableDepthPass ( IRR_ON ) |
IrrXEffectsAddPostProcessingFromFile |
Syntax IrrXEffectsAddPostProcessingFromFile( name as zstring ptr, effectType as integer = 0 ) Description Adds a shader feature to the display from a GLSL or HLSL program stored in a file. Shaders do need some programming support so only the XEffects Shaders are supported through the XEffects calls. The first parameter is the path and file name for the shader program. If you are operating in OpenGL you should use the GLSL extension and when operating in DirectX you shouhld use the HLSL extension. The second parameter can usually be omitted or set to 0. Only when loading the SSAO shader (not the SSAO composite shader) should it be set to 1. Example |
IrrXEffectsAddPostProcessingFromFile (
"./media/shaders/ssao.glsl", 1 ) |
IrrXEffectsSetPostProcessingUserTexture |
Syntax IrrXEffectsSetPostProcessingUserTexture( texture as irr_texture ) Description Sets the user defined post processing texture. This is used internally for the SSAO shader but is used primarily for the water shader where it defines the specular surface pattern of the water. You can change the texture through a sequence of images to produce an animated effect. Example |
IrrXEffectsSetPostProcessingUserTexture (
waterTexture(i)) |
IrrXEffectsAddShadowToNode |
Syntax IrrXEffectsAddShadowToNode( node as irr_node, filterType as E_FILTER_TYPE = EFT_NONE, shadowType as E_SHADOW_MODE = ESM_BOTH ) Description Adds the shadowing effect to a node. This controls both recieving and casting shadows. The filterType defines the amount of sampling that is to be carried out on the node. This can be one of the following settings, increasing the filter increases the quality and also the cost of rendering. EFT_NONE EFT_4PCF EFT_8PCF EFT_12PCF EFT_16PCF The shadow type specifies the type of shadowing applied to the node. This can be set to one of the following settings: - ESM_RECEIVE ESM_CAST ESM_BOTH ESM_EXCLUDE Example |
IrrXEffectsAddShadowToNode ( roomNode ) |
IrrXEffectsRemoveShadowFromNode |
Syntax IrrXEffectsRemoveShadowFromNode( node as irr_node ) Description Removes the shadowing effect from a node. Example |
IrrXEffectsRemoveShadowFromNode ( roomNode ) |
IrrXEffectsExcludeNodeFromLightingCalculations |
Syntax IrrXEffectsExcludeNodeFromLightingCalculations( node as irr_node ) Description Excludes a node from shadowing calculations. Example |
IrrXEffectsExcludeNodeFromLightingCalculations (
particleNode ) |
IrrXEffectsAddNodeToDepthPass |
Syntax IrrXEffectsAddNodeToDepthPass( node as irr_node ) Description Adds a node to the list of nodes used for calculating the depth pass. Example |
IrrXEffectsAddNodeToDepthPass ( barrierNode ) |
IrrXEffectsSetAmbientColor |
Syntax IrrXEffectsSetAmbientColor( R as uinteger, G as uinteger, B as uinteger, Alpha as uinteger ) Description Sets the ambient lighting procuded in the scene by the XEffects system. Example |
IrrXEffectsSetAmbientColor ( 32,32,32,0 ) |
IrrXEffectsSetClearColor |
Syntax IrrXEffectsSetClearColor( R as uinteger, G as uinteger, B as uinteger, Alpha as uinteger ) Description The XEffects system uses a different background color to the one specified in the IrrBeginScene call use this call to set this default background color. Example |
IrrXEffectsSetClearColor ( 255,250,32,0 ) |
IrrXEffectsAddShadowLight |
Syntax IrrXEffectsAddShadowLight( shadowDimen as uinteger, posX as single, byVal posY as single, byVal posZ as single, targetX as single, byVal targetY as single, byVal targetZ as single, R as single, byval G as single, byval B as single, byval Alpha as single, lightNearDist as single, byval lightFarDist as single, angleDegrees as single ) Description Adds a special dynamic shadow casting light to the scene, for each of these lights that you add there is a seperate shadow map created and a seperate render pass so for each light you add the scene takes more memory and gets slower. The first parameter specifies the shadow map resolution for the shadow light. The shadow map is always square, so you need only pass 1 dimension, preferably a power of two between 512 and 2048, maybe larger depending on your quality requirements and target hardware. The pos parameters specify the lights initial position The target parameters is the (look at) target for the light The color setting are the floating point color intensity values of the light The near and far distance of the light are very important values for determining the reach of the light. The last parameter is the FOV (Field of view), since the light is similar to a spot light, the field of view will determine its area of influence. Anything that is outside of a lights frustum (Too close, too far, or outside of it's field of view) will be unlit by this particular light, similar to how a spot light works. Example |
IrrXEffectsAddShadowLight ( 512, 200,200,0, 0,0,0, _ 0.7,0.7,0.6,0.0, 1.0, 1200.0, 89.99 ) |
IrrXEffectsSetShadowLightPosition |
Syntax IrrXEffectsSetShadowLightPosition( lightIndex as uinteger, posX as single, byVal posY as single, byVal posZ as single ) Description Set the position of a shadow light. the index refers to the numerical order in which the lights were added. Example |
IrrXEffectsSetShadowLightPosition ( 0,
200,200,0 ) |
IrrXEffectsGetShadowLightPosition |
Syntax IrrXEffectsGetShadowLightPosition( lightIndex as uinteger, posX as single, byVal posY as single, byVal posZ as single ) Description Get the position of a shadow light. the index refers to the numerical order in which the lights were added. Example |
IrrXEffectsGetShadowLightPosition ( 0, x, y, z
) |
IrrXEffectsSetShadowLightTarget |
Syntax IrrXEffectsSetShadowLightTarget( lightIndex as uinteger, targetX as single, byVal targetY as single, byVal targetZ as single ) Description Set the target location of a shadow light. the index refers to the numerical order in which the lights were added. Example |
IrrXEffectsSetShadowLightTarget ( 0, 25,15,0 ) |
IrrXEffectsGetShadowLightTarget |
Syntax IrrXEffectsGetShadowLightTarget( lightIndex as uinteger, targetX as single, byVal targetY as single, byVal targetZ as single ) Description Get the target location of a shadow light. the index refers to the numerical order in which the lights were added. Example |
IrrXEffectsGetShadowLightTarget ( 0, x, y, z ) |
IrrXEffectsSetShadowLightColor |
Syntax IrrXEffectsSetShadowLightColor( lightIndex as uinteger, R as single, byval G as single, byval B as single, byval Alpha as single ) Description Set the target location of a shadow light. the index refers to the numerical order in which the lights were added. Example |
IrrXEffectsSetShadowLightColor ( 0, 1.0, 0.75,
0.2, 0.0 ) |
IrrXEffectsGetShadowLightColor |
Syntax IrrXEffectsGetShadowLightColor( lightIndex as uinteger, R as single, byval G as single, byval B as single, byval Alpha as single ) Description Get the target location of a shadow light. the index refers to the numerical order in which the lights were added. Example |
IrrXEffectsGetShadowLightColor ( 0, r, g, b, a
) |
IrrGetRootSceneNode |
Syntax irr_node = IrrGetRootSceneNode( ) Description Gets the scenes root node, all scene nodes are children of this node Example |
TheScene = IrrGetRootSceneNode() |
IrrGetMesh |
Syntax irr_mesh = IrrGetMesh( Filename of the mesh object to load as zstring ) Description Loads the specified mesh ready to be added to the scene. The Irrlicht engine supports a wide range of mesh types including BSP, MD2, 3DS, Direct X, etc... Example |
DolphinMesh = IrrGetMesh( "Dolphin.x" ) |
IrrCreateMesh |
Syntax IrrCreateMesh ( mesh_name as zstring ptr, vertex_count as integer, vertices as IRR_VERT, indices_count as integer, indices as ushort) as irr_mesh Description Create a new mesh. You must supply a list of vertices of type IRR_VECT and an array of indices that refer to these vertices. The indices are taken in groups of three joining up the dots defined by the veticies and forming a collection of triangles. Example |
PyramidMesh = IrrCreateMesh( "Pyramid", 5, vertices(0), 18, indicies(0)) |
IrrAddHillPlaneMesh |
Syntax IrrAddHillPlaneMesh ( mesh_name As zString Ptr, tileSizeX As Single, tileSizeY As Single, tileCountX As Integer, tileCountY As Integer, material As uInteger Ptr = 0, hillHeight As Single = 0, countHillsX As Single = 0, countHillsY As Single = 0, textureRepeatCountX As Single = 1, textureRepeatCountY As Single = 1 ) as irr_mesh Description Creates a hill plane mesh that represents a simple terrain. Many properties have default values allowing a mesh to be created with a simple call Example |
TerrainMesh = IrrAddHillPlaneMesh( "Terrain", 1.0, 1.0, 10, 10 ) |
IrrWriteMesh |
Syntax IrrWriteMesh( mesh as irr_mesh, file_format as IRR_MESH_FILE_FORMAT, save_filename as zstring ) as uinteger Description Write the first frame of the supplied animated mesh out to a file using the specified file format. The following file formats are supported by Irrlicht: - Irrlicht Native mesh writer, for static .irrmesh files. COLLADA mesh writer for .dae and .xml files. STL mesh writer for .stl files. The function will return the follow error codes: - (0) Could not get mesh writer object |
if IrrWriteMesh( custom_mesh, EMWT_IRR_MESH,
"mymesh.irr" ) = 3 ? "Wrote the mesh to file successfully" |
IrrRemoveMesh |
Syntax IrrRemoveMesh( mesh as irr_mesh ) Description Removes a mesh from the scene cache, freeing up resources. Example |
IrrRemoveMesh( my_mesh ) |
IrrRenameMesh |
Syntax IrrRenameMesh( mesh as irr_mesh, name as zstring ptr ) Description Rename a loaded mesh through the scene cache, the mesh can then subsequently be loaded again as a different mesh Example |
IrrRenameMesh( my_mesh, "New Name" ) |
IrrClearUnusedMeshes |
Syntax IrrClearUnusedMeshes() Description Clears all meshes that are held in the mesh cache but not used anywhere else. Any references to these meshes will become invalid. Example |
IrrClearUnusedMeshes() |
IrrSetMeshHardwareAccelerated |
Syntax IrrSetMeshHardwareAccelerated ( mesh as irr_mesh, frame number as integer ) Description Set the supplied mesh as a Hardware Accelerated object, this offloads the verticies and indicies to hardware support on the graphics card, making the process of rendering those meshes much faster. The feature must be supported on the graphics card and the object must contain over 500 vertices for the operation to be successful. This operation is applied to all mesh buffers in the mesh. Example |
IrrSetMeshHardwareAccelerated( ShipMesh, 0 ) |
IrrCreateBatchingMesh |
Syntax IrrCreateBatchingMesh ( ) Description Create a batching mesh that will be a collection of other meshes into a single source mesh. The function of the batching mesh is to avoid the use of large numbers of nodes that adds an overhead to the rendering process that can significantly slow it down. Where you have a forest with a thousand trees you will see a significant increase in performance by batching all of those trees into a smaller number of node. Returns: A bactching mesh, while this is handled as an irr_mesh it should only be used with batching mesh commands. Example |
batchingMesh = IrrCreateBatchingMesh( ) |
IrrAddToBatchingMesh |
Syntax IrrAddToBatchingMesh ( meshBatch as irr_mesh, mesh as irr_mesh, posX as single = 0.0f, posY as single = 0.0f, posZ as single = 0.0f, rotX as single = 0.0f, rotY as single = 0.0f, rotZ as single = 0.0f, scaleX as single = 1.0f, scaleY as single = 1.0f, scaleZ as single = 1.0f ) Description Adds a mesh to the batching mesh at the specified position, rotation and scale. If each of your meshes requires a different texture you should call IrrSetMeshMaterialTexture for the mesh you are about to add prior to adding the mesh to the batch. Example |
IrrAddToBatchingMesh( batchingMesh, treeMesh ) |
IrrFinalizeBatchingMesh |
Syntax IrrFinalizeBatchingMesh ( mesh as irr_mesh, frame number as integer ) Description Finalises the batching mesh, this should be called once all of the meshes have been added to the batching mesh. The function returns a new mesh object that can be used in all standard mesh calls.. Example |
Dim as irr_mesh newMesh = IrrFinalizeBatchingMesh( BatchingMesh ) |
IrrGetMeshFrameCount |
Syntax integer = IrrGetMeshFrameCount ( mesh as irr_mesh ) Description Gets the number of frames in the supplied mesh.You can use this value to traverse the indicies and vertices in a mesh containing a number of frames. Example |
MeshFrameCount = IrrGetMeshFrameCount( WolfMesh ) |
IrrGetMeshBufferCount |
Syntax integer = IrrGetMeshBufferCount ( mesh as irr_mesh, frame number as integer ) Description Gets the number of mesh buffers in the supplied mesh.You can use this value to traverse the indicies and vertices in a mesh containing a number of mesh buffers. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. Most meshes only contain one mesh buffer however the artist creating the mesh may decide to break the mesh up into a number of groups of meshes, for example a house might have a roof mesh buffer and a walls mesh buffer. Example |
MeshBufferCount = IrrGetMeshBufferCount( TankMesh, 0 ) |
IrrGetMeshIndexCount |
Syntax integer = IrrGetMeshIndexCount ( mesh as irr_mesh, frame number as integer, mesh_buffer as integer ) Description Gets the number of Indicies in the supplied mesh.You can use this value to allocate an array for reading out the list of indicies in a mesh. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Example |
MeshIndexCount = IrrGetMeshIndexCount( MapMesh, 0,0 ) |
IrrGetMeshIndices |
Syntax IrrGetMeshIndices ( mesh as irr_mesh, frame number as integer , indicies as ushort, mesh_buffer as integer ) Description Gets the list of indices in a mesh and copies them into the supplied buffer. Each index references a vertex in the mesh the indices are grouped into three's and together form a triangular surface. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Indices should be the first element of an array or the first integer in a pool of allocated memory, it is passed into the wrapper by reference as a pointer. You must ensure that the array you supply is large enough to contain all of the indices otherwise an overflow will occur and memory will be corrupted. Example |
IrrGetMeshIndices( MapMesh, 0, Indicies(0),0) |
IrrSetMeshIndices |
Syntax IrrSetMeshIndices( mesh as irr_mesh, frame number as integer , indicies as ushort, mesh_buffer as integer ) Description This sets the value of the list of indicies in a mesh copying them from the supplied buffer. Each index references a vertex in the mesh the indices are grouped into three's and together form a triangular surface. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Indices should be the first element of an array or the first integer in a pool of allocated memory, it is passed into the wrapper by reference as a pointer. You must ensure that the array you supply is large enough to contain all of the indices otherwise an overflow will occur and erroneous values will be written into the mesh causing unpredictable results. Example |
IrrSetMeshIndices( MapMesh, 0, Indicies(0),0) |
IrrGetMeshVertexCount |
Syntax integer = IrrGetMeshVertexCount ( mesh as irr_mesh, frame number as integer, mesh_buffer as integer ) Description Gets the number of Vertices in the supplied mesh.You can use this value to allocate an array for reading out the list of vertices in a mesh. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Example |
MeshVertexCount = IrrGetMeshVertexCount( MapMesh, 0 ) |
IrrGetMeshVertexMemory |
Syntax IrrGetMeshVertexMemory ( mesh as irr_mesh, frame number as integer , mesh_buffer as integer ) Description Get a memory pointer to the vertex memory for the supplied mesh operations can be carried out very quickly on vertices through this function but object sizes and array access needs to be handled by the caller. Example |
Dim as IRR_VERT verts = IrrGetMeshVertexMemory( MapMesh, 0, 0) |
IrrGetMeshVertices |
Syntax IrrGetMeshVertices ( mesh as irr_mesh, frame number as integer , vertices as IRR_VERT, mesh_buffer as integer ) Description Gets the list of vertices in a mesh and copies them into the supplied buffer. Each vertex represents a point in the mesh that is the corner of one of the grou pof triangles that is used to construct the mesh. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Vertices should be the first element of an array or the first IRR_VERT structure in a pool of allocated memory, it is passed into the wrapper by reference as a pointer. You must ensure that the array you supply is large enough to contain all of the vertices otherwise an overflow will occur and memory will be corrupted. Example |
IrrGetMeshVertices( MapMesh, 0, Verticies(0), 0) |
IrrSetMeshVertices |
Syntax IrrSetMeshVertices( mesh as irr_mesh, frame number as integer , indicies as IRR_VERT, mesh_buffer as integer ) Description This sets the value of the list of vertices in a mesh copying them from the supplied buffer. Each vertex represents a point in the mesh that is the corner of one of the grou pof triangles that is used to construct the mesh. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Vertices should be the first element of an array or the first IRR_VERT structure in a pool of allocated memory, it is passed into the wrapper by reference as a pointer. You must ensure that the array you supply is large enough to contain all of the vertices otherwise an overflow will occur and erroneous values will be written into the mesh causing unpredictable results. Example |
IrrSetMeshVertices( MapMesh, 0, Vertices(0), 0) |
IrrSetNodeMesh |
Syntax IrrSetNodeMesh ( node as irr_node, mesh as irr_mesh ) Description Sets the mesh used by a node creaed from a mesh model. Example |
IrrSetNodeMesh( BuildingNode, LowDetailMesh ) |
IrrScaleMesh |
Syntax IrrScaleMesh( mesh as irr_mesh, scale as single, frame number as integer = 0, mesh_buffer as integer = 0, source mesh as irr_mesh = 0 ) Description Scales the verticies in a mesh without affecting the normals, tangents or texture co-ordinates. This is particularly useful for enlarging a mesh without affecting lighting. It should be noted though that scaling the mesh will scale all of the nodes that use it as their source. The scaling is applied unformly to all axis. Example |
IrrScaleMesh( StatueMesh, 2.0 ) |
IrrSetMeshMaterialTexture |
Syntax IrrSetMeshMaterialTexture( mesh as irr_mesh, byval texture as irr_texture, byval material_index as integer, byval buffer as integer = 0 ) Description Apply the supplied texture the specified mesh. Upto four textures can be applied to the material by applying them to different material indicies, these textures can be used by materials or shader functions. Setting a mesh texture will apply the texture to all nodes that use that mesh it can also used for texturing a mesh before it is added to a batch mesh. Example |
IrrSetMeshMaterialTexture( StatueMesh, stoneTexture, 0 ) |
IrrSetMeshVertexColors |
Syntax IrrSetMeshVertexColors( mesh as irr_mesh, frame number as integer , vertexColour as uinteger ptr, vertexGroupStartIndicies as uinteger ptr, vertexGroupEndIndicies as uinteger ptr, numberOfGroups as uinteger, mesh_buffer as integer ) Description This sets the color of groups of verticies in a mesh. You can define any number of groups of verticies and set the color of those group invividually. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Example |
DIM color(0 to 2) as uinteger color(0) = RGBA(255,0,0,0) color(1) = RGBA(255,0,0,0) color(2) = RGBA(255,0,0,0) DIM start as uinteger = 0 DIM end as uinteger = 2 IrrSetMeshVertexColors( MapMesh, 0, @color, @start, @end, 1, 0 ) |
IrrSetMeshVertexCoords |
Syntax IrrSetMeshVertexCoords( mesh as irr_mesh, frame number as integer , vertexCoordinates as IRR_VECTOR Ptr, vertexGroupStartIndicies as uinteger ptr, vertexGroupEndIndicies as uinteger ptr, numberOfGroups as uinteger, mesh_buffer as integer ) Description This sets the co-ordinates of groups of verticies in a mesh. You can define any number of groups of verticies and set the color of those group invividually. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Example |
DIM pos(0 to 2) as IRR_VECTOR pos(0).x = 0 : pos(0).y = 0 : pos(0).z = 0 pos(1).x = 1 : pos(1).y = 0 : pos(1).z = 0 pos(2).x = 0 : pos(2).y = 1 : pos(2).z = 0 DIM start as uinteger = 0 DIM end as uinteger = 2 IrrSetMeshVertexCoords( MapMesh, 0, @color, @start, @end, 1, 0 ) |
IrrSetMeshVertexSingleColor |
Syntax IrrSetMeshVertexSingleColor( mesh as irr_mesh, frame number as integer , vertexColour as uinteger ptr, vertexGroupStartIndicies as uinteger ptr, vertexGroupEndIndicies as uinteger ptr, numberOfGroups as uinteger, mesh_buffer as integer ) Description This sets the color of groups of verticies in a mesh. You can define any number of groups of verticies and set the color of those group invividually. If the mesh is animated frame number indicates the number of the frame to recover mesh data for if it is not animated this value should be set to 0. If the mesh contains a number of mesh buffers you can specific which mesh buffer you want to access, if you omit this parameter mesh buffer 0 will be used. Example |
DIM start as uinteger = 0 DIM end as uinteger = 2 IrrSetMeshVertexSingleColor( MapMesh, 0, RGBA(255,255,255,255), @start, @end, 1, 0 ) |
IrrGetMeshBoundingBox |
Syntax IrrGetMeshBoundingBox( mesh as irr_mesh, min X as single, min Y as single, min Z as single, min X as single, min Y as single, min Z as single ) Description Gets the bounding box of a mesh into the supplied variables, the six paramters define the corners of an axis aligned cube that contains the whole mesh. Example |
IrrGetMeshBoundingBox( MapMesh, topX, topY, topZ, bottomX, bottomY, bottomZ ) |
IrrAddMeshToScene |
Syntax irr_node = IrrAddMeshToScene( Mesh object as irr_mesh ) Description Adds a mesh to the scene as a new 3D 'node'. Example |
DolphinMesh = IrrGetMesh( "Dolphin.x" ) SceneNode = IrrAddMeshToScene( DolphinMesh ) |
IrrAddMeshToSceneAsOcttree |
Syntax irr_node = IrrAddMeshToSceneAsOcttree ( Mesh object as irr_mesh ) Description Adds a mesh to the scene as a new 3D 'node'. This method optimise's the mesh with an Octtree, this is particularly useful for maps where there is a lot of geometry in the mesh but little of it can be seen at any one time. Optimizing your node with this function will result in a large increase in performance. Example |
MapMesh = IrrGetMesh( "ctfblue.bsp" ) MapNode = IrrAddMeshToSceneAsOcttree( MapMesh ) |
IrrAddStaticMeshForNormalMappingToScene |
Syntax irr_node = IrrAddStaticMeshForNormalMappingToScene( Mesh object as irr_mesh ) Description Adds a mesh to the scene as a static object, the mesh is altered so that it is suitable for the application of a Normal or Parallax mapping material, any animation information is lost. Example |
StoneRoomMesh = IrrGetMesh( "StoneRoom.x" ) SceneNode = IrrAddStaticMeshForNormalMappingToScene( StoneRoomMesh ) IrrSetNodeMaterialTexture( SceneNode, colorMap, 0 ) IrrSetNodeMaterialTexture( SceneNode, normalMap, 1 ) IrrMaterialSetSpecularColor( IrrGetMaterial( SceneNode ), 0, 0, 0 ) IrrSetNodeMaterialType( SceneNode, EMT_PARALLAX_MAP_SOLID ) ' adjust the height of the paralax effect IrrMaterialSetMaterialTypeParam( IrrGetMaterial( SceneNode ), 0.035f ) |
IrrLoadScene |
Syntax IrrLoadScene ( file_name As zString Ptr ) Description Loads all meshes and creates nodes for a scene defined within a file created by IrrEdit. Example |
IrrLoadScene( "Map1.irr" ) |
IrrSaveScene |
Syntax IrrSaveScene ( file_name As zString Ptr ) Description Saves the current scene into a file that can be loaded by irrEdit. Example |
IrrSaveScene( "MyScene.irr" ) |
IrrGetSceneNodeFromId |
Syntax Irr_node = IrrGetSceneNodeFromId( id as integer ) Description Get a scene node based on its ID and returns null if no node is found. This is particularly useful for obtaining references to nodes created automatically when using IrrLoadScene. Example |
IrrNode = IrrGetSceneNodeFromId( 15 ) |
IrrGetSceneNodeFromName |
Syntax Irr_node = IrrGetSceneNodeFromId( id as zstring ptr ) Description Get a scene node based on its name and returns null if no node is found. This is particularly useful for obtaining references to nodes created automatically when using IrrLoadScene. Example |
IrrNode = IrrGetSceneNodeFromName( "Box" ) |
IrrAddBillBoardToScene |
Syntax irr_node = IrrAddBillBoardToScene ( X size of the node as integer, Y size of the node as integer, X position as integer, Y position as integer, Z position as integer) Description Adds a billboard to the scene of the specified size and at the specified position. A billboard is a flat 3D textured sprite that always faces towards the camera. You need to texture this element with a separate command. Example |
Billboard = IrrAddBillBoardToScene( 10.0,8.0, 0,0,0 ) |
IrrSetBillBoardColor |
Syntax irr_node = IrrSetBillBoardColor ( node as irr_node, topColor as uinteger, bottomColor as integer ) Description Set the color of the top and bottom verticies in a billboard applying a vertical graduated shade to it. The colors should be generated with the FreeBasic RGBA function Example |
IrrSetBillBoardColor( Billboard, RGBA(255,255,255,255), RGBA(0,0,0,0)) |
IrrSetBillBoardSize |
Syntax irr_node = IrrSetBillBoardSize ( node as irr_node, BillWidth as single, BillHeight as single ) Description Adds a billboard to the scene of the specified size and at the specified position. A billboard is a flat 3D textured sprite that always faces towards the camera. You need to texture this element with a separate command. Example |
IrrSetBillBoardSize( Billboard, 10.0, 8.0 ) |
IrrAddBillboardTextSceneNode |
Syntax irr_node = IrrAddBillboardTextSceneNode ( font as irr_font, text as wstring, X size of the node as integer, Y size of the node as integer, X position as integer, Y position as integer, Z position as integer, parent as irr_node, topColor as uinteger, bottomColor as uinteger ) Description Adds a text billboard to the scene of the specified size and at the specified position. A text billboard is a flat 3D textured sprite that always faces towards the camera and has the supplied text written onto it. You should not texture this element. font defines the font that is used to generate the text. text is a wide character string containing the text you want to display on the billboard. X_size and Y_size define the width and height of the billboard X, Y and Z define the position of the billboard. Parent defines the object that is the parent to this billboard, if there is no parent this should be set to IRR_NO_OBJECT topColor is the colour value of the top of the text on the billboard. This can be created with hte RGBA command. bottomColor is the colour value of the bottom of the text on the billboard. This can be created with hte RGBA command. Example |
Billboard = IrrAddBillboardTextSceneNode( _ font, "Hello World", _ 64.0, 12.0, _ 0.0, 40.0, 0.0, _ parentNode, _ RGBA(255,255,0,0), _ RGBA(255,0,0,255)) |
IrrAddParticleSystemToScene |
Syntax node as irr_particle_system =IrrAddParticleSystemToScene ( add_emitter ) Description Adds a particle system to the scene as a node, a particle system is an object that creates and manages hundreds of small billboard like objects that are used to represent smoke, rain and other natural effects. Once created you then need to add emitters and affecters to create and control the particles. Add emitter can be one of the following values: - IRR_NO_EMITTER For no default emitter (this is probably the option you will use and you will then add a specific emitter later) IRR_DEFAULT_EMITTER To create a default emitter that ejects a thin vertical stream of particles. Example |
Smoke = IrrAddParticleSystemToScene( IRR_NO_EMITTER ) |
IrrAddSkyBoxToScene |
Syntax irr_node = IrrSkyBoxToScene ( up_texture as irr_texture, down_texture as irr_texture, left_texture as irr_texture, right_texture as irr_texture, front_texture as irr_texture, back_texture as irr_texture ) Description Adds a skybox node to the scene this is huge hollow cube that encapsulates the entire scene and has a different texture applied to each of its six surfaces to represent a distant sky or matte scene. Example |
SkyBox = IrrAddSkyBoxToScene( _ IrrGetTexture("./media/irrlicht2_up.jpg"),_ IrrGetTexture("./media/irrlicht2_dn.jpg"),_ IrrGetTexture("./media/irrlicht2_lf.jpg"),_ IrrGetTexture("./media/irrlicht2_rt.jpg"),_ IrrGetTexture("./media/irrlicht2_ft.jpg"),_ IrrGetTexture("./media/irrlicht2_bk.jpg")) |
IrrAddSkyDomeToScene (contributed by Eponasoft ) |
Syntax irr_node = IrrAddSkyDomeToScene ( texture as irr_texture, horizontal_res as uinteger, vertical_res as uinteger, texture_percentage as double, sphere_percentage as double, sphere_radius as single ) Description Adds a skydome node to the scene this is huge hollow sphere (or part of a sphere) that encapsulates the entire scene to represent a distant sky or matte scene. The horizontal and vertical resolution define the number of segments in the mesh of the sphere (setting these too high can quickly produce a very costly mesh). Texture percentage defines the amount of the texture that is mapped to the scene, this should be a value between 0 and 1 (0 being non of the texture and 1 being the whole texture). Finally sphere percentage defines how much of a sphere is created and should be a value between 0 and 2 (0 being none of a sphere, 1 being a hemi-sphere and 2 being a full sphere). Example |
SkyBox = IrrAddSkyDomeToScene( IrrGetTexture("./media/domesky.jpg"), 8, 8, 1.0, 2.0, 10000.0 ); |
IrrAddEmptySceneNode |
Syntax irr_node = IrrAddEmptySceneNode Description Adds an empty node to the scene. This is required if you wish to add custom OpenGL commands with no Irrlicht Objects. Example |
EmptyNode = IrrAddEmptySceneNode |
IrrAddTestSceneNode |
Syntax irr_node = IrrAddTestSceneNode Description Adds a simple cube object to the scene. This is particularly useful for testing and is a quick and easy way of playing objects into the scene for testing placement. Example |
TestBox = IrrAddTestSceneNode |
IrrAddCubeSceneNode |
Syntax irr_node = IrrAddCubeSceneNode( size as single ) Description Adds a simple cube object to the scene with the specified dimensions. Example |
MyCube = IrrAddCubeSceneNode( 10.0 ) |
IrrAddSphereSceneNode |
Syntax irr_node = IrrAddSphereSceneNode( radius as single, poly_count as integer ) Description Adds a simple sphere object to the scene of the specified radius and with the specified level of detail. A reasonable value for poly_count would be 16 setting this value too high could produce a very high density mesh and affect your frame rate adversely. Example |
MySphere = IrrAddSphereSceneNode( 0.5, 16 ) |
IrrAddWaterSurfaceSceneNode (contributed by Eponasoft ) |
Syntax irr_node = IrrAddWaterSurfaceSceneNode ( mesh as irr_mesh, waveHeight as Single = 2.0, waveSpeed as Single = 300.0, waveLength as Single = 10.0, parent as irr_scene_node = 0, id as Integer = -1, positionX as Single = 0, positionY as Single = 0, positionZ as Single = 0, rotationX as Single = 0, rotationY as Single = 0, rotationZ as Single = 0, scaleX as Single = 1.0, scaleY as Single = 1.0, scaleZ as Single = 1.0) Description Adds a mesh with a water animator applied to it, the mesh is animated automatically to simulate a water effect across its surface. Many properties are predefined for this node and a convincing water effect can be created simply by supplying the parameter for the mesh, however the node can be positioned, rotated and scaled by this call and the appearance of the waves on its surface can be adjusted. Example |
WaterNode = IrrAddWaterSurfaceSceneNode( pond_mesh ) |
IrrAddZoneManager |
Syntax irr_node = IrrAddZoneManager ( initialNearDistance as single, initialFarDistance as single ) Description Adds a zone/distance management node to the scene. This simple but very powerful object has no visible geometry in the scene, it is used by attaching other nodes to it as children. When the camera is further away than the far distance and closer than the near distance to the zone manager all of the zones child objects are made invisible. This allows you to group objects together and automatically have them hidden from the scene when they are too far away to see. By using the near distance you could have two sets of objects in the scene one with high detail for when you are close and another with low detail for when you are far away. Another way to use the zone manager would be to test when your camera is inside the zones bounding box and switch its visibility on and off manually. Example |
zone = IrrAddZoneManager(100,300) |
IrrAddClouds (Node by G Davidson) |
Syntax irr_node = IrrAddClouds ( texture as irr_texture, lod as uinteger, depth as uinteger, density as uinteger ) Description Adds a set of clouds to the scene. These clouds are most appropriate to a cloud effect experienced by a vehicle flying through them and could be of particular use in masking the transition of a spacecraft from an orbital vantage point to a flat terrain object. They do make a nice ordernary cloud effect too but can appear unrealistic when they are directly over the observer. LOD defeines the level of detail in the cloud, more detail is added into the cloud depending on the distance of the observer from the object. depth defines the depth of recursion when creating the cloud and finally density defines the number of clouds in the cloud object. Example |
CloudNode = IrrAddClouds( CloudTexture, 3, 1, 500 ) |
IrrAddLensFlare (Node by Paulo Oliveira with updates from gammaray and torleif) |
Syntax irr_node = IrrAddLensFlare ( texture as irr_texture ) Description Adds a lens flare patch object to the scene, this object simulates the effect of bright lights on the optics of a camera., the position of the lens flare can be set and changed with the IrrSetNodePosition command. The lens flare obejct uses a bitmap containing a series of 128x128 images representing stages of the the lens flare effect. Example |
SceneNode = IrrAddLensFlare( LensTexture ) |
IrrAddGrass (Node by G Davidson) |
Syntax irr_node = IrrAddGrass ( terrain as irr_terrain, x as integer, y as integer, patchSize as integer, fadeDistance as single, crossed as integer, grassScale as single, maxDensity as uinteger, dataPositionX as integer, dataPositionY as integer, heightMap as irr_image, textureMap as irr_image, grassMap as irr_image, grassTexture as irr_texture ) Description Adds a grass object to the scene. Grass objects are associated with terrain and tile terrain objects and are used to place small billboard objects into the scene representing folliage, this implementation of grass creates a large number of grass objects already positioned across the terrain and then dynamically shows or hides them depending on where the camera is within the scene. The grass is also affected with a wind modifier that gently moves the grass as if it were caught in the wind (by setting the speed of the wind to zero the grass will become static and you will see an increase in performance). The position and size of the patch of grass can be set with x, y, patchSize and grassScale. FadeDistance controls the distance at which the number of displayed grass elements in that patch are reduced. If this is set to 1.0 then when the cameral is inside the patch all of grass will be displayed but once outside less and less will be shown. By increasing this to 2.0 then all of the grass is shown until the camera is two patches distant. This gives a better appearence but reduces performance as more grass has to be drawn. crossed can be set to either IRR_ON or IRR_OFF. When off each piece of grass is a separate entity with its own position and rotation. When On grass is paired up and placed to form a cross. Crossed grass can have a better appearance as you rotate around it. However individual grass can give the impression that there is more of it and you can therefore reduce the number of grass blades and increase performance. MaxDensity controls the number of individual clumps of folliage that are created. Dataposition X and Y can be used with a large bitmap associated with a tiled terrain and allow the color information to be taken from an offset position on the bitmap. Heightmap is an image that contains the height of the terrain onto which the grass is placed. TextureMap is the color map used to color the verticies of the grass and allow you to create areas of dark of light grass, you can use the terrain color map here. GrassMap is an image used to adjust the height and density of the grass. For example you might have a patch where you dont want to see any grass or a barren patch where you want short stubble. GrassTexture is the actually texture used for the grass. This RGBA image is automatically broken up into a number of sections that are used to texure different clumps of grass. Grass usually looks best when it is closely matched to the color of the terrain and to assist with this a new Material Type has been added IRR_EMT_TRANSPARENT_ADD_ALPHA_CHANNEL_REF that adds the color of grass texture to the color of the grass which is automatically set to the color of the terrain that it lies upon. Example |
grassNode = IrrAddGrass ( Terrain, x, y, 1024, 1.0, 250, 0, 0, terrainHeight, terrainColor, grassMap, grassTexture ) |
IrrSetShadowColor |
Syntax IrrSetShadowColor ( Alpha as integer, Red as integer, Green as integer, Blue as integer ) Description Sets the color of shadows cast by objects in the scene. If you are observing a bright scene you might use a light grey shadow instead of a heavy black shadow to add to realism. Example |
IrrSetShadowColor( 0, 128, 128, 128 ) |
IrrSetFog |
Syntax irr_node = IrrSetFog ( Red as integer, Green as integer, Blue as integer, fogtype as integer, fog_start as single, fog_end as single, density as single ) Description Set the properties of fog in the scene. Red, Green and Blue define the fog color, you should set this to the same color as your sky so the scene fogs out nicely into nothing. These are integer values in the range of 0 to 255 Fogtype specifies whether you want the fog to increase in a linear mannar or exponentially - exponential fog usually looks more atmospheric while linear looks more like a dense sea fog. This may be specified as either IRR_LINEAR_FOG IRR_EXPONENTIAL_FOG Fog start and end specify the distance at which the fog starts and the distance at which the fog reaches its maximum density. The values here will depend on the size and scale of the scene. Density is only used with exponential fog and determines how quickly the exponential change takes place, good values for this range from 0 to 1 Example |
ThinFog = IrrSetFog ( 240,255,255, IRR_EXPONENTIAL_FOG, 0.0,8000.0, 0.5 ) |
IrrDraw3DLine |
Syntax IrrDraw3DLine( x_start as single, y_start as single, z_start as single, x_end as single, y_end as single, z_end as single, Red as integer, Green as integer, Blue as integer ) Description Draws a line onto the display using 3D co-ordinates and a specified color. Example |
IrrBeginScene( 240, 255, 255 ) IrrDraw3DLine( 0.0, 0.0, 0.0, 0.0, 50.0, 0.0, 0, 255, 0 ) IrrDrawScene |
IrrSetSkyDomeColor |
Syntax IrrSetSkyDomeColor( dome as irr_node, horizontalRed as uinteger, horizontalGreen as uinteger, horizontalBlue as uinteger, zenithRed as uinteger, zenithGreen as uinteger, zenithBlue as uinteger ) Description Set the color of the verticies in the skydome. Two colors are defined one for the horizon and another for the top of the sky dome, this simulates the type of coloring effects you see in the sky. If you are using a full spherical skydome the horizontal color will be the color at the bottom of the skydome. Example |
' color the skydome so that it is brighter at the
horizon and a darker blue at the top of the sky IrrSetSkyDomeColor( SkyDome, 128, 128, 255, 64, 64, 255 ) |
IrrSetSkyDomeColorBand |
Syntax IrrSetSkyDomeColorBand( dome as irr_node, horizontalRed as uinteger, horizontalGreen as uinteger, horizontalBlue as uinteger, bandVerticalPosition as integer, bandFade as single, addative as uinteger ) Description Creates a horizontal band of color in the skydome, this is mainly useful for creating additional bands of color at the horizon, where your sky is a graduation of blues and then in the morning you have a brighter golden band as the sun rises. The vertical position in the vertex at which you wish to create the band, bandFade defines the amount that the band is faded into the existing skydome color, addative can be IRR_ON to add the color of the band to the existing color of the skydome or IRR_OFF to replace it. Example |
' add a band of golden color at the horizon IrrSetSkyDomeColorBand ( SkyDome, 240,220,128, 24, 0.25, IRR_ON ) |
IrrSetSkyDomeColorPoint |
Syntax IrrSetSkyDomeColorPoint( dome as irr_node, Red as uinteger, Green as uinteger, Blue as uinteger, pointXPosition as single, pointYPosition as single, pointZPosition as single, pointRadius as single, pointFade as single, addative as uinteger ) Description Set the color of the verticies in the skydome radiating out from a point. This is powerful effect that can be used to color parts of the skydome and create effects to represent the glows of the rising sun or the moon in the sky. The radius is used to limit the distance of the coloring, pointFade defines the amount that the band is faded into the existing skydome color and addative can be IRR_ON to add the color of the band to the existing color of the skydome or IRR_OFF to replace it. Example |
' add a bright golden circle of light at the same point
as the rising sun IrrSetSkyDomeColorPoint ( SkyDome, 255,220,96, 1000.0, -250.0, 0.0, 1500.0, 0.75, IRR_ON ) |
IrrSetZoneManagerProperties |
Syntax IrrAddZoneManager ( zoneManager as irr_node, newNearDistance as single, newFarDistance as single, accumulateChildBoxes as uinteger ) Description Sets the draw distances of nodes in the zone/distance management node and whether or not the zone manager is to accumulate the bounding boxes of its children as they are added. Example |
IrrSetZoneManagerProperties( zone, 0, 600, IRR_ON ) |
IrrSetZoneManagerBoundingBox |
Syntax IrrSetZoneManagerBoundingBox ( zoneManager as irr_node, x as single, y as single, z as single, boxWidth as single, boxHeight as single, boxDepth as single ) Description Allows the user to manually set the bounding box of a zone manager node. Example |
IrrSetZoneManagerBoundingBox( zone, 0, 0, 0, 100, 100, 100 ) |
IrrSetZoneManagerAttachTerrain |
Syntax IrrSetZoneManagerAttachTerrain ( zoneManager as irr_node, terrain as irr_terrain, structureMapFile as zstring ptr, colorMapFile as zstring ptr, detailMapFile as zstring ptr, ImageX as integer, ImageY as integer, sliceSize as integer ) Description A special feature of the zone manager is its ability to manage tiled terrain nodes, a zone does this by taking position of an attached terrain object that it shares with other zone objects whenever the camera starts to come into range. The terrain object is loaded with new height information, color and detail ready for when it becomes visible to the camera. The structureMapFile is the name of an RGBA bitmap file that is to be used to set the structure of the terrain. The Alpha channel is used to set the height and the RGB channels are used to set the color of the vertex at that position. This can be used to load lighting into the scene or to load detail map blending into the scene for simple terrain spattering (discussed in the tile terrain section). The optional color and detail maps are loaded to apply new color and detail maps to the terrain. If either is not used they should be replaced with IRR_NO_OBJECT. The Image X and Y define the X and Y position of this tile on the structure and color images, so you could load a 1024x1024 structure image and a 1024x1024 detail image in and have your zones form a grid across these large bitmaps. Finally SilceSize allows you to only process a slice of the terrain on each frame, as a tile is swapped loading in bitmaps and then adjusting what could be 65,000 vertices in a single frame will cause a noticable hiccup in the smooth running of the scene, so by setting the SliceSize you can define how many rows of the terrain are to be processed on each frame.for example if your tile is 128x128 you might process 32 rows, the tile would then be restructured over 4 frames instead of trying to do it all in one. Note: You can load your images manually to save them with IrrGetImage and IrrGetTexture and let them stay in memory to avoid having to load images while the scene is running however you should stay aware of how much memory you are using especially the graphics card memory used by IrrGetTexture. Example |
IrrSetZoneManagerAttachTerrain ( Zone(X + Y*ROW_SIZE), Terrain(index), "SunnyValley.tga", "SunnyValley.bmp", IRR_NO_OBJECT, X*112, Y*112, 32 ) |
IrrSetGrassDensity |
Syntax IrrSetGrassDensity ( grass as irr_node, density as integer, distance as single ) Description Set grass density, density being the number of grass nodes visible in the scene and distance being the distance at which they can be seen. Example |
IrrSetGrassDensity ( grassNode, 300, 4000 ) |
IrrSetGrassWind |
Syntax IrrSetGrassWind ( grass as irr_node, strength as single, resoloution as single ) Description Set the grass wind effect, the strength being the strength of the wind, the resoloution being how often the effect is calculated. By setting the resoloution to zero the wind effect will be stopped and there will be a performance increase however the wind effect adds significantly to the subtle atmosphere of the scene. Example |
IrrSetGrassWind ( grassNode, 3.0, 1.0 ) |
IrrGetGrassDrawCount |
Syntax uinteger = IrrGetGrassDrawCount ( grass as irr_node ) Description Get the number of grass objects drawn. Example |
VisibleGrass = IrrGetGrassDrawCount( Grass ) |
IrrSetFlareScale |
Syntax IrrSetFlareScale ( flare as irr_node, source as single, optics as single ) Description Sets the scale of optics in the scene. The source is the texture used to surround the light source while the options are the scale of textures in the optics of the camera. Sometimes it is effected to make the scale of the source considerably larger than those of the optics and to scale the effect in the optics down so that their appearence is more subtle. Example |
IrrSetFlareScale ( FlareNode, 2.0, 1.0 ) |
IrrAddLODManager |
Syntax node = IrrAddLODManager ( fadeScale as uinteger = 4, useAlpha as uinteger = IRR_ON, callback as any ptr = 0 ) Description Adds a level of detail manager to the scene. The primary use for this node is to add other scene nodes to it as children and have their level of detail controlled automatically. If those nodes are made from loaded meshs different meshes containing different amounts of detail can be displayed at different distances. The other function of the LOD manager is to fade nodes in an out at a specific distance so they gradually fade rather than disappear abruptly. This is achieved by applying a distance without supplying a mesh. fadeScale is the number of 1/4 seconds that the node takes to fade out or in. 4 units equals 1 second. useAlpha specifies whether or not the Alpha color of the object is faded too. the callback function is called whenever a node is made invisible or visible. this allows you to stop processing hidden nodes. Example |
LODManager = IrrAddLODManager( 4, IRR_ON,
@NodeChangeCallback ) IrrAddLODMesh( LODManager, 0.0, LOD1Mesh ) IrrAddLODMesh( LODManager, 400.0, IRR_NO_OBJECT ) |
IrrAddLODMesh |
Syntax IrrAddLODMesh ( node as irr_node, distance as single, mesh as irr_mesh ) Description Set the distance at which a particular mesh is to be applied to child mesh nodes. if no mesh is supplied it specifies the distance at which the node should be faded in an out. node is the LOD manager node distance is the distance at which this effect will be applied mesh is the mesh used at this distance and beyond or null to specifiy the limit of visibility for this node. Example |
LODManager = IrrAddLODMesh( 4, IRR_ON,
@NodeChangeCallback ) IrrAddLODMesh( LODManager, 0.0, LOD1Mesh ) IrrAddLODMesh( LODManager, 400.0, IRR_NO_OBJECT ) |
IrrSetLODMaterialMap |
Syntax IrrSetLODMaterialMap ( node as irr_node, source as IRR_MATERIAL_TYPES, target as IRR_MATERIAL_TYPES ) Description Specifies which material is used to apply the fade effect for another material type. How this is used will depend on the effect that you want to achieve. By default fading is applied with the IRR_EMT_TRANSPARENT_VERTEX_ALPHA material. node is the LOD manager node source is the material type your node uses target is the material type used for the fade effect. Example |
IrrSetLODMaterialMap( LODManager, IRR_EMT_TRANSPARENT_ADD_COLOR, IRR_EMT_TRANSPARENT_ADD_COLOR) |
IrrAddBillBoardGroupToScene |
Syntax node = IrrAddBillBoardGroupToScene ( ) Description Adds a billboard group to the scene. This is a special object that can have billboard like objects added and removed from it and rendered in a very quick an efficient manner. They are all treated as a single object rather than as many individual nodes. This is particuallarly useful for custom particle effects. Example |
BillboardGroup = IrrAddBillBoardGroupToScene |
IrrAddBillBoardToGroup |
Syntax BillboardAddress = IrrAddBillBoardToGroup ( group as irr_node, _ sizex as single, sizey as single, _ x as single = 0, y as single = 0, z as single = 0, _ roll as single = 0, _ A as uinteger = 255, R as uinteger = 255, G as uinteger = 255, B as uinteger = 255 ) Description Adds a billboard to a billboard group. There are a number of properties that are used to specify the billboard. group is the billboard group node sizex and sizey are the x and y sizes of the billboard x, y and z define the position of the billboard roll specifies the number of degrees that the billboard is spun around its center. A, R, G and B specify the color used for the billboard Example |
BillboardAddress = IrrAddBillBoardToGroup(
BillboardGroup,_ 200.0, 200.0, _ 0.0, 0.0, 0.0, _ 0.0, _ 0, 255, 255, 255 ) |
IrrAddBillBoardByAxisToGroup |
Syntax BillboardAddress = IrrAddBillBoardByAxisToGroup ( group as irr_node, _ sizex as single, sizey as single, _ x as single = 0, y as single = 0, z as single = 0, _ roll as single = 0, _ A as uinteger = 255, R as uinteger = 255, G as uinteger = 255, B as uinteger = 255, _ axis_x as single = 0, axis_y as single = 0, axis_z as single = 0 ) Description Adds a billboard to a billboard group that is fixed to a particular axis these billboards are particularly useful for things like grass..There are a number of properties that are used to specify the billboard. group is the billboard group node sizex and sizey are the x and y sizes of the billboard x, y and z define the position of the billboard roll specifies the number of degrees that the billboard is spun around its center. A, R, G and B specify the color used for the billboard axis_x, axis_y, axis_z a direction around which the billboard is spun to face the camera Example |
BillboardAddress = IrrAddBillBoardByAxisToGroup(
BillboardGroup,_ 200.0, 200.0, _ 0.0, 0.0, 0.0, _ 0.0, _ 0, 255, 255, 255, _ 0.0, 1.0, 0.0 ) |
IrrRemoveBillBoardFromGroup |
Syntax IrrRemoveBillBoardFromGroup ( group as irr_node, billboardAddress as any ptr ) Description Removes the specified billboard from the billboard group Example |
IrrRemoveBillBoardFromGroup ( BillboardGroup,
BillboardAddress ) |
IrrBillBoardGroupShadows |
Syntax IrrBillBoardGroupShadows ( group as irr_node, _ x as single = 1.0, y as single = 0, z as single = 0, _ intensity as single = 1.0, ambient as single = 0.0 ) Description Applies lighting to the billboards in a cluster of billboards. This can be used for example to shade the particles in a group of billboards representing a cloud. group is the group of billboards to which the lighting is to be applied. x, y and z is the direction from which the light is arriving intensity is the strength of the light ambient is the strength of ambient light in the billboard group Example |
IrrBillBoardGroupShadows( BillBoardGroup, 1.0, 0.0,
0.0, 1.0, 0.5 ) |
IrrGetBillBoardGroupCount |
Syntax uinteger = IrrGetBillBoardGroupCount ( group as irr_node ) Description Get the number of billboards in the billboard group. Example |
count = IrrGetBillBoardGroupCount (
BillboardGroup ) |
IrrBillBoardForceUpdate |
Syntax IrrBillBoardForceUpdate ( group as irr_node ) Description Unlike regular billboards the billboard group does not always update the orientation of the billboards every frame. If you are a long distance away from the billboard group the camera needs to travel a significant distance before the angle has changed enough to warrent an update of all of the billboards verticies to make them point to the camera once more. You may want to force a refresh at some point with this call. Example |
IrrBillBoardForceUpdate ( BillboardGroup ) |
IrrAddBoltSceneNode (Scene Node created by Sudi with extensions by Trivtn) |
Syntax irr_node = IrrAddBoltSceneNode ( ) Description The bolt is a special scene node that can be used to replicate electrical effects. This command simply adds the bolt you should then make a call to set the bolts properties. This node can be used to simulate lightning and other electrical effects. Example |
ElectricNode = IrrAddBoltSceneNode( ) IrrSetBoltProperties ( SceneNode, _ 0,90,0, _ ' the start point for the bolt 0,0,0, _ ' the end point for the bolt 50, _ ' the bolt updates every 50 miliseconds 10, _ ' the bolt is 10 units wide 5, _ ' the bolt is 5 units thick 10, _ ' there are 10 sub parts in each bolt 4, _ ' there are 4 individual bolts IRR_ON, _ ' the end is not connected to an exact point RGBA( 255, 255, 255, 0 )) ' Lighting color |
IrrSetBoltProperties |
Syntax IrrSetBoltProperties ( bolt as irr_node, _ startX as single, startY as single, startZ as single, _ endX as single, endY as single, endZ as single, _ updateTime as uinteger = 50, _ radius as uinteger = 10, _ thickness as single = 5.0, _ parts as uinteger = 10, _ bolts as uinteger = 6, _ steadyend as uinteger = IRR_OFF, _ boltColor as uinteger = RGBA(0,0,255,255)) Description This sets the properties of a bolt node that simulates an electrical effect. There are a number of properties that control many aspects of the bolt to produce a wide range of appearences.. Start X, Y and Z define the point that the bolt origionates from. End X,Y and Z| define the terminating point for the bolt. Update time specifies the number of miliseconds between updates to the appearence of the bolt. Radius is the radius of the entire bolt effect. Thickness is the thickness of a single electrical element in the bolt. Parts defines the number of segments the bolt is divided into. Bolts represents the number of individual electrical arcs that are rendered. SteadyEnd when set to IRR_ON ends in a tight point, when set to IRR_OFF it ends with the same width as the rest of the bolt. Color specifies the diffuse color that is applied to the bolt. Example |
ElectricNode = IrrAddBoltSceneNode( ) IrrSetBoltProperties ( SceneNode, _ 0,90,0, _ ' the start point for the bolt 0,0,0, _ ' the end point for the bolt 50, _ ' the bolt updates every 50 miliseconds 10, _ ' the bolt is 10 units wide 5, _ ' the bolt is 5 units thick 10, _ ' there are 10 sub parts in each bolt 4, _ ' there are 4 individual bolts IRR_ON, _ ' the end is not connected to an exact point RGBA( 255, 255, 255, 0 )) ' Lighting color |
IrrAddBeamSceneNode (Scene Node by Gaz Davidson (Blindside)) |
Syntax irr_node = IrrAddBeamSceneNode ( ) Description The beam is a special scene node that can be used to replicate beam effects like lasers and tracer gun fire. This command simply adds the beam you should then make calls to set the beams properties. Example |
BeamNode = IrrAddBeamSceneNode ( ) IrrSetBeamSize ( BeamNode, 5.0 ) IrrSetBeamPosition ( BeamNode, X,Y,Z, X+100,Y,Z ) |
IrrSetBeamSize |
Syntax IrrSetBeamSize ( beam as irr_node, size as single ) Description This call sets the width of a beam node Example |
IrrSetBeamSize ( BeamNode, 5.0 ) |
IrrSetBeamPosition |
Syntax IrrSetBeamPosition ( beam as irr_node, _ startX as single, startY as single, startZ as single, _ endX as single, endY as single, endZ as single ) Description This call sets the start and end positions of a beam node. The beam will stretch between the two nodes. Start X, Y and Z define the point that the bolt origionates from. End X,Y and Z| define the terminating point for the bolt. Example |
IrrSetBeamPosition ( BeamNode, X,Y,Z,
X+100,Y,Z ) |
IrrGetNodeName |
Syntax const zstring ptr = IrrGetNodeName ( node as irr_node ) Description Get the name of the node. Example |
NodeName = IrrGetNodeName( StatueNode ) |
IrrSetNodeName |
Syntax IrrSetNodeName ( node as irr_node, name as zstring ptr ) Description Set the name of a node Example |
IrrSetNodeName( StatueNode, "HeroStatue" ) |
IrrGetNodeMesh |
Syntax irr_mesh = IrrGetNodeMesh ( node as irr_node ) Description Get the mesh that is associated with a node Example |
myMesh = IrrGetNodeMesh( StatueNode ) |
IrrGetMaterialCount |
Syntax integer = IrrGetMaterialCount ( node as irr_node ) Description Get the number of materials associated with a node. Example |
nummaterials = IrrGetMaterialCount( StatueNode ) |
IrrGetMaterial |
Syntax irr_material = IrrGetMaterial( node as irr_node, material_index as integer ) Description Get the material associated with the node at the particular index Example |
current_material = IrrGetMaterial( StatueNode, index ) |
IrrSetNodeMaterialTexture |
Syntax IrrSetNodeMaterialTexture( node as irr_node, texture as irr_texture, material_index as integer ) Description Applys a texture to a node in the scene, how the texture is applied across the surface of the node will depend on the texturing co-ordinates in each of the vectors of the mesh and how they are plotted across the surface of the texture. Some nodes can have several textures applied to them to create special material effects. Node refers to a node you have added to the scene. Texture refers to a texture you have loaded from an image file. Material is the index number of the material layer, this will usually be 0 or 1. Example |
IrrSetNodeMaterialTexture( DolphinNode, DolphinTexture, 0) |
IrrSetNodeMaterialFlag |
Syntax IrrSetNodeMaterialFlag( node as irr_node, flag as IRR_MATERIAL_TYPES, value as uinteger ) Description Sets material properies of a node that will effect its appearance on the screen, each of these properties can be either switched on or off. Node refers to a node that has been added to the scene. Flag is one of the following properties: - IRR_EMF_WIREFRAME Render as wireframe outline IRR_EMF_GOURAUD_SHADING Render smoothly across polygons IRR_EMF_LIGHTING Material is effected by lighting IRR_EMF_ZBUFFER Enable z buffer IRR_EMF_ZWRITE_ENABLE Can write as well as read z buffer IRR_EMF_BACK_FACE_CULLING Cull polygons facing away IRR_EMF_BILINEAR_FILTER Enable bilinear filtering IRR_EMF_TRILINEAR_FILTER Enable trilinear filtering IRR_EMF_ANISOTROPIC_FILTER Reduce blur in distant textures IRR_EMF_FOG_ENABLE Enable fogging in the distance IRR_EMF_NORMALIZE_NORMALS Use when scaling dynamically lighted models The value should be one of the following to switch the property on or off: - IRR_ON IRR_OFF Example |
IrrSetNodeMaterialFlag( CharacterNode, IRR_EMF_GOURAUD_SHADING, IRR_ON ) |
IrrSetNodeMaterialType |
Syntax IrrSetNodeMaterialType( node as irr_node, mat_type as IRR_MATERIAL_FLAGS ) Description Set the way that materials are applied to the node. Node refers to a node that has been added to the scene. Mat_type is one of the following properties that is applied to the node: - IRR_EMT_SOLID Standard solid rendering uses one texture IRR_EMT_SOLID_2_LAYER 2 blended textures using vertex alpha value IRR_EMT_LIGHTMAP 2 textures: 0=color 1=lighting level and ignores vertex lighting IRR_EMT_LIGHTMAP_ADD ... as above but adds levels instead of modulating between them IRR_EMT_LIGHTMAP_M2 ... as above but color levels are multiplied by 2 for brightening IRR_EMT_LIGHTMAP_M4 ... as above but color leels are multiplied by 4 for brightening IRR_EMT_LIGHTMAP_LIGHTING 2 textures: 0=color 1=lighting level but supports dynamic lighting IRR_EMT_LIGHTMAP_LIGHTING_M2 ... as above but color levels are multiplied by 2 for brightening IRR_EMT_LIGHTMAP_LIGHTING_M4 ... as above but color levels are multiplied by 4 for brightening IRR_EMT_DETAIL_MAP 2 blended textures: the first is a color map the second at a different scale adds and subtracts from the color to add detail IRR_EMT_SPHERE_MAP makes the material appear reflective IRR_EMT_REFLECTION_2_LAYER a reflective material blended with a color texture IRR_EMT_TRANSPARENT_ADD_COLOR a transparency effect that simply adds a color texture to the background. the darker the color the more transparent it is. IRR_EMT_TRANSPARENT_ALPHA_CHANNEL a transparency effect that uses the color textures alpha as a transparency level IRR_EMT_TRANSPARENT_ALPHA_CHANNEL_REF a transparency effect that uses the color textures alpha, the pixel is only drawn if the alpha is > 127. this is a fast effect that does not blur edges and is ideal for leaves & grass etc. IRR_EMT_TRANSPARENT_VERTEX_ALPHA a transparency effect that uses the vertex alpha value IRR_EMT_TRANSPARENT_REFLECTION_2_LAYER a transparent & reflecting effect. the first texture is a reflection map, the second a color map. transparency is from vertex alpha IRR_EMT_NORMAL_MAP_SOLID A solid normal map renderer. First texture is color, second is normal map. Only use nodes added with IrrAddStaticMeshForNormalMappingToScene. Only supports nearest two lights. Requires vertex and pixel shaders 1.1 IRR_EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR ... as above only with a transparency effect that simply adds the color to the background. the darker the color the more transparent it is. IRR_EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA ... as above only with a transparency effect that uses the vertex alpha value IRR_EMT_PARALLAX_MAP_SOLID similar to the solid normal map but more realistic providing virtual displacement of the surface. Uses the alpha channel of the normal map for height field displacement. Requires vertex shader 1.1 and pixel shader 1.4. IRR_EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR ... as above only with a transparency effect that simply adds the color to the background. the darker the color the more transparent it is. IRR_EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA ... as above only wiht a transparency effect that uses the vertex alpha value Example |
IrrSetNodeMaterialType( WaterNode, IRR_EMT_LIGHTMAP ) |
IrrSetNodePosition |
Syntax IrrSetNodePosition( node as irr_node, X as single, Y as single, Z as single ) Description Moves the node to the new position. Example |
IrrSetNodePosition( CharacterNode, 500.0, 100.7, -192.6) |
IrrSetNodeRotation |
Syntax IrrSetNodeRotation( node as irr_node, X as single, Y as single, Z as single ) Description Rotate a node to the specified orientaion through its X, Y and Z axis Example |
IrrSetNodeRotation( CharacterNode, 34.5 0.76, -67.3 ) |
IrrSetNodeScale |
Syntax IrrSetNodeScale( node as irr_node, X as single, Y as single, Z as single ) Description Change the scale of a node in the scene making it bigger or smaller in the X, Y and Z axis Example |
IrrSetNodeScale( CharacterNode, 1.2,1.5,1.2 ) |
IrrSetNodeRotationPositionChange |
Syntax IrrSetNodeRotationPositionChange( node as irr_node, roll as single, pitch as single, yaw as single, drive as single, strafe as single, elevate as single, forwardVector as IRR_VECTOR ptr, upVector as IRR_VECTOR ptr, offsetVectorCount as integer, offsetVectors as IRR_VECTOR ptr ) Description Apply a change in rotation and a directional force. we can also optionally recover pointers to a series of vectors. The first is a pointer to a vector pointing forwards the second is a pointer a vector pointing upwards following this are any number of points that will also be rotated (the effect on these points is NOT accumulative so the points should be initialised with their origonal values each time this is called) Example |
IrrSetNodeRotationPositionChange( SceneNode, roll, pitch, yaw, drive, strafe, elevate, @forwardVector, @upVector, 2, @cameraVector(0)) |
IrrDebugDataVisible |
Syntax IrrDebugDataVisible ( node as irr_node, visible as integer ) Description Displays debugging data around a node, this typically means drawing the bounding box around the edges of the node. There are a series of values for displaying different types of debugging information and not all of them are supported on all node types 0 No Debugging 1 Bounding Box 2 Normals 4 Skeleton 8 Wireframe 16 Transparency 32 Bounding Box Buffers &hffffffff Everything Example |
IrrDebugDataVisible ( PyramidNode, 1 ) |
IrrGetNodePosition |
Syntax IrrGetNodePosition( node as irr_node, X as single, Y as single, Z as single ) Description Gets the position of a node in the scene and stores its X, Y and Z co-ordinates into the supplied variables. Example |
IrrGetNodePosition( CharacterNode, XPosition, YPosition, ZPosition ) |
IrrGetNodeAbsolutePosition |
Syntax IrrGetNodeAbsolutePosition( node as irr_node, X as single, Y as single, Z as single ) Description Get the absoloute position of the node in the scene this position includes the position changes of all of the nodes parents too. Example |
IrrGetNodeAbsolutePosition( CharacterNode, XPosition, YPosition, ZPosition ) |
IrrGetNodeRotation |
Syntax IrrGetNodeRotation( node as irr_node, X as single, Y as single, Z as single ) Description Get the rotation of a node in the scene and stores the X, Y and Z rotation values in the supplied variables.. Example |
IrrGetNodeRotation( CharacterNode, XRotation, YRotation, ZRotation ) |
IrrGetNodeScale |
Syntax IrrGetNodeScale( node as irr_node, X as single, Y as single, Z as single ) Description Get the scale of a node in the scene and stores the X, Y and Z scale values in the supplied variables.. Example |
IrrGetNodeScale( CharacterNode, XScale, YScale, ZScale ) |
IrrGetJointNode |
Syntax irr_node = IrrGetJointNode ( node as irr_node, joint_name as zstring ptr ) Description This supplies you with an invisible node that follows the motion of a particular joint in an animated models skeleton. You can use this to attach child nodes that represent objects a person is carrying for example. (This call now replaces IrrGetMS3DJointNode and IrrGetDirectXJointNode which are only supplied for backwards compatibility). It can now also be used to manually move the joint. The name should refer to the name of a joint in the model. Example |
HandNode = IrrGetJointNode( CharacterNode, "LeftHand" ) |
IrrAddChildToParent |
Syntax IrrAddChildToParent ( child as irr_node, parent as irr_node ) Description Attaches the child node to the parent node, whenever you change the parent node the child node changes too. This is useful for putting a cup in a characters hand for example. You can move and rotate the child node to move the object into position against its parent. Example |
IrrAddChildToParent( CupNode, CharacterNode) |
IrrGetNodeFirstChild |
Syntax irr_node = IrrGetNodeFirstChild ( node as irr_node, searchPosition as any ptr ) Description Get the first child node of this node, returns 0 if there is no child. Example |
ChildNode = IrrGetNodeFirstChild ( SectorNode, position ) |
IrrGetNodeNextChild |
Syntax irr_node = IrrGetNodeNextChild ( node as irr_node, searchPosition as any ptr ) Description Get the next child node of this node, returns 0 if there is no child. Example |
ChildNode = IrrGetNodeNextChild( SectorNode, position ) |
IrrIsNodeLastChild |
Syntax integer = IrrIsNodeLastChild ( child as irr_node, parent as irr_node ) Description Attaches the child node to the parent node, whenever you change the parent node the child node changes too. This is useful for putting a cup in a characters hand for example. You can move and rotate the child node to move the object into position against its parent. Example |
if IrrIsNodeLastChild( SectorNode, position )
= 0 then LastNode = IRR_YES end if |
IrrAddNodeShadow |
Syntax irr_node = IrrAddNodeShadow ( node as irr_node, mesh as irr_mesh = 0 ) Description Adds shadows to a node that are cast across other nodes in the scene, shadowing need to be turned on when you call IrrStart. You should analyse the performance of your scene carefully when using this function as it can have a significant effect on your frame rate. You can supply a different mesh to the one used to display the node, this shadow mesh could be a much lower resoloution than that used for your model thereby improving performance. Example |
IrrAddNodeShadow ( CharacterNode ) |
IrrSetNodeVisibility |
Syntax IrrSetNodeVisibility ( node as irr_node, visible as integer ) Description This allows you to hide nodes from the display so you can quickly and easily switch objects out to improve performance or create effects liek one node transforming into another node (perhaps in a puff of particle smoke). Visible can be one of the following values: - IRR_INVISIBLE IRR_VISIBLE Example |
IrrSetNodeVisibility( CharacterNode, IRR_VISIBLE ) |
IrrRemoveNode |
Syntax IrrRemoveNode( node as irr_node ) Description Removes a node from the scene deleting it. Example |
IrrRemoveNode( CharacterNode ) |
IrrRemoveAllNodes |
Syntax IrrRemoveAllNodes() Description Clears the entire scene, any references to nodes in the scene will become invalid. Example |
IrrRemoveAllNodes() |
IrrSetNodeParent |
Syntax IrrSetNodeParent ( node as irr_node, parent as irr_node ) Description Sets the parent of the specified node. Example |
ParentNode = IrrSetNodeParent( ChildNode, ParentNode ) |
IrrGetNodeParent |
Syntax irr_node = IrrGetNodeParent ( node as irr_node ) Description Gets the parent of the specified node. Example |
ParentNode = IrrGetNodeParent( ChildNode ) |
IrrGetNodeID |
Syntax integer = IrrGetNodeID ( node as irr_node ) Description Each node can have a 32 bit signed identification number assigned to them this can be used in collision operations to filter out particular classes of object. Example |
NodeID = IrrGetNodeID( TreeNode ) |
IrrSetNodeID |
Syntax IrrSetNodeID ( node as irr_node, id as integer ) Description Adds a simple cube object to the scene. This is particularly useful for testing and is a quick and easy way of playing objects into the scene for testing placement. Example |
IrrSetNodeID ( TreeNode, 8 ) |
IrrGetNodeBoundingBox |
Syntax integer = IrrGetNodeBoundingBox ( node as irr_node, x1 as single, y1 as single, z1 as single, x2 as single, y2 as single, z2 as single, ) Description Gets the coordiantes describing the bounding box of the node into the six supplied variables. Example |
NodeID = IrrGetNodeBoundingBox( BuildingNode, Xa, Ya, Za, Xb, Yb, Zb ) |
IrrGetNodeTransformedBoundingBox |
Syntax integer = IrrGetNodeTransformedBoundingBox ( node as irr_node, x1 as single, y1 as single, z1 as single, x2 as single, y2 as single, z2 as single, ) Description Gets the transformed (absolute value) bounding box of a node into the six supplied variables. So if your node has been moved hundreds of units away from the origion the co-ordinates of its bounding box will also be hundreds of units away corisponding to its real location in the scene. Example |
NodeID = IrrGetNodeTransformedBoundingBox( BuildingNode, Xa, Ya, Za, Xb, Yb, Zb ) |
IrrSetNodeAnimationRange |
Syntax IrrSetNodeAnimationRange( node as irr_node, Start Frame as integer, End Frame as integer ) Description Sets the range of animation that is to be played in the node. An anaimation sequences might run from 0 to 200 frames and a sequence where your character is running might only occupy a portion of this. Example |
IrrSetNodeAnimationRange( CharacterNode, 50, 75 ) |
IrrPlayNodeMD2Animation |
Syntax IrrPlayNodeMD2Animation ( node as irr_node, sequence as uinteger ) Description MD2 format models have specific animation sequences contained within them that can be played back with a simple call. sequence should be one of the following values: - IRR_EMAT_STAND IRR_EMAT_RUN IRR_EMAT_ATTACK IRR_EMAT_PAIN_A IRR_EMAT_PAIN_B IRR_EMAT_PAIN_C IRR_EMAT_JUMP IRR_EMAT_FLIP IRR_EMAT_SALUTE IRR_EMAT_FALLBACK IRR_EMAT_WAVE IRR_EMAT_POINT IRR_EMAT_CROUCH_STAND IRR_EMAT_CROUCH_WALK IRR_EMAT_CROUCH_ATTACK IRR_EMAT_CROUCH_PAIN IRR_EMAT_CROUCH_DEATH IRR_EMAT_DEATH_FALLBACK IRR_EMAT_DEATH_FALLFORWARD IRR_EMAT_DEATH_FALLBACKSLOW IRR_EMAT_BOOM Example |
IrrPlayNodeMD2Animation( CharacterNode, IRR_EMAT_STAND ) |
IrrSetNodeAnimationSpeed |
Syntax IrrSetNodeAnimationSpeed ( node as irr_node, speed as integer ) Description Change the speed at which an animation is played for a node. You could use this to make a character run slowly or quickly and still keep its feet on the ground. Example |
IrrSetNodeAnimationSpeed( CharacterNode, 25 ) |
IrrGetNodeAnimationFrame |
Syntax uinteger = IrrGetNodeAnimationFrame( node as irr_node ) Description Get the frame number that is currently being played by the node. Example |
CurrentFrame = IrrGetNodeAnimationFrame( AnimNode ) |
IrrSetNodeAnimationFrame |
Syntax IrrSetNodeAnimationFrame( node as irr_node, frame as integer ) Description Set the current frame number being played in the animation Example |
IrrSetNodeAnimationFrame( CharacterNode, 75 ) |
IrrSetTransitionTime |
Syntax IrrSetTransitionTime ( node as irr_node, speed as single ) Description Sets the transition time across which two poses of an animated mesh are blended. For example a character in a sitting pose can be switched into a lying down pose by blending the two frames, this will provide a more convincing smooth transition instead of a snap change in position. IrrAnimateJoints must be called before IrrDrawScene if blending is used. Example |
IrrSetTransitionTime( CharacterNode, 0.75 ) |
IrrAnimateJoints |
Syntax IrrAnimateJoints( node as irr_node ) Description Animates the mesh based on the position of the joints, this should be used at the end of any manual joint operations including blending and joints animated using IRR_JOINT_MODE_CONTROL and IrrSetNodeRotation on a bone node. Example |
IrrAnimateJoints( CharacterNode ) |
IrrSetJointMode |
Syntax IrrSetJointMode ( node as irr_node, mode as uinteger ) Description Sets the animation mode of joints in a node. When using the control mode IrrAnimateJoints must be called before IrrDrawScene. IRR_JOINT_MODE_NONE will result in no animation of the model based on bones IRR_JOINT_MODE_READ will result in automatic animation based upon the animation defined with calls like IrrSetNodeAnimationRange IRR_JOINT_MODE_CONTROL will allow the position of the bones to be set through code Example |
IrrSetJointMode( CharacterNode, IRR_JOINT_MODE_CONTROL ) |
IrrAddCollisionAnimator |
Syntax irr_animator = IrrAddCollisionAnimator ( selector as irr_selector, node as irr_node, radius x as single, radius y as single, radius z as single, gravity x as single, gravity y as single, gravity z as single, offset x as single, offset y as single, offset z as single ) Description This adds a collision animator to a node that applies collision detection and gravity to the object. The collision detection will stop the object penetrating through a surface in the objects it is colliding against and will also press it against the surface using gravity. Selector represents a selection of triangles in the scene, this is usually all of the triangles in a map for instance. Please refer to the section on collision for further details of how to obtain this object. Radius X, Radius Y and Radius Z define an ellipsoid that defines the area of collision this eliptical shape allows the collision detection to slide the object up steps and even ladders. If you make it too big you might be too large to get through a doorway but if you make it too small you may not be able to climb steps. You should play with these values and find the best ones for your scene. Gravity X, Gravity Y and Gravity Z work together to specify the force that is applied to the node to make it drop to the ground. Other values could be used to simulate wind effects. Offset X, Offset Y and Offset Z are used to offset the node by a specific distance from the center of the collision, as the center of the object and the size of your collision ellipsoid vary you can use this to adjust the position of the node and to bring it into contact with the ground. Example |
CollisionAnimator = IrrAddCollisionAnimator( MapCollision, CameraNode, 30.0,30.0,30.0, 0.0,-3.0,0.0, 0.0,50.0,0.0 ) |
IrrAddDeleteAnimator |
Syntax irr_animator = IrrAddDeleteAnimator ( node as irr_node, milliseconds to deletion as integer ) Description This animator deletes the node it is attached to after the specified number of milliseconds (1/1000ths of a second). You could use this animator to delete a falling rock for example, all you would need to do is attach the delete animator, a movement animator and then forget about it. Example |
DeleteAnimator = IrrAddDeleteAnimator( RockNode, 3000 ) |
IrrAddFadeAnimator |
Syntax irr_animator = IrrAddFadeAnimator ( node as irr_node, milliseconds to deletion as integer, scale as single ) Description This animator deletes the node it is attached to after the specified number of milliseconds (1/1000ths of a second). During the time while it is waiting to delete it the node is slowly faded to invisibility and is also scaled by the specified amount. You could use this animator to fade and delete an object from a scene that was no longer required like a used medical pack, all you would need to do is attach the fade animator and forget about it. Example |
FadeAnimator = IrrAddFadeAnimator( MedicalNode, 3000, 0.0 ) |
IrrAddFlyCircleAnimator |
Syntax irr_animator = IrrAddFlyCircleAnimator ( node as irr_node, center x as single, center y as single, center z as single, radius as single, speed as single ) Description This animator moves the node it is attached to in a circular path. Center X, Center Y and Center Z define the center of the circular path. Radius defines the radius of the path Speed defines the rate the node moves around the circular path Example |
CircleAnimator = IrrAddFlyCircleAnimator( PowerNode, 0,0,0 50, 20 ) |
IrrAddFlyStraightAnimator |
Syntax irr_animator = IrrAddFlyStraightAnimator ( node as irr_node, start x as single, start y as single, start z as single, end x as single, end y as single, end z as single, time to complete as uinteger, loop path as integer ) Description This animator makes the node it is attached to move in a straight line from the start to the end end point. It would be useful for objects moving on a conveyor belt for example Start X, Start Y and Start Z specify the start point of the path. End X, End Y and End Z specify the end point of the path. Time to complete specifies the number of milliseconds the animator will take to move the node from the start to the end point Loop path determines if the node will be moved from the start to the end and then stopped or whether the animation will be looped this parameter should be either: - IRR_ONE_SHOT For a single animation and then stop IRR_LOOP To continuously repeat the animation Example |
FlyAnimator = IrrAddFlyStraightAnimator( AnimatedBox, 0,50,-300, 0,50,300, 3000, IRR_LOOP ) |
IrrAddRotationAnimator |
Syntax irr_animator = IrrAddRotationAnimator ( node as irr_node, x as single, y as single, z as single ) Description This animator makes the node it is attached to spin around. X, Y and Z specify the number of radians the object is spun around each axis Example |
RotationAnimator = IrrAddRotationAnimator( DisplayCaseNode, 0, 0.1, 0 ) |
IrrAddSplineAnimator |
Syntax irr_animator = IrrAddSplineAnimator ( node as irr_node, array size as integer, x as single, y as single, z as single, time to start as integer, speed as single, tightness as single ) Description This is one of the more difficult to set up of the animators but is very natural looking and powerful. A spline is a curved line that passes through or close to a list of co-ordinates, creating a smooth flight. This animator needs a list of coordinates stored in three arrays, one array each for the X, Y and Z locations of all the points. A good way to get co-ordinates for these arrays is to load in the camera position example program and move your camera to a point and write down its co-ordinates. Array size specifies how many points there are in your spline motion. The three arrays X, Y and Z containing co-ordinates are passed by reference as a pointer therefore you should ensure that the array is the correct size otherwise unpredictable results will be obtained. Time to start specifies the number of milliseconds that must pass before the animation starts. Speed defines the rate the node moves along the spline curve. Tightness specifies how tightly the curve is tied to the points (0 is angular and 1 is very loose) Example |
SplineX(0) = -100 : SplineY((0) =
50 : SplineZ((0) = 0 SplineX(1) = 0 : SplineY((1) = 100 : SplineZ((1) = -100 SplineX(2) = 100 : SplineY((2) = 50 : SplineZ((2) = 0 SplineX(3) = 0 : SplineY((3) = 100 : SplineZ((3) = 100 SplineAnimator = IrrAddSplineAnimator( CameraNode, 4, SplineX(0), SplineY(0), SplineZ(0), 0, 0.5, 1) |
IrrRemoveAnimator |
Syntax IrrRemoveAnimator ( node as irr_node, node as irr_animator ) Description This removes an animator from a node. Stopping the animation or cleaning an animator up so you can apply a new one. Example |
IrrRemoveAnimator( DoorNode, FlyAnimator ) |
IrrGetCollisionGroupFromMesh |
Syntax irr_selector = IrrGetCollisionGroupFromMesh ( mesh as irr_mesh, node as irr_node ) Description Creates a collision object from the triangles contained within the specified mesh as applied to the position, rotation and scale of the supplied node. Example |
ObjectSelector = IrrGetCollisionGroupFromMesh( SimpleBuildingMesh, MyBuilding ) |
IrrGetCollisionGroupFromComplexMesh |
Syntax irr_selector = IrrGetCollisionGroupFromComplexMesh ( mesh as irr_mesh, node as irr_node) Description Creates an optimized triangle selection group from a large complex mesh like a map. This group can then be used in collision functions to collide objects against this node. You need to supply both the mesh the node was created from and the node itself. Example |
MapSelector = IrrGetCollisionGroupFromComplexMesh( MapMesh, MapNode ) |
IrrGetCollisionGroupFromBox |
Syntax irr_selector = IrrGetCollisionGroupFromBox ( node as irr_node ) Description Creates a collision object from the bounding box of a node. Example |
ObjectSelector = IrrGetCollisionGroupFromBox( CharacterNode ) |
IrrGetCollisionGroupFromTerrain |
Syntax irr_selector = IrrGetCollisionGroupFromTerrain ( node as irr_node, level of detail as integer ) Description Creates a collision object from a terrain node. A higher level of detail improves the collision detection but consumes more resources and can effect the speed of the process. Example |
TerrainSelector = IrrGetCollisionGroupFromTerrain( TerrainNode, 1 ) |
IrrRemoveCollisionGroup |
Syntax IrrRemoveCollisionGroup ( collisionGroup as irr_selector, node as irr_node ) Description Remove the collision selector from memory. This collision selector must not be attached to another collision group when it is removed, the collision group is first removed from the node you supply. Example |
IrrRemoveCollisionGroup( buildingCollision, buildingNode ) |
IrrAttachCollisionGroupToNode |
Syntax IrrAttachCollisionGroupToNode ( collisionGroup as irr_selector, node as irr_node ) Description Attaches a collision group that you have already created from a mesh and a node to another node without duplicating the collision geometry. Example |
IrrAttachCollisionGroupToNode( boxCollision, anotherBoxNode ) |
IrrSetNodeTriangleSelector |
Syntax IrrSetNodeTriangleSelector ( node as irr_node, collisionGroup as irr_selector ) Description Assigns a collision group to a specific node.. Example |
IrrSetNodeTriangleSelector( newBuilding, buildingCollision ) |
IrrCreateCombinedCollisionGroup |
Syntax irr_selector = IrrCreateCombinedCollisionGroup Description Creates a collision object that can be used to combine several collision objects together so you could add a couple of maps and a terrain for example. Initially the combined collision object is empty. Example |
SelectorGroup = IrrCreateCombinedCollisionGroup |
IrrAddCollisionGroupToCombination |
Syntax IrrAddCollisionGroupToCombination ( combined collision group as irr_selector, collision group as irr_selector ) Description Adds a collision object to group of collision objects. Example |
IrrAddCollisionGroupToCombination( SelectorGroup,
MapSelector ) IrrAddCollisionGroupToCombination( SelectorGroup, TerrainSelector ) |
IrrRemoveAllCollisionGroupsFromCombination |
Syntax IrrRemoveAllCollisionGroupsFromCombination ( combined collision group as irr_selector ) Description Empty a collision group object so that you can add different collision groups to it. Example |
IrrRemoveAllCollisionGroupsFromCombination( SelectorGroup ) |
IrrRemoveCollisionGroupFromCombination |
Syntax IrrRemoveCollisionGroupFromCombination ( combined collision group as irr_selector, collision group as irr_selector ) Description Remove a single specified collision object from a group of collision objects. Example |
IrrRemoveCollisionGroupFromCombination( SelectorGroup, TerrainSelector ) |
IrrGetCollisionPoint |
Syntax integer = IrrGetCollisionPoint ( start as IRR_VECTOR, line_end as IRR_VECTOR, collision group as irr_selector, collision point as IRR_VECTOR ) Description Detect the collision point of a ray in the scene with a collision object if a collision was detected 1 is returned and vector collision contains the co-ordinates of the point of collision Start defines the start point of the ray and End defines the endpoint Collision group is a selector object created with one of the above functions. Collision point is the co-ordinates in 3D space of the collision object the ray and the selector object. Example |
collided
= IrrGetCollisionPoint ( StartVector, EndVector, CharacterSelector,
CollisionVector ) |
IrrGetRayFromScreenCoordinates |
Syntax IrrGetRayFromScreenCoordinates ( screen x as integer, screen y as integer, camera as irr_camera, ray start as IRR_VECTOR, ray end as IRR_VECTOR ) Description Gets a ray that goes from the specified camera and through the screen coordinates the information is copied into the supplied start and end vectors. You can then use this ray in other collision operations. Example |
IrrGetRayFromScreenCoordinates ( screen_x, screen_y, CameraNode, StartVector, EndVector ) |
IrrGetCollisionNodeFromCamera |
Syntax irr_node = IrrGetCollisionNodeFromCamera ( camera as irr_camera ) Description A ray is cast through the camera and the nearest node that is hit by the ray is returned. If no node is hit zero is returned for the object Example |
TargetedNode = IrrGetCollisionNodeFromCamera ( CameraNode ) |
IrrGetCollisionNodeFromRay |
Syntax irr_node = IrrGetCollisionNodeFromRay ( start as IRR_VECTOR, line_end as IRR_VECTOR ) Description A ray is cast through the supplied coordinates and the nearest node that is hit by the ray is returned. If no node is hit zero is returned for the object Example |
TargetedNode = IrrGetCollisionNodeFromRay( RayStartVector, RayEndVector ) |
IrrGetCollisionNodeFromScreenCoordinates |
Syntax irr_node = IrrGetCollisionNodeFromScreenCoordinates ( screen x as integer, screen y as integer ) Description A ray is cast through the screen at the specified co-ordinates and the nearest node that is hit by the ray is returned. If no node is hit zero is returned for the object. Example |
SelectedNode = IrrGetCollisionNodeFromScreenCoordinates( MouseX, MouseY ) |
IrrGetScreenCoordinatesFrom3DPosition |
Syntax IrrGetScreenCoordinatesFrom3DPosition ( screen x as integer, screen y as integer, at position as IRR_VECTOR ) Description Screen co-ordinates are returned for the position of the specified 3D co-ordinates as if an object were drawn at them on the screen, this is ideal for drawing 2D bitmaps or text around or on your 3D object on the screen for example in the HUD of an aircraft. After the call Screen X and Screen Y will contain the co-ordinates. Example |
IrrGetScreenCoordinatesFrom3DPosition ( XPosition, YPosition, RocketVector ) |
IrrGet2DPositionFromScreenCoordinates (contributed by agamemnus) |
Syntax IrrGet2DPositionFromScreenCoordinates ( screenx As integer, screeny As integer, x As Single, y As Single, camera As irr_camera ) Description Calculates the intersection between a ray projected through the specified screen co-ordinates and a plane at the world origin. The Parameters X, Y and Z will recieve the 2D position where the line through the screen intersects with the plane. Example |
IrrGet2DPositionFromScreenCoordinates ( 256, 256, x, y,
OurCamera ) IrrSetNodePosition( MyCursor, XPosition, YPosition, ZPosition ) |
IrrGet3DPositionFromScreenCoordinates (contributed by agamemnus) |
Syntax IrrGet3DPositionFromScreenCoordinates ( screenx as integer, screeny as integer, x as single, y as single, z as single, camera as irr_camera, normalX as single = 0.0, normalY as single = 0.0, normalZ as single = 1.0, distanceFromOrigin as single = 0.0 ) Description Calculates the intersection between a ray projected through the specified screen co-ordinates and a plane defined from a normal and the distance of that plane from the world origin. The Parameters X, Y and Z will recieve the 3D position where the line through the screen intersects with the plane. Example |
IrrGet3DPositionFromScreenCoordinates (
ScreenX, ScreenY, XPosition,
YPosition, ZPosition, MyCamera ) IrrSetNodePosition( MyModel, XPosition, YPosition, ZPosition ) |
IrrGetChildCollisionNodeFromRay |
Syntax irr_node = IrrGetChildCollisionNodeFromRay ( node as irr_node, idMask as integer, recurse as uinteger, start as IRR_VECTOR, line_end as IRR_VECTOR ) Description A ray is cast through the supplied coordinates and the nearest node that is hit by the ray is returned. if no node is hit zero is returned for the object, only a subset of objects are tested, i.e. the children of the supplied node that match the supplied id.Iif the recurse option is enabled the entire tree of child objects connected to this node are tested. Example |
IrrGetChildCollisionNodeFromRay ( SectorNode, 100, IRR_OFF, StartPoint, EndPoint ) |
IrrGetChildCollisionNodeFromPoint |
Syntax irr_node = IrrGetChildCollisionNodeFromPoint ( node as irr_node, idMask as integer, recurse as uinteger, point as IRR_VECTOR ) Description The node and its children are recursively tested and the first node that contains the matched point is returned. if no node is hit zero is returned for the object, only a subset of objects are tested, i.e. the children of the supplied node that match the supplied id. if the recurse option is enabled the entire tree of child objects connected to this node are tested. Example |
IrrGetChildCollisionNodeFromPoint ( SectorNode, 100, IRR_ON, TestPoint ) |
IrrGetNodeAndCollisionPointFromRay |
Syntax irr_node = IrrGetNodeAndCollisionPointFromRay ( vectorStart as IRR_VECTOR, vectorEnd as IRR_VECTOR, node as irr_node, posX as single, posY as single, posZ as single, normalX as single, normalY as single, normalZ as single, id as integer = 0, rootNode as irr_node = IRR_NO_OBJECT ) Description A ray is cast through the specified co-ordinates and the nearest node that has a collision selector object that is hit by the ray is returned along with the coordinate of the collision and the normal of the triangle that is hit. if no node is hit zero is returned for the object. If a node is supplied for the rootNode that tests for collision start from that node and are only tested against that node and its children. Example |
IrrGetRayFromScreenCoordinates ( screen_x, screen_y,
CameraNode, StartVector, EndVector ) IrrGetNodeAndCollisionPointFromRay ( StartVector, EndVector, collidedNode, hitX, hitY, hitZ, normalX, normalY, normalZ, 0, myRoom ) if NOT collidedNode = IRR_NO_OBJECT then Print "We hit something" end if |
IrrGetDistanceBetweenNodes |
Syntax distance = IrrGetDistanceBetweenNodes ( nodeA as IRR_NODE, nodeA as IRR_NODE ) Description The distance between two nodes is measured using fast maths functions that will show inaccuracies. Useful for when it is nessecary to test distances between many nodes.. Example |
Dim As Single Distance =
IrrGetDistanceBetweenNodes( nodeA, nodeB ) |
IrrAreNodesIntersecting |
Syntax test = IrrAreNodesIntersecting ( nodeA as IRR_NODE, nodeA as IRR_NODE ) Description Tests whether the bounding boxes are two nodes are intersecting. Bounding boxes are axis aligned and do not rotate when you rotate the nodes. This should be kept in mind when testing for collisions. Example |
If NOT IrrAreNodesIntersecting ( nodeA, nodeB
) = 0 Then Print "Collision" End If |
IrrIsPointInsideNode |
Syntax irr_node = IrrIsPointInsideNode ( node as IRR_NODE, X as Single, Y as Single, Z as Single ) Description Determine if the specified point is inside the bounding box of the node. Example |
If NOT IrrIsPointInsideNode ( node, X, Y, Z )
= 0 Then Print "Point is inside Node" End If |
IrrGetCollisionResultPosition (contributed by The Car) |
Syntax IrrGetCollisionResultPosition ( selector As irr_selector, ellipsoidPosition As IRR_VECTOR, ellipsoidRadius As IRR_VECTOR, velocity As IRR_VECTOR, gravity As IRR_VECTOR, slidingSpeed as single, outPosition As IRR_VECTOR, outHitPosition As IRR_VECTOR, outFalling As Integer ) Description Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid, the point at which the elipsoid collided with the surface and whether the ellipsoid is falling through the air. 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. Example |
IrrGetCollisionResultPosition ( _ collisionGroup, _ vectPosition, _ vectRadius, _ vectVelocity, _ vectGravity, _ 0.00005, _ vectResultPosition, _ vectHitPosition areFalling ) IrrSetNodePosition( rockNode, vectPosition.X, vectPosition.Y, vectPosition.Z ) |
IrrAddFPSCamera |
Syntax irr_camera = IrrAddFPSCamera Description Adds a 'first person shooter' style camera into the scene that will be used to define the view point and target point and other attributes of the view into the 3D scene. If you haven't captured mouse and keyboard events this camera can be controlled with the cursor keys and the mouse. Example |
FPSCamera = IrrAddFPSCamera |
IrrAddCamera |
Syntax irr_camera = IrrAddCamera ( camera X as single, camera Y as single, camera Z as single, target X as single, target Y as single, target Z as single ) Description Adds a camera to into the scene that will be used to define the view point and target point and other attributes of the view into the 3D scene. Animators and other node functions can be applied to this node. Camera X, Camera Y and Camera Z define the view point of the camera. Target X, Target Y and Target Z define the target of the camera, Example |
CameraObject = IrrAddCamera( 100,0,0, 0,-10,0) |
IrrAddMayaCamera |
Syntax irr_camera = IrrAddMayaCamera ( parent as irr_node, rotateSpeed as single, zoomSpeed as single, moveSpeed as single ) Description Adds a Maya style camera to into the scene the user can click with the left, middle and right mouse buttons to move, zoom and rotate the camera. rotateSpeed the speed at which the camera revolves zoomSpeed the speed at which the camera zooms in and out moveSpeed the speed at which the camera moves Example |
CameraObject = IrrAddMayaCamera( IRR_NO_OBJECT, 100.0, 100.0, 100.0 ) |
IrrSetCameraTarget |
Syntax IrrSetCameraTarget ( camera as irr_camera, X as single, Y as single, Z as single ) Description The camera view point can be moved by simply using the IrrSetNodePosition function but this operation will change the point that the camera is pointing at. Example |
IrrSetCameraTarget ( CameraObject, 0, 50, 0 ) |
IrrGetCameraTarget |
Syntax IrrGetCameraTarget ( camera as irr_camera, X as single, Y as single, Z as single ) Description Get the point in space that the camera is looking at. The point is copied into the supplied X, Y and Z variables Example |
IrrGetCameraTarget ( CameraObject, LookAtX, LookAtY, LookAtZ ) |
IrrGetCameraUpDirection |
Syntax IrrGetCameraUpDirection ( camera as irr_camera, X as single, Y as single, Z as single ) Description Get the up vector of a camera object into the supplied variables, this controls the upward direction of the camera and allows you to roll it for free flight action. This specifies a point in space at which the top of the camera points. Example |
IrrGetCameraUpDirection ( CameraObject, TopOfCamPointsAtX, TopOfCamPointsAtY, TopOfCamPointsAtZ ) |
IrrSetCameraUpDirection |
Syntax IrrSetCameraUpDirection ( camera as irr_camera, X as single, Y as single, Z as single ) Description Set the up vector of a camera object, this controls the upward direction of the camera and allows you to roll it for free flight action. This specifies a point in space at which the top of the camera points. Example |
IrrSetCameraUpDirection ( CameraObject, TopOfCamPointsAtX, TopOfCamPointsAtY, TopOfCamPointsAtZ ) |
IrrGetCameraOrientation |
Syntax IrrGetCameraOrientation ( camera as irr_camera, X as IRR_VECTOR, Y as IRR_VECTOR, Z as IRR_VECTOR ) Description Gets the vectors describing the camera direction useful after the camera has been revolved. Example |
IrrGetCameraOrientation ( CameraObject, VectorX, VectorY, VectorZ ) |
IrrRevolveCamera |
Syntax IrrRevolveCamera ( camera as irr_camera, yaw as single, pitch as single, roll as single, drive as single, strafe as single, elevate as single ) Description Revolve the camera using quaternion calculations, this will help avoid gimbal lock associated with normal Rotations and is ideal for spacecraft and aircraft. The command takes six parameters that control yaw (turning left and right), pitch (tilting up and down), roll (rolling left and right), drive (moving forwards and backward), strafe (moving left and right) and finally elevate (moving up and down) Many thanks to RogerBorg for this. Example |
IrrRevolveCamera ( CameraObject, CameraYaw, CameraPitch, CameraRoll, CameraDrive, CameraDrive, CameraStrafe, CameraElevate ) |
IrrSetCameraUpAtRightAngle |
Syntax IrrSetCameraUpAtRightAngle ( camera as irr_camera ) Description Set the camera up at a right angle to the camera vector. Example |
IrrSetCameraUpAtRightAngle ( CameraObject ) |
IrrSetCameraOrthagonal |
Syntax IrrSetCameraOrthagonal ( camera as irr_camera, distanceX as single, distanceY as single, distanceZ as single ) Description Set the projection of the camera to an orthagonal view, where there is no sense of perspective. The distance to the target adjusts the width and height of the camera view, essentially the smaller it is the larger the object will appear. Example |
IrrGetNodePosition( MyTarget, tarX, tarY, tarZ ) IrrGetNodePosition( MyCamera, camX, camY, camZ ) IrrSetCameraOrthagonal ( MyCamera, camX-tarX, camY-tarY, camZ-tarZ ) |
IrrSetCameraClipDistance |
Syntax IrrSetCameraClipDistance ( camera as irr_camera, distance as single ) Description A camera clips objects in the distance that may be a part of the scene to increase rendering performance without requiring you to manage adding and deleting the objects from the view. This defines the distance beyond which no polygons will be drawn. Example |
IrrSetCameraClipDistance ( CameraObject, 12000 ) |
IrrSetActiveCamera |
Syntax IrrSetActiveCamera ( camera as irr_camera ) Description When you have several camera objects in the scene you can use this call to define which of them is to be used to look through when drawing the scene. Example |
IrrSetActiveCamera( CameraObject ) |
IrrSetCameraFOV |
Syntax IrrSetCameraFOV ( camera as irr_camera, fov as single ) Description Sets the field of vision of the camera a wide field of vision will give a distorted perspective, if the angle is too narrow the display will feel restricted. The value is in radians and has a default value of PI / 2.5 Example |
IrrSetCameraFOV( CameraObject, PI / 2 ) |
IrrSetCameraAspectRatio |
Syntax IrrSetCameraAspectRatio ( camera as irr_camera, aspectRatio as single ) Description Sets the aspect ratio of the camera in the same way you think of standard screens and widescreens. A widescreen usually has an aspect ratio of 16:9 or 16/9 = 1.78. The camera apect ratio is set up automatically however if you are using split screen effects you may need to change the camera aspect ratio. Example |
IrrSetCameraAspectRatio( CameraObject, 1.78 ) |
IrrAddLight |
Syntax irr_node = IrrAddLight ( x as single, y as singlez as single, red as single, green as single, blue as single, size as single ) Description Adds a light into scene to naturally illuminate your scene. X, Y and Y defines the coordinates of the light in the scene. Red, Green and Blue define the intensities of the lighting for those colors. This is a fractional number ranging from 0 upwards the higher the value the brighter the light. Size specifies the radius of effect of the light Example |
WarningLight = IrrAddLight ( 0, 100, 50, 0.5,0.5,0.5, 50 ) |
IrrSetAmbientLight |
Syntax IrrSetAmbientLight ( Red as single, Green as single, Blue as single ) Description Sets the ambient lighting level in the scene, ambient light casts light evenly across the entire scene and can be used to increase the overall lighting level. If should never be greater that the brightness of the darkest area of your scene, it can however reduce the number of lights you need in the scene. The Red, Green and Blue components of this lighting is supplied as integers in the range or 0 to 255 Example |
IrrSetAmbientLight( 72, 64, 64 ) |
IrrSetLightAmbientColor |
Syntax IrrSetLightAmbientColor( Light as irr_node, Red as single, Green as single, Blue as single ) Description Ambient color emitted by the light, ambient light casts light evenly across the entire scene and can be used to increase the overall lighting level. If should never be greater that the brightness of the darkest area of your scene, it can however reduce the number of lights you need in the scene. The Red, Green and Blue components of this lighting is supplied as singles specifying the brightness in each color channel Example |
IrrSetLightAmbientColor( SceneLight, 1.0, 0.1, 0.7 ) |
IrrSetLightAttenuation |
Syntax IrrSetLightAttenuation( Light as irr_node, Red as single, Green as single, Blue as single ) Description Changes the light strength fading over distance. Good values for distance effects use ( 1.0, 0.0, 0.0) and simply add small values to the second and third element. Example |
IrrSetLightAttenuation( SceneLight, 1.0, 0.08, 0.07 ) |
IrrSetLightCastShadows |
Syntax IrrSetLightCastShadows( Light as irr_node, cast_shadows as uinteger ) Description Specifies whether the light casts shadows in the scene or not. Shadowing must be enabled in the IrrStart call and also on the nodes in the scene. Example |
IrrSetLightCastShadows( SceneLight, IRR_ON ) |
IrrSetLightDiffuseColor |
Syntax IrrSetLightDiffuseColor( Light as irr_node, Red as single, Green as single, Blue as single ) Description IrrSetLightDiffuseColor The Red, Green and Blue components of this lighting is supplied as singles specifying the brightness in each color channel Example |
IrrSetLightDiffuseColor( SceneLight, 1.0, 1.0, 0.8 ) |
IrrSetLightFalloff |
Syntax IrrSetLightFalloff( Light as irr_node, Falloff as single ) Description The light strength's decrease between Outer and Inner cone. Example |
IrrSetLightFalloff( SceneLight, 0.8 ) |
IrrSetLightInnerCone |
Syntax IrrSetLightInnerCone( Light as irr_node, InnerCone as single ) Description The angle of the spot's inner cone. Ignored for other lights. Example |
IrrSetLightInnerCone( SceneLight, 0.4 ) |
IrrSetLightOuterCone |
Syntax IrrSetLightOuterCone( Light as irr_node, OuterCone as single ) Description The angle of the spot's outer cone. Ignored for other lights. Example |
IrrSetLightOuterCone( SceneLight, 0.9 ) |
IrrSetLightRadius |
Syntax IrrSetLightRadius( Light as irr_node, Radius as single ) Description Radius of light. Everything within this radius be be lighted. If some artefacts can be seen when the radius is changed in this instance simply make the radius a little large Example |
IrrSetLightRadius( SceneLight, 50.2 ) |
IrrSetLightSpecularColor |
Syntax IrrSetLightSpecularColor( Light as irr_node, Red as single, Green as single, Blue as single ) Description Sets the ambient lighting level in the scene, ambient light casts light evenly across the entire scene and can be used to increase the overall lighting level. If should never be greater that the brightness of the darkest area of your scene, it can however reduce the number of lights you need in the scene. The Red, Green and Blue components of this lighting is supplied as singles specifying the brightness in each color channel Example |
IrrSetLightSpecularColor( SceneLight, 1.0, 1.0, 1.0 ) |
IrrSetLightType |
Syntax IrrSetLightType( Light as irr_node, Light_type as E_LIGHT_TYPE ) Description The type of the light. All lights default to a point light but can be changed with this setting to one of the following values: - ELT_POINT |
IrrSetLightType( SceneLight, ELT_SPOT ) |
IrrAddTerrain |
Syntax irr_terrain = IrrAddTerrain ( path as zstring ptr, xPosition as single = 0.0, yPosition as single = 0.0, zPosition as single = 0.0, xRotation as single = 0.0, yRotation as single = 0.0, zRotation as single = 0.0, xScale as single = 1.0, yScale as single = 1.0, zScale as single = 1.0, vertexAlpha as integer = 255, vertexRed as integer = 255, vertexGreen as integer = 255, vertexBlue as integer = 255, smoothing as integer = 0, maxLOD as integer = 5, patchSize as IRR_TERRAIN_PATCH_SIZE = ETPS_17 ) Description Creates a terrain object from a gray scale bitmap where bright pixels are high points on the terrain and black pixels are low points. You will inevitablly have to rescale the terrain during the call or after it is created. The Terrain object is a special dynamic mesh whose resoloution is reduced in the distance to reduce the number of triangles it consumes. Path is the filename of a gray scale image used to define the contours of the surface. xPosition, yPosition and zPosition define the position of the terrain xRotation, yRotation and zRotation define the rotation of the terrain xScale, xScale and xScale define the scale of the terrain vertexAlpha, vertexRed, vertexGreen, vertexBlue, define the vertex color of all points in the terrain. smoothing allows you to define whether the contours of the surface of the terrain are smoothed over. maxLOD and patchsize control the properties of the level of detail calculations applied to the terrain, it is recommended that these are left at default values. Example |
TerrainNode = IrrAddTerrain( "CanyonsHeightField.bmp" ) |
IrrAddTerrainTile |
Syntax irr_terrain = IrrAddTerrainTile ( image as irr_image, tileSize as integer = 256, dataX as integer = 0, dataY as integer = 0, xPosition as single = 0.0, yPosition as single = 0.0, zPosition as single = 0.0, xRotation as single = 0.0, yRotation as single = 0.0, zRotation as single = 0.0, xScale as single = 1.0, yScale as single = 1.0, zScale as single = 1.0, smoothing as integer = 1, maxLOD as integer = 5, patchSize as IRR_TERRAIN_PATCH_SIZE = ETPS_17 ) Description Creates a tilable terrain object from a gray scale bitmap where bright pixels are high points on the terrain and black pixels are low points. You will inevitablly have to rescale the terrain during the call or after it is created. The Terrain object is a special dynamic mesh whose resoloution is reduced in the distance to reduce the number of triangles it consumes. Unlike the origonal terrain object the tileable terrain object can be attached to other terrain tile objects without being affected by cracks between tiles caused by the level of detail mechanism. When working with tile terrains it should be noted that the terrain is internally divided up into patches that are patchSize - 1 and there is always one invisible row of patches at the top and left of the terrain. Essentially this means that if your tileSize is 128 x 128 the visible size of your terrain will be 112 x 112 (with a patchSize of ETPS_17) Note: Tiled Terrain object can be automatically control with the Zone Manager objects please refer to them for further details. Image is an image file loaded with IrrGetImage and containing a gray scale image used to define the contours of the surface. TileSize defines the size of the terrain independantly of the size of the image used to create it xPosition, yPosition and zPosition define the position of the terrain xRotation, yRotation and zRotation define the rotation of the terrain xScale, xScale and xScale define the scale of the terrain smoothing allows you to define whether the contours of the surface of the terrain are smoothed over. maxLOD and patchsize control the properties of the level of detail calculations applied to the terrain, it is recommended that these are left at default values. Example |
TerrainNode = IrrAddTerrainTile( EasterIslandImage, 128 ) |
IrrAddSphericalTerrain |
Syntax irr_terrain = IrrAddSphericalTerrain ( topPath as zstring ptr, frontPath as zstring ptr, backPath as zstring ptr, leftPath as zstring ptr, rightPath as zstring ptr, bottomPath as zstring ptr, xPosition as single = 0.0, yPosition as single = 0.0, zPosition as single = 0.0, xRotation as single = 0.0, yRotation as single = 0.0, zRotation as single = 0.0, xScale as single = 1.0, yScale as single = 1.0, zScale as single = 1.0, vertexAlpha as integer = 255, vertexRed as integer = 255, vertexGreen as integer = 255, vertexBlue as integer = 255, smoothing as integer = 0, spherical as integer = 0, maxLOD as integer = 5, patchSize as IRR_TERRAIN_PATCH_SIZE = ETPS_17 ) Description Creates a spherical terrain that represents a planetary body. When using this terrain it is better to think of it as a cube rather than a sphere, in fact it is a cube that is distorted so that its surface becomes spherical, like a cube it has a top, bottom, left, right, front and back and co-ordinates are thought of as being at position X,Y on cube face N. In someways this makes working with placing things on the object simpler as you can think of it as six flat surfaces. The first six paths are the path of six gray scale bitmaps where bright pixels are high points on the terrain and black pixels are low points. The position, rotation and scale of the terrain are specified with the next series of parameters. Four parameters are used to set the vertex color of all the verticies in the terrain. Smoothing is used to smooth out the contours of the hills in the terrain. maxLOD and patchSize allow you to adjust the level of detail within the terrain although it is usually best to leave these to default values. When creating heightmaps for the faces of the terrain you will need to ensure that the height of pixels at the edge of adjoining sides of the terrain are the same otherwise large visible cracks will appear at the edges of the faces, the easiest way to do this is to create terrain texture and then copy and/or rotate it onto its adjacent face. You can get some suprisingly effective planets and asteroids with textures as small as 32x32 but the object also runs well with a terrain size at the maximum 256 x 256. ![]() Example |
Terrain = IrrAddSphericalTerrain( _ "moonbase_top.bmp", _ "moonbase_front.bmp", _ "moonbase_back.bmp", _ "moonbase_left.bmp", _ "moonbase_right.bmp", _ "moonbase_bottom.bmp", _ px,py,pz, rx,ry,rz, 64.0,64.0,64.0, _ 0, 255, 255, 255, -30, 0, 4, ETPS_17 ) |
IrrGetTerrainHeight |
Syntax single = IrrGetTerrainHeight ( terrain as irr_terrain, X as single, Y as single ) Description Get the height of a point on a terrain. This can be a particularlly fast and accurate way to move an object over a terrain. Example |
Y = IrrGetTerrainHeight ( TerrainNode, X, Z ) |
IrrScaleTexture |
Syntax IrrScaleTexture ( terrain as irr_terrain, X as single, Y as single ) Description As a terrain object is a particularly huge mesh when textured are applied to it they look extremely pixelated. To get over this effect a terrain object can have two materials applied to it, one to give general surface color and a second that is copied across the surface like tiles to give a rough detailed texture. This call specifies the scaling of this detail texture. Example |
IrrScaleTexture ( TerrainNode, 20, 20 ) |
IrrGetTerrainTileHeight |
Syntax single = IrrGetTerrainTileHeight ( terrain as irr_terrain, X as single, Y as single ) Description Get the height of a point on a terrain tile. This can be a particularlly fast and accurate way to move an object over a terrain. Example |
Y = IrrGetTerrainTileHeight ( TerrainNode, X, Z ) |
IrrScaleTileTexture |
Syntax IrrScaleTileTexture ( terrain as irr_terrain, X as single, Y as single ) Description As a tile terrain object is a particularly huge mesh when textured are applied to it they look extremely pixelated. To get over this effect a terrain object can have two materials applied to it, one to give general surface color and a second that is copied across the surface like tiles to give a rough detailed texture. This call specifies the scaling of this detail texture. Example |
IrrScaleTileTexture ( TerrainNode, 20, 20 ) |
IrrAttachTile |
Syntax IrrAttachTile ( terrain as irr_terrain, neighbouring_terrain as irr_terrain, edge as integer ) Description Set the adjacent tile to this tile node. To avoid cracks appearing between tiles, tiles need to know which tiles are their neighbours and which edges they are attached too. Example |
IrrAttachTile( TerrainNorth, TerrainSouth, TOP_EDGE ) IrrAttachTile( TerrainSouth, TerrainNorth, BOTTOM_EDGE ) |
IrrSetTileStructure |
Syntax IrrSetTileStructure ( terrain as irr_terrain, image as irr_image, x as integer, y as integer ) Description Loads the tile structure from the supplied image file. Unlike the image in the origonal call to create a terrain tile this image has a different structure. The image should be in RGBA format, the alpha value is used to set the height of the terrain and the RGB values are used to set the color of the verticies. This can either be for loading precalculated lighting into the scene or it can be used with the new IRR_EMT_FOUR_DETAIL_MAP material type to define the weight of each of the greyscale detail maps in the RGB channels of the detail map. The x and y values can be used to load the structure from a specific point on the bitmap. Example |
IrrSetTileStructure( TerrainCove, CoveStructure, 0, 0 ) |
IrrSetTileColor |
Syntax IrrSetTileColor( terrain as irr_terrain, image as irr_image, x as integer, y as integer ) Description Loads the tile vertex colors from the supplied image file. The RGB values are used to set the color of the verticies. This can either be for loading precalculated lighting into the scene or it can be used with the new IRR_EMT_FOUR_DETAIL_MAP material type to define the weight of each of the greyscale detail maps in the RGB channels of the detail map. The x and y values can be used to load the structure from a specific point on the bitmap. Example |
IrrSetTileColor( TerrainCove, CoveStructure, 0, 0 ) |
IrrScaleSphericalTexture |
Syntax IrrScaleSphericalTexture ( terrain as irr_terrain, X as single, Y as single ) Description As the surfaces of a sphereical terrain object are a particularly huge mesh when textures are applied to them they look extremely pixelated. To get over this effect a spherical terrain object can have two materials applied to it, one to give general surface color and a second that is copied across the surface like tiles to give a rough detailed texture. This call specifies the scaling of this detail texture. Example |
IrrScaleSphericalTexture ( SphericalTerrainNode, 20, 20 ) |
IrrSetSphericalTerrainTexture |
Syntax IrrSetSphericalTerrainTexture ( terrain as irr_terrain, topTexture as irr_texture, frontTexture as irr_texture, backTexture as irr_texture, leftTexture as irr_texture, rightTexture as irr_texture, bottomTexture as irr_texture, materialIndex as uinteger ) Description Apply six textures to the surface of a spherical terrain. By using the material index you can set the color or the detail maps Example |
IrrSetSphericalTerrainTexture ( TerrainNode, _ "moobbase_col_top.bmp", _ "moobbase_col_front.bmp", _ "moobbase_col_back.bmp", _ "moobbase_col_left.bmp", _ "moobbase_col_right.bmp", _ "moobbase_col_bottom.bmp", _ 0 ) |
IrrLoadSphericalTerrainVertexColor |
Syntax IrrLoadSphericalTerrainVertexColor ( terrain as irr_terrain, topMap as irr_image, frontMap as irr_image, backMap as irr_image, leftMap as irr_image, rightMap as irr_image, bottomMap as irr_image ) Description Apply six images to the vertex colors of the faces, this is useful for setting the verticies so that they can be used with simple terrain spattering described in the section on tiled terrains above. Example |
IrrLoadSphericalTerrainVertexColor (
TerrainNode, _ "moobbase_vert_top.bmp", _ "moobbase_vert_front.bmp", _ "moobbase_vert_back.bmp", _ "moobbase_vert_left.bmp", _ "moobbase_vert_right.bmp", _ "moobbase_vert_bottom.bmp" ) |
IrrGetSphericalTerrainSurfacePosition |
Syntax IrrGetSphericalTerrainSurfacePosition ( terrain as irr_terrain, face as integer, logicalX as single, logicalZ as single, X as single, Y as single, Z as single ) Description Get the surface position of a logical point on the terrain. You supply a face number and a logical X, Y position on that face and this call will return the height of that point on the terrain sphere inside the X, Y, Z parameters. Note: By subtracting the center of the sphere from this co-ordinate and converting this vector to angles you can find the upward direction of the point on the surface. Example |
IrrGetSphericalTerrainSurfacePosition ( TerrainNode, IRR_TOP_FACE, buggyX, buggyZ, X, Y, Z ) |
IrrGetSphericalTerrainSurfacePositionAndAngle |
Syntax IrrGetSphericalTerrainSurfacePosition ( terrain as irr_terrain, face as integer, logicalX as single, logicalZ as single, X as single, Y as single, Z as single, RotationX as single, RotationY as single, RotationZ as single ) Description Get the surface position and angle of a logical point on the terrain. This is not the normal of the surface but essentially the angles to the gravitational center. Example |
IrrGetSphericalTerrainSurfacePositionAndAngle ( Terrain, F, I, J, PX,PY,PZ, RX,RY,RZ ) |
IrrGetSphericalTerrainLogicalSurfacePosition |
Syntax IrrGetSphericalTerrainSurfacePosition ( terrain as irr_terrain, face as integer, logicalX as single, logicalZ as single, X as single, Y as single, Z as single ) Description Convert a co-ordinate into a logical Spherical terrain position. Thanks for the example from "David" posted on Infinity-Universe forum Please note that this calculation is not 100% accurate, it is advised that the translation is done at altitude and the difference either ignored or blended as the observer decends. Note: The height above the surface can be calculated simply by calculating the length of the center of the planet to the surface and then the center of the planet to the space coordinate and subracting the two Note: The momentum could be calculated by converting two samples and then measing the difference in height and X and Z on the face Example |
IrrGetSphericalTerrainLogicalSurfacePosition ( Terrain, X, Y, Z, face, LX, LZ ) |
IrrSetMinParticleSize |
Syntax IrrSetMinParticleSize ( particle emitter as irr_particle_emitter, X as single, Y as single ) Description Particles in a particle system are simple 2 dimensional billboard like objects, this sets the size of these particles, larger particles can be effective and use less resources however they can look blocky if taken too far. Example |
IrrSetMinParticleSize ( SmokeEmitter, 5, 5 ) |
IrrSetMaxParticleSize |
Syntax IrrSetMaxParticleSize ( particle emitter as irr_particle_emitter, X as single, Y as single ) Description Particles in a particle system are simple 2 dimensional billboard like objects, this sets the size of these particles, larger particles can be effective and use less resources however they can look blocky if taken too far. Example |
IrrSetMaxParticleSize ( SmokeEmitter, 15, 15 ) |
IrrAddParticleEmitter |
Syntax irr_emitter = IrrAddParticleEmitter ( particle system as irr_particle_system, settings as IRR_PARTICLE_EMITTER ) Description Adds a particle emitter to the particle system, this creates particles and controls how they move and when they are to be removed. It requires a very large number of parameters to define this flexible effect and as such these parameters are stores in a special IRR_PARTICLE_EMITTER structure. Example |
MyEmitter = IrrAddParticleEmitter( SmokeParticles, SmokeEmitter ) |
IrrAddAnimatedMeshSceneNodeEmitter |
Syntax irr_emitter = IrrAddAnimatedMeshSceneNodeEmitter( particle_system as irr_particle_system, node as irr_node, use_normal_direction as uinteger, normal_direction_modifier as single, emit_from_every_vertex as integer, settings as IRR_PARTICLE_EMITTER ) Description Creates a particle emitter for an animated mesh scene node Parameters: node - Pointer to the animated mesh scene node to emit particles from useNormalDirection - If true, the direction of each particle created will be the normal of the vertex that it's emitting from. The normal is divided by the normalDirectionModifier parameter, which defaults to 100.0f. normalDirectionModifier - If the emitter is using the normal direction then the normal of the vertex that is being emitted from is divided by this number. everyMeshVertex - If true, the emitter will emit between min/max particles every second, for every vertex in the mesh, if false, it will emit between min/max particles from random vertices in the mesh. A large number of additional parameters are also required to define this flexible effect and as such these parameters are stores in a special IRR_PARTICLE_EMITTER structure. The box size properties of this structure are unused in this call Example |
MyEmitter = IrrAddAnimatedMeshSceneNodeEmitter ( SmokeParticles, SceneNode, 1, 0.25, 0, SmokeEmitter ) |
IrrAddFadeOutParticleAffector |
Syntax irr_affector = IrrAddFadeOutParticleAffector ( particle_system as irr_particle_system ) Description Adds a fade out affector to the particle system, this fades the particles out as they come to the end of their lifespan and stops them 'popping' out of existance. This creates a convincing effect for fire and smoke in particular. Example |
MyAffector = IrrAddFadeOutParticleAffector( SmokeParticles ) |
IrrAddGravityParticleAffector |
Syntax irr_affector = IrrAddGravityParticleAffector ( particle system as irr_particle_system, x as single, y as single, z as single ) Description Adds a gravity affector to the particle system, this gradually pulls the particles in the direction of the effect, although it is called a gravity effector it can be used to make a wind effect and have the particles drift off to the side. X, Y and Z define the force that is applied to the particles over time. Example |
MyAffector = IrrAddGravityParticleAffector( SmokeParticles, -0.1, 0, 0 ) |
IrrAddParticleAttractionAffector |
Syntax irr_affector = IrrAddParticleAttractionAffector( particle_system as irr_particle_system, x as Single, y as Single, z as Single, speed as Single = 1.0, attract as uinteger = 1, affectX as uinteger = 1, affectY as uinteger = 1, affectZ as uinteger = 1 ) Description Creates a point attraction affector. This affector modifies the positions of the particles and attracts them to a specified point at a specified speed per second. Parameters: x,y,z - Point to attract particles to. speed - Speed in units per second, to attract to the specified point. attract - Whether the particles attract or detract from this point use the constants IRR_ATTRACT or IRR_REPEL (defaults to IRR_ATTRACT) affectX - Whether or not this will affect the X position of the particle, use 1 to effect the position and 0 to leave it unaffected ( defaults to true ). affectY - Whether or not this will affect the Y position of the particle, use 1 to effect the position and 0 to leave it unaffected ( defaults to true ). affectZ - Whether or not this will affect the Z position of the particle, use 1 to effect the position and 0 to leave it unaffected ( defaults to true ). Example |
MyAffector = IrrAddParticleAttractionAffector( SmokeParticles, 0.0, 10.0, 0.0, 20.0, IRR_ATTRACT, 1, 1, 1 ) |
IrrCreateRotationAffector |
Syntax irr_affector = IrrCreateRotationAffector ( particle_system as irr_particle_system, Speed_X as Single, Speed_Y as Single, Speed_Z as Single, pivot_X as Single, pivot_Y as Single, pivot_Z as Single ) Description Creates a rotation affector. This affector modifies the positions of the particles and attracts them to a specified point at a specified speed per second. Parameters: speed x,y,z - Rotation in degrees per second pivot x,y,z - Point to rotate the particles around Example |
MyAffector = IrrCreateRotationAffector( SmokeParticles, -120.0, 0.0, 0.0, 0.0, 0.0, 0.0 ) |
IrrAddStopParticleAffector |
Syntax irr_affector = IrrAddStopParticleAffector ( particle_system as irr_particle_system, time as uinteger, emitter as irr_emitter ) Description The stop particle affector waits for the specified period of time to elapse and then stops the specified emitter emitting particles by setting its minimum and maximum particle emission rate to zero. The emitter can easily be started up again by changing its emission rate. Parameters: Time - The number of milliseconds to elapse before the particles are stopped Emitter - The particle generating object to stop Example |
MyAffector = IrrAddStopParticleAffector( SmokeSystem, 1000, smoke_emitter ) |
IrrAddParticlePushAffector |
Syntax irr_affector = IrrAddParticlePushAffector ( particle_system as irr_particle_system, x as single, y as single, z as single, speedX as single, speedY as single, speedZ as single, far as single, near as single, column as single, distant as integer ) Description Creates a point push affector. This affector modifies the positions of the particles and pushes them toward or away from a specified point at a specified speed per second. The strength of this effect is adjusted by a near and a far distance. Beyond the far distance the particle is not effected at all and the closer you get to the center of the effect the stronger the force is. If a near distance is defined (a value greater than 0.0) the effect is somewhat different, particles closer to the center than the near distance are not effected at all, and the stongest point of the effect is always halfway between the near and far limits, for example if your near distance was 25.0 and your far distance was 75.0 the strongest force would be applied to particles at a distance of 50.0 If a column width is defined the effect will only take place in a vertical column that is that wide, this is useful for fountains of water where as the water spreads out of the column a gravity affector can take over. By adjusting these parameters and the strength you can create columns, spheres, shells and rings of effect that can, in combination, push particles in complex motions Parameters: x, y, z - Point to attract particles to or repel particles away from speedX, speedY, speedZ - A vector describing the strength of the effect Far - Furthest distance of effect Near - Closest distance of effect Column - The width of a vertical column in which the push affector has influence, somewhat like the column of water in a fountain Distant - Use IRR_ON to apply the same force in the same directionto all particles and use IRR_OFF to apply a force that radiates away from the center of the effect Example |
MyAffector = IrrAddParticlePushAffector ( ColumnOfSmoke, 0, 0, 0, 0, 100, 0, 100, 0.0, 0.0, IRR_OFF ) |
IrrAddColorMorphAffector |
Syntax irr_affector = IrrAddColorMorphAffector ( particle_system as irr_particle_system, numberOfParticles as uinteger, particlecolors as uinteger ptr, particletimes as uinteger ptr, smooth as uinteger ) Description This clever effect by Dark Kilauea that allows you to provide an array of colors and an optional array of times that effect the color of the particle over its lifetime, the particle could start off bright orange and fade away into grey and then black for example. Parameters: numEntries - the number of entries in the supplied table colors - the table of colors time - the table of times at which each color becomes active smooth - Use IRR_ON to smoothly blend between colors and use IRR_OFF to sharply switch between colors Example |
DIM colors(0 to 4) as uinteger = {
IrrMakeARGB(0,255,255,128), _ ' yellow white IrrMakeARGB(0,255,128,0), _ ' yellow IrrMakeARGB(0,128,64,0), _ ' orange IrrMakeARGB(0,0,0,128), _ ' slight blue IrrMakeARGB(255,0,0,0) } ' black and faded DIM times(0 to 4) as uinteger = {500, 800, 1250, 1500, 2000 } MyAffector = IrrAddColorMorphAffector( Fire.particles, 5, @colors(0), @times(0), IRR_ON ) |
IrrAddSplineAffector |
Syntax irr_affector = IrrAddSplineAffector ( particle_system as irr_particle_system, VertexCount as uinteger, verticies as IRR_VERT ptr, speed as single, tightness as single, attraction as single, deleteAtEnd as uinteger ) Description This clever effect by Dark Kilauea that allows you to create an affector that moves the particles along the path of a spline for very controled and complex particle motion. Parameters: VertexCount - Is the number of points in your spline Verticies - Is an array of IRR_VERT objects defining the X,Y and Z position of points Speed - is the speed with which particles are moved along the spline tightness - is the tightness of the curve of the spline attraction - is how closely the particles are atracted to the curve of the spline deleteAtEnd - Use IRR_ON to delete the particles when they reach the end of the spline and use IRR_OFF to allow the particles to be deleted naturally. Example |
DIM splineverticies(0 to 3) as IRR_VERT splineverticies(0).x = 0.0 : splineverticies(0).y = 0.0 : splineverticies(0).z = 0.0 splineverticies(1).x = 0.0 : splineverticies(1).y = 20.0 : splineverticies(1).z = 25.0 splineverticies(2).x = 0.0 : splineverticies(2).y = 40.0 : splineverticies(2).z = -25.0 splineverticies(3).x = 0.0 : splineverticies(3).y = 60.0 : splineverticies(3).z = 0.0 IrrAddSplineAffector ( NeonLight.particles, 4, @splineverticies(0), 2.0, 1.0, 5.0, IRR_ON ) |
IrrRemoveAffectors |
Syntax IrrRemoveAffectors ( particle system as irr_particle_system ) Description Removes all affectors from a particle system, you might use this if you wanted to change the direction or strength of the wind for example. Example |
IrrRemoveAffectors( SmokeParticles ) |
IrrSetParticleEmitterDirection |
Syntax IrrSetParticleEmitterDirection( particle_emitter as irr_emitter, x as single, y as single, z as single ) Description Set direction the emitter emits particles. Example |
IrrSetParticleEmitterDirection( MyEmitter, 0.0, 0.4, 0.0 ) |
IrrSetParticleEmitterMinParticlesPerSecond |
Syntax IrrSetParticleEmitterMinParticlesPerSecond( particle_emitter as irr_emitter, min_particles_per_second as uinteger ) Description Set minimum number of particles the emitter emits per second. Example |
IrrSetParticleEmitterMinParticlesPerSecond( MyEmitter, 32 ) |
IrrSetParticleEmitterMaxParticlesPerSecond |
Syntax IrrSetParticleEmitterMaxParticlesPerSecond( particle_emitter as irr_emitter, max_particles_per_second as uinteger ) Description Set maximum number of particles the emitter emits per second. Example |
IrrSetParticleEmitterMaxParticlesPerSecond( MyEmitter, 100 ) |
IrrSetParticleEmitterMinStartColor |
Syntax IrrSetParticleEmitterMinStartColor( particle_emitter as irr_emitter, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Set minimum starting color for particles. Example |
IrrSetParticleEmitterMinStartColor( MyEmitter, 255, 192, 128 ) |
IrrSetParticleEmitterMaxStartColor |
Syntax IrrSetParticleEmitterMaxStartColor( particle_emitter as irr_emitter, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Set maximum starting color for particles. Example |
IrrSetParticleEmitterMaxStartColor( MyEmitter, 255, 192, 128 ) |
IrrSetParticleAffectorEnable |
Syntax IrrSetParticleAffectorEnable( particle_affector as irr_affector, Enable as uinteger ) Description Enable or disable an affector. Setting the value to 1 enables the affector, setting it to 0 disables it. IRR_ON and IRR_OFF can be used also. Example |
IrrSetParticleAffectorEnable( MyAffector, IRR_OFF ) |
IrrSetFadeOutParticleAffectorTime |
Syntax IrrSetFadeOutParticleAffectorTime( particle_affector as irr_affector, FadeFactor as float ) Description Alter the fadeout affector changing the fade out time. Example |
IrrSetFadeOutParticleAffectorTime( MyAffector, 2000.0 ) |
IrrSetFadeOutParticleAffectorTargetColor |
Syntax IrrSetFadeOutParticleAffectorTargetColor( particle_affector as irr_affector, Red as uinteger, Green as uinteger, Blue as uinteger ) Description Alter the fadeout affector changing the target color to the affector fades to over time. Example |
IrrSetFadeOutParticleAffectorTargetColor( MyAffector, 16, 8, 0 ) |
IrrSetGravityParticleAffectorDirection |
Syntax IrrSetGravityParticleAffectorDirection( particle_affector as irr_affector, x as single, y as single, z as single) Description Alter the direction and force of gravity for a gravity affector. Example |
IrrSetGravityParticleAffectorDirection( MyAffector, 0.2, 0.1, 0.0 ) |
IrrSetGravityParticleAffectorTimeForceLost |
Syntax IrrSetGravityParticleAffectorTimeForceLost( particle_affector as irr_affector, time_force_lost as single ) Description Set the time in milliseconds when the gravity force is totally lost and the particle does not move any more. Example |
IrrSetGravityParticleAffectorTimeForceLost( MyAffector, 800.0 ) |
IrrSetParticleAttractionAffectorAffectX |
Syntax IrrSetParticleAttractionAffectorAffectX( particle_affector as irr_affector, affect as uinteger ) Description Set whether or not an atraction affector will affect particles in the X direction.. Setting the value to 1 enables the effect, setting it to 0 disables it. IRR_ON and IRR_OFF can be used also. Example |
IrrSetParticleAttractionAffectorAffectX( MyAffector, IRR_ON ) |
IrrSetParticleAttractionAffectorAffectY |
Syntax IrrSetParticleAttractionAffectorAffectY( particle_affector as irr_affector, affect as uinteger ) Description Set whether or not an atraction affector will affect particles in the Y direction.. Setting the value to 1 enables the effect, setting it to 0 disables it. IRR_ON and IRR_OFF can be used also. Example |
IrrSetParticleAttractionAffectorAffectY( MyAffector, IRR_ON ) |
IrrSetParticleAttractionAffectorAffectZ |
Syntax IrrSetParticleAttractionAffectorAffectZ( particle_affector as irr_affector, affect as uinteger ) Description Set whether or not an atraction affector will affect particles in the Z direction.. Setting the value to 1 enables the effect, setting it to 0 disables it. IRR_ON and IRR_OFF can be used also. Example |
IrrSetParticleAttractionAffectorAffectZ( MyAffector, IRR_ON ) |
IrrSetParticleAttractionAffectorAttract |
Syntax IrrSetParticleAttractionAffectorAttract( particle_affector as irr_affector, affect as uinteger ) Description Set whether or not the particles are attracted or repelled from an attractor effector.. Use the values IRR_ATTRACT and IRR_REPEL for convienience. Example |
IrrSetParticleAttractionAffectorAttract( MyAffector, IRR_ATTRACT ) |
IrrSetParticleAttractionAffectorPoint |
Syntax IrrSetParticleAttractionAffectorPoint( particle_affector as irr_affector, x as single, y as single, z as single ) Description Set the point that particles will attract to when affected by this attractor affector. Example |
IrrSetParticleAttractionAffectorPoint( MyAffector, IRR_ATTRACT ) |
IrrSetRotationAffectorPivotPoint |
Syntax IrrSetRotationAffectorPivotPoint( particle_affector as irr_affector, x as single, y as single, z as single ) Description Set the point that particles will rotate about when affected by this rotation affector. Example |
IrrSetRotationAffectorPivotPoint( MyAffector, IRR_ATTRACT ) |
IrrSetFurthestDistanceOfEffect |
Syntax IrrSetFurthestDistanceOfEffect( particle_affector as irr_affector, newDistance as single ) Description Set the furthest distance of effect on particles affected by the push affector. Example |
IrrSetFurthestDistanceOfEffect( MyAffector, 100.0 ) |
IrrSetNearestDistanceOfEffect |
Syntax IrrSetNearestDistanceOfEffect( particle_affector as irr_affector, newDistance as single ) Description Set the nearest distance of effect on particles affected by the push affector. Example |
IrrSetNearestDistanceOfEffect( MyAffector, 10.0 ) |
IrrSetColumnDistanceOfEffect |
Syntax IrrSetColumnDistanceOfEffect( particle_affector as irr_affector, newDistance as single ) Description Set the column distance of effect on particles affected by the push affector. Example |
IrrSetColumnDistanceOfEffect( MyAffector, 20.0 ) |
IrrSetCenterOfEffect |
Syntax IrrSetCenterOfEffect( particle_affector as irr_affector, x as single, y as single, z as single ) Description Set the center of the effect of particles affected by the push affector. Example |
IrrSetCenterOfEffect( MyAffector, 0.0, PushHeight, 0.0 ) |
IrrSetStrengthOfEffect |
Syntax IrrSetStrengthOfEffect( particle_affector as irr_affector, x as single, y as single, z as single ) Description Set the strength of the effect of particles affected by the push affector. Example |
IrrSetStrengthOfEffect( MyAffector, PipeVelocity, 0.0, 0.0 ) |
IrrGUIClear |
Syntax IrrGUIClear () Description Clears all GUI objects from the display. Example |
IrrGUIClear() |
IrrGUIRemove |
Syntax IrrGUIRemove ( object as IRR_GUI_OBJECT ) Description Removes the specified GUI object from the display. Example |
IrrGUIRemove( myButton ) |
IrrGUIGetText |
Syntax IrrGUIGetText ( object as IRR_GUI_OBJECT ) Description Gets the text associated with a GUI object.. Example |
DIM myString as wstring = IrrGUIGetText( myEditBox ) |
IrrGUISetText |
Syntax IrrGUISetText ( object as IRR_GUI_OBJECT, text as wstring ) Description Sets the text of a GUI object.. Example |
DIM fpsString as wstring * 256 fpsString = "FPS: " + Str(IrrGetFPS) IrrGUISetText( myButton, fpsString ) |
IrrAddWindow |
Syntax IrrAddWindow ( title as wstring ptr, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, modal as uinteger, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Creates an empty window that can form the frame to contain other controls. Title is a wide string that contains the title of the window. Top X, Top Y, Bottom X and Bottom Y define a box in which the window is drawn Modal determines if the window locks out the rest of the interface until it is closed: - IRR_GUI_MODAL IRR_GUI_NOT_MODAL Parent defines the parent object of this window. This can be ommited if the window has no parent. Example |
windowObject = IrrAddWindow( "A Window", 4,0,200,64, IRR_GUI_MODAL ) |
IrrAddStaticText |
Syntax IrrAddStaticText ( text as wstring ptr, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, border as uinteger, wordwrap as uinteger, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Creates a static text object on the Graphical User Interface, this simply displays the specifed text in the specified box. Text is a wide string that contains the text you want to display. Top X, Top Y, Bottom X and Bottom Y define a box in which the text is drawn Border is used to draw a visible box around the text, its value should be either of: - IRR_GUI_NO_BORDER IRR_GUI_BORDER Word wrap is used to define whether text is to be wrapped around into a second line when it fills the width of the text box, its value should be either of: - IRR_GUI_NO_WRAP 0 IRR_GUI_WRAP 1 Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
statictextObject = IrrAddStaticText( "Hello World", 4,0,200,16, NO_BORDER, NO_WRAP, windowObject ) |
IrrAddButton |
Syntax IrrAddButton ( Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, id as integer, text as wstring ptr, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Add a clickable button object to the gui display. Top X, Top Y, Bottom X and Bottom Y define a box in which the button is drawn id specifies a unique numerical reference for the button so events can be identified as coming from this object text specified the label assigned to the button Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
buttonObject = IrrAddButton( 16,16,96,32, 120, "My Button", windowObject ) |
IrrAddScrollBar |
Syntax IrrAddScrollBar ( horizontal as integer, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, id as integer, currentValue as integer, maxValue as integer, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Add a scrollbar object to the GUI display. Horizontal defines if the scrollbar is horizontal or vertical, acceptable values for this field are: - IRR_GUI_HORIZONTAL IRR_GUI_VERTICAL Top X, Top Y, Bottom X and Bottom Y define a box in which the scrollbar is drawn id specifies a unique numerical reference for the scrollbar so events can be identified as coming from this object currentValue specified the current setting of the scrollbar maxValue specifies the maximum setting of the scrollbar Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
scrollbarObject = IrrAddScrollBar( IRR_GUI_HORIZONTAL, 16,16,96,32, 120, 128, 156, windowObject ) |
IrrAddListBox |
Syntax IrrAddListBox ( horizontal as integer, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, id as integer, background as integer, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Add a listbox object containing a list of items to the gui display. horizontal specifies whether the scrollbar is oriented horizontally or vertically. acceptable values are: - IRR_GUI_HORIZONTAL IRR_GUI_VERTICAL Top X, Top Y, Bottom X and Bottom Y define a box in which the listbox is drawn id specifies a unique numerical reference for the listbox so events can be identified as coming from this object background specifies whether the background of the listbox should be drawn. acceptable values are: - IRR_GUI_DRAW_BACKGROUND IRR_GUI_EMPTY_BACKGROUND Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
listboxObject = IrrAddListBox( 16,16,96,32, 120, IRR_GUI_DRAW_BACKGROUND, windowObject ) |
IrrAddListBoxItem |
Syntax IrrAddListBoxItem ( listbox as IRR_GUI_OBJECT, text as wstring ) Description Add a text element to a list box. listbox defines the listbox gui object to add the string too. text is the string containing the new item Example |
IrrAddListBoxItem( listboxObject, "Apples" ) |
IrrInsertListBoxItem |
Syntax IrrInsertListBoxItem ( parent as IRR_GUI_OBJECT, text as wstring, index as integer ) Description Insert a text element to a list box. listbox defines the listbox gui object to insert the string into. text is the string containing the new item index is the position at which to insert the item Example |
IrrInsertListBoxItem( listboxObject, "Pears", 3 ) |
IrrRemoveListBoxItem |
Syntax IrrRemoveListBoxItem ( parent as IRR_GUI_OBJECT, index as integer ) Description Remove a text element from a list box. listbox defines the listbox gui object to remove the string from. index is the position of the item to be removed Example |
IrrRemoveListBoxItem( listboxObject, 2 ) |
IrrSelectListBoxItem |
Syntax IrrSelectListBoxItem ( parent as IRR_GUI_OBJECT, index as integer ) Description Select a text element in a list box. listbox defines the listbox gui object to select the item within. index is the position of the item to be removed Example |
IrrSelectListBoxItem( listboxObject, 1 ) |
IrrAddEditBox |
Syntax IrrAddEditBox (text as wstring, horizontal as integer, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, id as integer, border as integer, password as integer, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Add a editbox object containing a list of items to the GUI display. text is the string that is inserted into the editbox Top X, Top Y, Bottom X and Bottom Y define a box in which the editbox is drawn id specifies a unique numerical reference for the editbox so events can be identified as coming from this object border specifies whether the object has a border drawn around it. acceptable values are: - IRR_GUI_NO_BORDER IRR_GUI_BORDER password specifies whether the editbox is a password field that hides the text typed into it. acceptable values are: - IRR_GUI_PASSWORD IRR_GUI_NOT_PASSWORD Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
editboxObject = IrrAddEditBox( "My String", 16,16,96,32, 120, IRR_GUI_BORDER, IRR_GUI_NOT_PASSWORD, windowObject ) |
IrrAddCheckBox |
Syntax IrrAddCheckBox (text as wstring, horizontal as integer, Top X as integer, Top Y as integer, Bottom X as integer, Bottom Y as integer, id as integer, checked as integer, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Add a checkbox object to the GUI display. text is the string that is used to label the checkbox Top X, Top Y, Bottom X and Bottom Y define a box in which the checkbox is drawn id specifies a unique numerical reference for the checkbox so events can be identified as coming from this object checked specifies whether the object starts in the checked state. acceptable values are: - IRR_OFF IRR_ON Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
checkboxObject = IrrAddCheckBox( "My Checkbox", 16,16,96,32, 120, IRR_OFF, windowObject ) |
IrrCheckCheckBox |
Syntax IrrCheckCheckBox ( checkbox as IRR_GUI_OBJECT, checked as integer ) Description Set the checked state of a checkbox. checkbox defines the checkbox GUI object to check or uncheck. checked specifies whether the object starts in the checked state. acceptable values are: - IRR_OFF IRR_ON Example |
IrrCheckCheckBox( checkboxObject, IRR_ON ) |
IrrAddImage |
Syntax IrrAddImage (texture as IRR_TEXTURE, horizontal as integer, X as integer, Y as integer, useAlpha as integer, id as integer, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Add an image object to the GUI display. texture is a loaded texture object that is to be displayed X, Y define a position at which the image is drawn useAlpha specifies whether the alpha channel of the texture is to be used. acceptable values are: - IRR_IGNORE_ALPHA IRR_USE_ALPHA id specifies a unique numerical reference for the image so events can be identified as coming from this object Parent defines the parent object of this window. This can be ommited if the object has no parent. Example |
imageObject = IrrAddImage( texture, 16,16, IRR_IGNORE_ALPHA, 120, windowObject ) |
IrrAddFileOpen |
Syntax IrrAddFileOpen (title as wstring, id as integer, checked as integer, modal as integer, parent as IRR_GUI_OBJECT ) as IRR_GUI_OBJECT Description Open a modal file open dialog so that a file can be selected. title is the string that is displayed in the titlebar of the file selector window. id specifies a unique numerical reference for the button so events can be identified as coming from this object Modal determines if the window locks out the rest of the interface until it is closed: - IRR_GUI_MODAL IRR_GUI_NOT_MODAL Parent defines the parent object of this window. This can be ommited if the window has no parent. Example |
fileOpenObject = IrrAddFileOpen( "Select a bitmap", 120, IRR_GUI_MODAL, windowObject ) |
IrrGetLastSelectedFile |
Syntax IrrGetLastSelectedFile ( fileopenobject as IRR_GUI_OBJECT, checked as integer ) Description Get the last file name selected from a file selection dialog. Example |
fileName = IrrGetLastSelectedFile() |
IRR_MOUSE_EVENT |
action
as uinteger Action determines which mouse action took place and can be one of the following values: - IRR_EMIE_LMOUSE_PRESSED_DOWN IRR_EMIE_RMOUSE_PRESSED_DOWN IRR_EMIE_MMOUSE_PRESSED_DOWN IRR_EMIE_LMOUSE_LEFT_UP IRR_EMIE_RMOUSE_LEFT_UP IRR_EMIE_MMOUSE_LEFT_UP IRR_EMIE_MOUSE_MOVED IRR_EMIE_MOUSE_WHEEL delta as single This defines the amount of movement of the mouse wheel. x as integer y as integer These define the screen co-ordinates at which the event took place. |
IRR_KEY_EVENT |
key
as uinteger The scan code for the key direction as uinteger Whether the key moved up or down, this can be either of: - IRR_KEY_UP IRR_KEY_DOWN flags as uinteger Bits are set in this parameter to specify whether the shift or control key was keydown at the time the key action occured |
IRR_PARTICLE_EMITTER |
min_box_x
as single min_box_y as single min_box_z as single max_box_x as single max_box_y as single max_box_z as single These six parameters define a box in space inside which the position of a particle is randomly created. direction_x as single direction_y as single direction_z as single These three parameters define a direction into which the particles will be ejected as the animation plays min_paritlcles_per_second as uinteger max_paritlcles_per_second as uinteger A range defining the minimum and maximum number of particles that will be created each second. min_start_color_red as integer min_start_color_green as integer min_start_color_blue as integer max_start_color_red as integer max_start_color_green as integer max_start_color_blue as integer Although particles can be textured by texturing the particle system node, these can be used to apply a range that tints the color of the particles. min_lifetime as uinteger max_lifetime as uinteger How long the partilce will live, long lifespans can create very large numbers of particles min_start_sizeX as single min_start_sizeY as single max_start_sizeX as single max_start_sizeY as single The minimum and maximum start sizes for the particles. max_angle_degrees as integer The maximum number of degrees that the ejected particles will deviate from the defined direction |
IRR_VERT |
A vertex is a point is space that also defines a number
of properties that can be applied to the corner of a triangle. x as single y as single z as single The 3D position of the vertex normal_x as single normal_y as single normal_z as single The normal direction of the vertex vcolor as uinteger The 32bit ARGB color of the vertex texture_x as single texture_y as single The 2 dimensional co-ordinate of the vertex when it is mapped to an applied texture (0 to 1) |
IRR_VECTOR |
x
as single y as single z as single A point that can be use for co-ordinates, directions or speeds. |