Changeset 18

Show
Ignore:
Timestamp:
02/01/07 21:48:23 (2 years ago)
Author:
JoeCoder
Message:

Added onUpdate() callback for all Nodes.
Corrected bug with flight dynamics in current demo.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doc/errors.txt

    r17 r18  
    88FATAL: fglX11FreeBuffer: firegl_FreeBuffer() failed! 
    99 
    10 [buildme.d with -D] 
    11 Error: unrecognized file extension ddoc 
  • trunk/doc/unresolved.txt

    r17 r18  
    55 
    66[Unresolved] 
    7  
    8 Q:  What happens when a light is added to a Node's list of lights and then 
    9 light.remove() is called? 
    10 A:  In theory, nothing, since it should hang around as long as that 
    11 reference to it exists. 
    127 
    138When the window is sized below about 1/4th the size of it's starting size, 
     
    3429std.perf and sdl_getticks inaccurate.  Need to test on linux 
    3530 
    36 The ship's rotation values are sometimes nan 
     31The end of the spring following the ship is way too close half the time. 
     32This is caused by tail.getAbsolutePosition() returning an incorrect result. 
     33The sort in Universe.update() changes the order of update between the spring head and tail 
     34if one is updated and the other isn't, positions will be different. 
     35Need to ensure that both have been updated before calling spring.update(). 
  • trunk/proj/buildme.d

    r16 r18  
    146146        flags~="g"; 
    147147        //flags~="gc"; 
    148         //flags~="unittest"; 
     148         
    149149    }else if (_release) 
    150150    {   flags~="O"; 
     
    158158        flags~="Dd"~doc_path; 
    159159    } 
     160    if (!_release) 
     161        flags~="unittest"; 
    160162    flags~="I"~imp_path; 
    161163    flags~="od"~obj_path;   // Set the object output directory 
  • trunk/proj/yage.cbp

    r16 r18  
    1 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><CodeBlocks_project_file><FileVersion major="1" minor="5" /><Project><Option title="Yage" /><Option pch_mode="2" /><Option default_target="" /><Option compiler="dmd" /><Option virtualFolders="" /><Build><Target title="Normal"><Option output="..\bin\yage.exe" prefix_auto="1" extension_auto="1" /><Option working_dir="..\bin" /><Option object_output="..\bin\obj\" /><Option type="1" /><Option compiler="dmd" /><Compiler><Add option="-unittest" /><Add option="-debug" /></Compiler></Target><Target title="Release"><Option output="..\bin\yage.exe" prefix_auto="1" extension_auto="1" /><Option object_output="..\bin\obj\" /><Option type="1" /><Option compiler="dmd" /><Compiler><Add option="-release" /><Add option="-O" /><Add option="-inline" /></Compiler></Target></Build><Compiler><Add directory="..\src" /></Compiler><Linker><Add library="..\lib\DerelictVorbis.lib" /><Add library="..\lib\derelictAL.lib" /><Add library="..\lib\derelictGL.lib" /><Add library="..\lib\DerelictGLU.lib" /><Add library="..\lib\DerelictOgg.lib" /><Add library="..\lib\DerelictSDL.lib" /><Add library="..\lib\DerelictSDLImage.lib" /><Add library="..\lib\DerelictUtil.lib" /></Linker><Unit filename="..\src\yage\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\freelist.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\horde.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\matrix.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\misc.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\plane.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\quatrn.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\timer.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\tree.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\vector.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\xml.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\gameobj.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\main.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\basenode.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\camera.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\graph.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\light.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\model.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\node.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\scene.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\sound.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\sprite.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\image.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\layer.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\material.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\model.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\resource.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\shader.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\sound.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\texture.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\ship.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\constant.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\device.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\input.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\log.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\render.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\universe.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\flyer.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\misc.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\repeater.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\spring.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit></Project></CodeBlocks_project_file> 
     1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><CodeBlocks_project_file><FileVersion major="1" minor="5" /><Project><Option title="Yage" /><Option pch_mode="2" /><Option default_target="" /><Option compiler="dmd" /><Option virtualFolders="" /><Build><Target title="Normal"><Option output="..\bin\yage.exe" prefix_auto="1" extension_auto="1" /><Option working_dir="..\bin" /><Option object_output="..\bin\obj\" /><Option type="1" /><Option compiler="dmd" /><Compiler><Add option="-unittest" /><Add option="-debug" /></Compiler></Target><Target title="Release"><Option output="..\bin\yage.exe" prefix_auto="1" extension_auto="1" /><Option object_output="..\bin\obj\" /><Option type="1" /><Option compiler="dmd" /><Compiler><Add option="-release" /><Add option="-profile" /><Add option="-O" /></Compiler></Target></Build><Compiler><Add directory="..\src" /></Compiler><Linker><Add library="..\lib\DerelictVorbis.lib" /><Add library="..\lib\derelictAL.lib" /><Add library="..\lib\derelictGL.lib" /><Add library="..\lib\DerelictGLU.lib" /><Add library="..\lib\DerelictOgg.lib" /><Add library="..\lib\DerelictSDL.lib" /><Add library="..\lib\DerelictSDLImage.lib" /><Add library="..\lib\DerelictUtil.lib" /></Linker><Unit filename="..\src\yage\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\freelist.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\horde.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\matrix.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\misc.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\plane.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\quatrn.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\timer.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\tree.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\vector.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\core\xml.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\gameobj.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\main.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\basenode.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\camera.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\graph.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\light.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\model.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\node.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\scene.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\sound.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\node\sprite.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\image.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\layer.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\material.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\model.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\resource.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\shader.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\sound.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\resource\texture.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\ship.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\constant.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\device.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\input.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\log.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\system\render.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\universe.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\all.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\flyer.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\misc.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\repeater.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit><Unit filename="..\src\yage\util\spring.d"><Option compilerVar="CPP" /><Option target="Normal" /><Option target="Release" /></Unit></Project></CodeBlocks_project_file> 
  • trunk/proj/yage.depend

    r16 r18  
    21211169430011 c:\myfiles\eric\current\yage\src\yage\core\freelist.d 
    2222 
    23 1169430014 c:\myfiles\eric\current\yage\src\yage\core\horde.d 
    24  
    25 1169615795 c:\myfiles\eric\current\yage\src\yage\core\matrix.d 
     231170136404 c:\myfiles\eric\current\yage\src\yage\core\horde.d 
     24 
     251169959015 c:\myfiles\eric\current\yage\src\yage\core\matrix.d 
    2626 
    27271169430019 c:\myfiles\eric\current\yage\src\yage\core\misc.d 
     
    29291169430022 c:\myfiles\eric\current\yage\src\yage\core\plane.d 
    3030 
    31 1169615763 c:\myfiles\eric\current\yage\src\yage\core\quatrn.d 
     311169958881 c:\myfiles\eric\current\yage\src\yage\core\quatrn.d 
    3232 
    33331169430029 c:\myfiles\eric\current\yage\src\yage\core\timer.d 
     
    61611168491929 c:\myfiles\eric\current\yage\src\yage\resource\shader.d 
    6262 
    63 1169481936 c:\myfiles\eric\current\yage\src\yage\resource\sound.d 
     631170134326 c:\myfiles\eric\current\yage\src\yage\resource\sound.d 
    6464 
    65651168491929 c:\myfiles\eric\current\yage\src\yage\resource\texture.d 
     
    7676    <yage/node/sound.d> 
    7777 
    78 1168491926 c:\myfiles\eric\current\yage\src\yage\node\basenode.d 
    79  
    80 1168491926 c:\myfiles\eric\current\yage\src\yage\node\camera.d 
    81  
    82 1168491926 c:\myfiles\eric\current\yage\src\yage\node\graph.d 
    83  
    84 1168491926 c:\myfiles\eric\current\yage\src\yage\node\light.d 
    85  
    86 1168491926 c:\myfiles\eric\current\yage\src\yage\node\model.d 
    87  
    88 1168491926 c:\myfiles\eric\current\yage\src\yage\node\node.d 
    89  
    90 1168491926 c:\myfiles\eric\current\yage\src\yage\node\scene.d 
    91  
    92 1168491926 c:\myfiles\eric\current\yage\src\yage\node\sprite.d 
    93  
    94 1168491926 c:\myfiles\eric\current\yage\src\yage\node\sound.d 
     781170306974 c:\myfiles\eric\current\yage\src\yage\node\basenode.d 
     79 
     801169950067 c:\myfiles\eric\current\yage\src\yage\node\camera.d 
     81 
     821169963397 c:\myfiles\eric\current\yage\src\yage\node\graph.d 
     83 
     841170135882 c:\myfiles\eric\current\yage\src\yage\node\light.d 
     85 
     861170302990 c:\myfiles\eric\current\yage\src\yage\node\model.d 
     87 
     881170309336 c:\myfiles\eric\current\yage\src\yage\node\node.d 
     89 
     901170130324 c:\myfiles\eric\current\yage\src\yage\node\scene.d 
     91 
     921169950242 c:\myfiles\eric\current\yage\src\yage\node\sprite.d 
     93 
     941169957954 c:\myfiles\eric\current\yage\src\yage\node\sound.d 
    9595 
    96961168491932 c:\myfiles\eric\current\yage\src\yage\util\all.d 
     
    1021021169494192 c:\myfiles\eric\current\yage\src\yage\util\flyer.d 
    103103 
    104 1169606588 c:\myfiles\eric\current\yage\src\yage\util\spring.d 
     1041170135636 c:\myfiles\eric\current\yage\src\yage\util\spring.d 
    105105 
    1061061168491932 c:\myfiles\eric\current\yage\src\yage\util\misc.d 
    107107 
    108 1168491932 c:\myfiles\eric\current\yage\src\yage\util\repeater.d 
     1081169948746 c:\myfiles\eric\current\yage\src\yage\util\repeater.d 
    109109 
    1101101168491923 c:\myfiles\eric\current\yage\src\yage\system\all.d 
     
    204204    <std/gc.d> 
    205205 
    206 1169430014 source:c:\myfiles\eric\current\yage\src\yage\core\horde.d 
    207     <std/stdio.d> 
    208     <yage/core/misc.d> 
    209  
    210 1169615795 source:c:\myfiles\eric\current\yage\src\yage\core\matrix.d 
     2061170136404 source:c:\myfiles\eric\current\yage\src\yage\core\horde.d 
     207    <std/stdio.d> 
     208    <yage/core/misc.d> 
     209 
     2101169959015 source:c:\myfiles\eric\current\yage\src\yage\core\matrix.d 
    211211    <std/math.d> 
    212212    <std/stdio.d> 
     
    231231    <yage/core/misc.d> 
    232232 
    233 1169615763 source:c:\myfiles\eric\current\yage\src\yage\core\quatrn.d 
     2331169958881 source:c:\myfiles\eric\current\yage\src\yage\core\quatrn.d 
    234234    <std/math.d> 
    235235    <std/stdio.d> 
     
    263263    <yage/core/misc.d> 
    264264 
    265 1169613989 source:c:\myfiles\eric\current\yage\src\yage\main.d 
     2651170347618 source:c:\myfiles\eric\current\yage\src\yage\main.d 
    266266    <std/string.d> 
    267267    <std/math.d> 
     
    281281    <yage/system/all.d> 
    282282 
    283 1169532538 c:\myfiles\eric\current\yage\src\yage\universe.d 
    284  
    285 1169614674 c:\myfiles\eric\current\yage\src\yage\ship.d 
     2831169963322 c:\myfiles\eric\current\yage\src\yage\universe.d 
     284 
     2851170134863 c:\myfiles\eric\current\yage\src\yage\ship.d 
    286286 
    2872871168491926 source:c:\myfiles\eric\current\yage\src\yage\node\all.d 
     
    296296    <yage/node/sound.d> 
    297297 
    298 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\basenode.d 
    299     <std/stdio.d> 
     2981170306974 source:c:\myfiles\eric\current\yage\src\yage\node\basenode.d 
     299    <std/stdio.d> 
     300    <std/traits.d> 
    300301    <yage/core/horde.d> 
    301302    <yage/core/misc.d> 
     
    304305    <yage/core/all.d> 
    305306 
    306 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\camera.d 
     3071169950067 source:c:\myfiles\eric\current\yage\src\yage\node\camera.d 
    307308    <std/math.d> 
    308309    <derelict/opengl/gl.d> 
     
    5375381168491950 c:\myfiles\eric\current\yage\src\derelict\openal\almanual.d 
    538539 
    539 1168491923 c:\myfiles\eric\current\yage\src\yage\system\render.d 
    540  
    541 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\graph.d 
     5401170309509 c:\myfiles\eric\current\yage\src\yage\system\render.d 
     541 
     5421169963397 source:c:\myfiles\eric\current\yage\src\yage\node\graph.d 
    542543    <std/stdio.d> 
    543544    <std/math.d> 
     
    554555    <yage/node/basenode.d> 
    555556 
    556 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\light.d 
     5571170135882 source:c:\myfiles\eric\current\yage\src\yage\node\light.d 
    557558    <std/math.d> 
    558559    <std/stdio.d> 
     
    568569    <yage/system/constant.d> 
    569570 
    570 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\model.d 
     5711170302990 source:c:\myfiles\eric\current\yage\src\yage\node\model.d 
    571572    <derelict/opengl/gl.d> 
    572573    <derelict/opengl/glext.d> 
     
    580581    <yage/node/basenode.d> 
    581582 
    582 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\node.d 
    583     <std/math.d> 
    584     <std/stdio.d> 
     5831170309336 source:c:\myfiles\eric\current\yage\src\yage\node\node.d 
     584    <std/math.d> 
     585    <std/stdio.d> 
     586    <std/traits.d> 
    585587    <derelict/opengl/gl.d> 
    586588    <derelict/opengl/glu.d> 
     
    596598    <yage/system/input.d> 
    597599 
    598 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\scene.d 
     6001170130324 source:c:\myfiles\eric\current\yage\src\yage\node\scene.d 
    599601    <derelict/opengl/gl.d> 
    600602    <derelict/openal/al.d> 
     
    604606    <yage/node/basenode.d> 
    605607 
    606 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\sound.d 
     6081169957954 source:c:\myfiles\eric\current\yage\src\yage\node\sound.d 
    607609    <std/math.d> 
    608610    <std/string.d> 
     
    617619    <yage/node/scene.d> 
    618620 
    619 1168491926 source:c:\myfiles\eric\current\yage\src\yage\node\sprite.d 
     6211169950242 source:c:\myfiles\eric\current\yage\src\yage\node\sprite.d 
    620622    <derelict/opengl/gl.d> 
    621623    <yage/resource/resource.d> 
     
    724726    <yage/resource/resource.d> 
    725727 
    726 1169481936 source:c:\myfiles\eric\current\yage\src\yage\resource\sound.d 
     7281170134326 source:c:\myfiles\eric\current\yage\src\yage\resource\sound.d 
    727729    <std/mmfile.d> 
    728730    <std/c/time.d> 
     
    756758    <yage/system/log.d> 
    757759 
    758 1169614674 source:c:\myfiles\eric\current\yage\src\yage\ship.d 
     7601170134863 source:c:\myfiles\eric\current\yage\src\yage\ship.d 
    759761    <std/stdio.d> 
    760762    <yage/core/all.d> 
     
    788790    <std/stdio.d> 
    789791 
    790 1168491923 source:c:\myfiles\eric\current\yage\src\yage\system\render.d 
     7921170309509 source:c:\myfiles\eric\current\yage\src\yage\system\render.d 
    791793    <derelict/opengl/gl.d> 
    792794    <derelict/opengl/glext.d> 
     
    801803    <yage/system/device.d> 
    802804    <yage/node/light.d> 
    803  
    804 1169532538 source:c:\myfiles\eric\current\yage\src\yage\universe.d 
     805    <yage/node/node.d> 
     806 
     8071169963322 source:c:\myfiles\eric\current\yage\src\yage\universe.d 
    805808    <std/math.d> 
    806809    <std/random.d> 
     
    837840    <yage/core/all.d> 
    838841 
    839 1168491932 source:c:\myfiles\eric\current\yage\src\yage\util\repeater.d 
     8421169948746 source:c:\myfiles\eric\current\yage\src\yage\util\repeater.d 
    840843    <std/thread.d> 
    841844    <std/c/time.d> 
    842845    <yage/core/timer.d> 
    843846 
    844 1169606588 source:c:\myfiles\eric\current\yage\src\yage\util\spring.d 
     8471170135636 source:c:\myfiles\eric\current\yage\src\yage\util\spring.d 
    845848    <std/stdio.d> 
    846849    <yage/core/all.d> 
     
    105710601167043260 c:\myfiles\eric\current\yage\src\derelict\openal\alfuncs.d 
    10581061 
    1059 1169490616 source:c:\myfiles\eric\current\yage\src\yage\gameobj.d 
     10621170139423 source:c:\myfiles\eric\current\yage\src\yage\gameobj.d 
    10601063    <std/math.d> 
    10611064    <std/stdio.d> 
     
    10701073    <yage/universe.d> 
    10711074 
    1072 1169490616 c:\myfiles\eric\current\yage\src\yage\gameobj.d 
    1073  
     10751170139423 c:\myfiles\eric\current\yage\src\yage\gameobj.d 
     1076 
  • trunk/proj/yage.layout

    r16 r18  
    1 <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><CodeBlocks_layout_file><ActiveTarget name="" /><File name="..\src\yage\main.d" open="1" top="1" tabpos="1"><Cursor position="593" topLine="11" /></File></CodeBlocks_layout_file> 
     1<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><CodeBlocks_layout_file><ActiveTarget name="Normal" /><File name="..\src\yage\main.d" open="1" top="1" tabpos="1"><Cursor position="1970" topLine="55" /></File><File name="..\src\yage\node\basenode.d" open="1" top="0" tabpos="4"><Cursor position="3291" topLine="11" /></File><File name="..\src\yage\node\camera.d" open="0" top="0" tabpos="0"><Cursor position="1914" topLine="41" /></File><File name="..\src\yage\node\light.d" open="0" top="0" tabpos="0"><Cursor position="9721" topLine="254" /></File><File name="..\src\yage\node\model.d" open="0" top="0" tabpos="0"><Cursor position="697" topLine="21" /></File><File name="..\src\yage\node\node.d" open="1" top="0" tabpos="3"><Cursor position="5134" topLine="104" /></File><File name="..\src\yage\node\sprite.d" open="1" top="0" tabpos="2"><Cursor position="717" topLine="13" /></File><File name="..\src\yage\resource\image.d" open="0" top="0" tabpos="0"><Cursor position="1489" topLine="42" /></File><File name="..\src\yage\resource\layer.d" open="0" top="0" tabpos="0"><Cursor position="0" topLine="18" /></File><File name="..\src\yage\resource\material.d" open="0" top="0" tabpos="0"><Cursor position="0" topLine="51" /></File><File name="..\src\yage\system\render.d" open="1" top="0" tabpos="5"><Cursor position="369" topLine="9" /></File><File name="..\src\yage\universe.d" open="0" top="0" tabpos="0"><Cursor position="1234" topLine="39" /></File></CodeBlocks_layout_file> 
  • trunk/proj/yage.map

    r16 r18  
    11 
    22 Start         Length     Name                   Class 
    3  0002:00000000 00053BFBH  _TEXT                  CODE 32-bit 
    4  0002:00053BFC 000001F8H  ICODE                  ICODE 32-bit 
     3 0002:00000000 0005459BH  _TEXT                  CODE 32-bit 
     4 0002:0005459C 000001F2H  ICODE                  ICODE 32-bit 
    55 0003:00000000 00000004H  .CRT$XIA               DATA 32-bit 
    66 0003:00000010 00000004H  .CRT$XIZ               DATA 32-bit 
     
    1212 0003:00000070 00000004H  .CRT$XTZ               DATA 32-bit 
    1313 0003:00000074 00000000H  IMP__DATA              IMP__DATA 32-bit 
    14  0003:00000080 00034CC4H  _DATA                  DATA 32-bit 
    15  0003:00034D44 00000000H  FMB                    DATA 32-bit 
    16  0003:00034D44 000001A0H  FM                     DATA 32-bit 
    17  0003:00034EE4 00000000H  FME                    DATA 32-bit 
    18  0003:00034EE4 00000000H  XIB                    DATA 32-bit 
    19  0003:00034EE4 00000018H  XI                     DATA 32-bit 
    20  0003:00034EFC 00000000H  XIE                    DATA 32-bit 
    21  0003:00034EFC 00000000H  XCB                    DATA 32-bit 
    22  0003:00034EFC 00000010H  XC                     DATA 32-bit 
    23  0003:00034F0C 00000000H  XCE                    DATA 32-bit 
    24  0003:00034F0C 00000000H  XIFCB                  DATA 32-bit 
    25  0003:00034F0C 00000004H  XIFU                   DATA 32-bit 
    26  0003:00034F10 00000000H  XIFL                   DATA 32-bit 
    27  0003:00034F10 00000004H  XIFM                   DATA 32-bit 
    28  0003:00034F14 00000000H  XIFCE                  DATA 32-bit 
    29  0003:00034F20 00000000H  CONST                  CONST 32-bit 
    30  0003:00034F20 00000000H  EEND                   ENDBSS 32-bit 
    31  0003:00034F20 00004C18H  _BSS                   BSS 32-bit 
    32  0003:00039B38 00000000H  XOB                    BSS 32-bit 
    33  0003:00039B38 00000004H  XO                     BSS 32-bit 
    34  0003:00039B3C 00000000H  XOE                    BSS 32-bit 
    35  0003:00039B3C 00000000H  XOFB                   BSS 32-bit 
    36  0003:00039B3C 00000108H  XOF                    BSS 32-bit 
    37  0003:00039C44 00000000H  XOFE                   BSS 32-bit 
    38  0003:00039C50 0000042DH  c_common               BSS 32-bit 
    39  0003:0003A080 00000000H  STACK                  STACK 32-bit 
     14 0003:00000080 00034DD4H  _DATA                  DATA 32-bit 
     15 0003:00034E54 00000000H  FMB                    DATA 32-bit 
     16 0003:00034E54 000001A0H  FM                     DATA 32-bit 
     17 0003:00034FF4 00000000H  FME                    DATA 32-bit 
     18 0003:00034FF4 00000000H  XIB                    DATA 32-bit 
     19 0003:00034FF4 00000018H  XI                     DATA 32-bit 
     20 0003:0003500C 00000000H  XIE                    DATA 32-bit 
     21 0003:0003500C 00000000H  XCB                    DATA 32-bit 
     22 0003:0003500C 00000010H  XC                     DATA 32-bit 
     23 0003:0003501C 00000000H  XCE                    DATA 32-bit 
     24 0003:0003501C 00000000H  XIFCB                  DATA 32-bit 
     25 0003:0003501C 00000004H  XIFU                   DATA 32-bit 
     26 0003:00035020 00000000H  XIFL                   DATA 32-bit 
     27 0003:00035020 00000004H  XIFM                   DATA 32-bit 
     28 0003:00035024 00000000H  XIFCE                  DATA 32-bit 
     29 0003:00035030 00000000H  CONST                  CONST 32-bit 
     30 0003:00035030 00000000H  EEND                   ENDBSS 32-bit 
     31 0003:00035030 00004C18H  _BSS                   BSS 32-bit 
     32 0003:00039C48 00000000H  XOB                    BSS 32-bit 
     33 0003:00039C48 00000004H  XO                     BSS 32-bit 
     34 0003:00039C4C 00000000H  XOE                    BSS 32-bit 
     35 0003:00039C4C 00000000H  XOFB                   BSS 32-bit 
     36 0003:00039C4C 00000108H  XOF                    BSS 32-bit 
     37 0003:00039D54 00000000H  XOFE                   BSS 32-bit 
     38 0003:00039D60 0000042DH  c_common               BSS 32-bit 
     39 0003:0003A190 00000000H  STACK                  STACK 32-bit 
    4040 
    41 Program entry point at 000484A0  
     41Program entry point at 00048E50  
  • trunk/src/yage/core/horde.d

    r15 r18  
    3535    protected uint count;       // number of elements currently in the horde. 
    3636    protected uint _reserve;    // reserve at least this much space in the array. 
    37     protected bool _ordered=false;// maintian order upon remove, sacrificing constant time removal. 
    3837 
    3938    unittest 
     
    5655    this(uint size) 
    5756    {   elements.length = size; 
     57        count=0; 
    5858        _reserve = size; 
    59         count=0; 
     59    } 
     60 
     61    /// Construct from an existing array. 
     62    this (T[] array) 
     63    {   elements = array; 
     64        count = elements.length; 
     65        _reserve = 0; 
    6066    } 
    6167 
  • trunk/src/yage/core/matrix.d

    r17 r18  
    5757 
    5858        // Matrices used in testing 
    59         Matrix[10] m; 
    60         m[ 0] = Matrix(); 
    61         m[ 1] = Vec3f(0, 0, 0).toMatrix().move(Vec3f(.1, 3, 0));//Matrix([0.0f,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]); 
    62         m[ 2] = Vec3f(0, 0, 1).toMatrix().move(Vec3f(.1, 3, 0)); 
    63         m[ 3] = Vec3f(1, 3, -1).toMatrix().move(Vec3f(2, -1, 1)); 
    64         m[ 4] = Vec3f(-.75, -1, -1.7).toMatrix().move(Vec3f(-1, 0, 4)); 
    65         m[ 5] = Vec3f(-.371, .1, -1.570796).toMatrix().move(Vec3f(1000, 2000, 4000)); 
    66         m[ 6] = Vec3f(0.0001, 0.0001, 0.0001).toMatrix(); 
    67         m[ 7] = Matrix([1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,1]); // Branch B of toQuatrn(); 
    68         m[ 8] = Matrix([-1,0,0,0, 0,1,0,0, 0,0,-1,0, 0,0,0,1]); // Branch C of toQuatrn(); 
    69         m[ 9] = Matrix([-1,0,0,0, 0,-1,0,0, 0,0,1,0, 0,0,0,1]); // Branch D of toQuatrn(); 
    70  
    71         //if (1 + v[0] + v[5] + v[10] >= 0.00000001) 
    72         //else if ((v[0]>v[5]) && (v[0]>v[10])) 
    73         //else if (v[5]>v[10]) 
    74         //else 
     59        Matrix[] m; 
     60        m~= Matrix(); 
     61        m~= Vec3f(0, 0, 0).toMatrix().move(Vec3f(.1, 3, 0));//Matrix([0.0f,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]); 
     62        m~= Vec3f(0, 0, 1).toMatrix().move(Vec3f(.1, 3, 0)); 
     63        m~= Vec3f(1, 3, -1).toMatrix().move(Vec3f(2, -1, 1)); 
     64        m~= Vec3f(-.75, -1, -1.7).toMatrix().move(Vec3f(-1, 0, 4)); 
     65        m~= Vec3f(-.371, .1, -1.570796).toMatrix().move(Vec3f(1000, 2000, 4000)); 
     66        m~= Vec3f(0.0001, 0.0001, 0.0001).toMatrix(); 
     67        m~= Matrix([1,0,0,0, 0,-1,0,0, 0,0,-1,0, 0,0,0,1]); // 7, Branch B of toQuatrn(); 
     68        m~= Matrix([-1,0,0,0, 0,1,0,0, 0,0,-1,0, 0,0,0,1]); // 8, Branch C of toQuatrn(); 
     69        m~= Matrix([-1,0,0,0, 0,-1,0,0, 0,0,1,0, 0,0,0,1]); // 9, Branch D of toQuatrn(); 
     70 
    7571        foreach (Matrix c; m) 
    7672        {   test("Transpose", c, c.transpose().transpose()); 
     
    7975            test("Inverse 2", Matrix(), c*c.inverse(), c); 
    8076            test("Identity", c, c*Matrix()); // [Below] compared this way because non-rotation values are lost. 
    81             //test("toQuatrn & toAxis", c.toAxis().toMatrix(), c.toQuatrn().toMatrix(), c); 
     77            test("toQuatrn & toAxis", c.toAxis().toMatrix(), c.toQuatrn().toMatrix(), c); 
    8278            Matrix res = c; 
    8379            res.set(c.toQuatrn()); 
     
    8682            foreach (Matrix d; m) 
    8783            {   test("Multiply & Inverse", c, c*d*d.inverse(), d); 
    88             //    test("MoveRelative", c, c.moveRelative(d.toAxis()).moveRelative(d.toAxis().inverse()), d); 
     84              test("MoveRelative", c, c.moveRelative(d.toAxis()).moveRelative(d.toAxis().inverse()), d); 
    8985                test("Rotate Matrix", c, c.rotate(d).rotate(d.inverse()), d); 
    90             //    test("Rotate Quatrn", c, c.rotate(d.toQuatrn()).rotate(d.toQuatrn().inverse()), d); 
     86              test("Rotate Quatrn", c, c.rotate(d.toQuatrn()).rotate(d.toQuatrn().inverse()), d); 
    9187                test("Rotate Axis", c, c.rotate(d.toAxis()).rotate(d.toAxis().inverse()), d); 
    9288 
  • trunk/src/yage/core/quatrn.d

    r15 r18  
    5050 
    5151        // Quaternions used in testing 
    52         Quatrn[13] q; 
    53         q[ 0] = Vec3f(0, 0, 0).toQuatrn(); 
    54         q[ 1] = Vec3f(1, 0, 0).toQuatrn(); 
    55         q[ 2] = Vec3f(0, 1, 0).toQuatrn(); 
    56         q[ 3] = Vec3f(0, 0, 1).toQuatrn(); 
    57         q[ 4] = Vec3f(.5, 0.0001, 2).toQuatrn(); 
    58         q[ 5] = Vec3f(.5, 1, -2).toQuatrn(); 
    59         q[ 6] = Vec3f(.5, -1, -2).toQuatrn(); 
    60         q[ 7] = Vec3f(-.75, -1, -1.7).toQuatrn(); 
    61         q[ 8] = Vec3f(-.65, -1, 2).toQuatrn(); 
    62         q[ 9] = Vec3f(-.55, 0.005, 1).toQuatrn(); 
    63         q[10] = Vec3f(-.371, .1, -1.570796).toQuatrn(); 
    64         q[11] = Vec3f(1.971, -2, 1.2).toQuatrn(); 
    65         q[12] = Vec3f(0.0001, 0.0001, 0.0001).toQuatrn(); 
     52        Quatrn[] q; 
     53        q~= Vec3f(0, 0, 0).toQuatrn(); 
     54        q~= Vec3f(1, 0, 0).toQuatrn(); 
     55        q~= Vec3f(0, 1, 0).toQuatrn(); 
     56        q~= Vec3f(0, 0, 1).toQuatrn(); 
     57        q~= Vec3f(.5, 0.0001, 2).toQuatrn(); 
     58        q~= Vec3f(.5, 1, -2).toQuatrn(); 
     59        q~= Vec3f(.5, -1, -2).toQuatrn(); 
     60        q~= Vec3f(-.75, -1, -1.7).toQuatrn(); 
     61        q~= Vec3f(-.65, -1, 2).toQuatrn(); 
     62        q~= Vec3f(-.55, 0.005, 1).toQuatrn(); 
     63        q~= Vec3f(-.371, .1, -1.570796).toQuatrn(); 
     64        q~= Vec3f(1.971, -2, 1.2).toQuatrn(); 
     65        q~= Vec3f(0.0001, 0.0001, 0.0001).toQuatrn(); 
    6666 
    6767        foreach (Quatrn c; q) 
     
    315315    {   double angle = acos(w)*2; 
    316316        double sin_a = sqrt(1.0 - w*w); 
    317         if (fabs(sin_a) < 0.0005) 
     317        if (fabs(sin_a) < 0.0005)  // arbitrary small number 
    318318            sin_a = 1; 
    319319        Vec3f axis; 
     
    321321        axis.y = y/sin_a; 
    322322        axis.z = z/sin_a; 
    323         axis = axis.length(angle); 
    324         return axis; 
     323        if (angle>0) 
     324            return axis.length(angle); 
     325        return Vec3f(); // zero vector, no rotation 
    325326    } 
    326327 
  • trunk/src/yage/gameobj.d

    r17 r18  
    6363    this (BaseNode parent) 
    6464    {   super(parent); 
     65        this.setLifetime(5); 
    6566 
    6667        SpriteNode flare = new SpriteNode(this); 
    6768        flare.setMaterial("fx/flare1.xml"); 
    68         flare.setLifetime(5); 
    6969        flare.setScale(2); 
    7070 
    7171        LightNode light = new LightNode(this); 
    7272        light.setDiffuse(1, .5, 0); 
    73         light.setLightRadius(100); 
     73        light.setLightRadius(256); 
    7474    } 
    7575} 
  • trunk/src/yage/main.d

    r17 r18  
    7272    Ship ship = new Ship(scene); 
    7373    ship.setPosition(Vec3f(0, 1000, 1300)); 
    74     ship.getCameraSpot().setPosition(0, 2000, 10000); 
     74    ship.getCameraSpot().setPosition(0, 1000, 1300); 
    7575    camera.setParent(ship.getCameraSpot()); 
    7676 
    7777    // Universe 
    78     scene.generate(300, 2000); 
     78    scene.generate(400, 2000); 
     79 
     80    void doSomething() 
     81    {   // Why do some functions work and others cause access violations? 
     82        star.setVelocity(1, 2, 3); 
     83        star.setVisible(true);      // causes access violation 
     84    } 
     85    star.onUpdate(&doSomething); 
    7986 
    8087    // main loop 
     
    8491    Input.mousedx = Input.mousedy = 0; 
    8592 
    86  
    8793    int fps = 0; 
    8894    //Input.setGrabMouse(true); 
     
    9197        dtime = delta.get(); 
    9298        delta.reset(); 
    93         dtime = 0.03; 
     99        //dtime = 0.03; 
    94100 
    95101        // check for exit 
     
    120126 
    121127        Input.processInput(); 
     128        ship.getSpring().update(dtime); 
    122129        scene.update(dtime); 
    123130        camera.toTexture(); 
  • trunk/src/yage/node/basenode.d

    r5 r18  
    88 
    99import std.stdio; 
     10import std.traits; 
    1011import yage.core.horde; 
    1112import yage.core.misc; 
     
    4041 
    4142    float lifetime = float.infinity;    // in seconds 
    42     BaseNode[] path;    // used in calcTransform 
     43    BaseNode[] path;                    // used in calcTransform 
     44 
     45    void delegate() on_update = null;   // called on update 
    4346 
    4447    public: 
     
    4649    /// Construct. 
    4750    this() 
    48     {   debug scope( failure ) writef("Backtrace xx "__FILE__"(",__LINE__,")\n"); 
     51    {   debug scope(failure) writef("Backtrace xx "__FILE__"(",__LINE__,")\n"); 
    4952        children = new Horde!(Node); 
    5053    } 
     
    9295    } 
    9396 
     97    /// Get the time before the Node will be removed. 
     98    float getLifetime() 
     99    {   return lifetime; 
     100    } 
    94101    /** 
    95102     * The Node will be removed (along with all of its children) after a given time. 
     
    101108    } 
    102109 
    103     /// Get the time before the Node will be removed. 
    104     float getLifetime() 
    105     {   return lifetime; 
    106     } 
     110    /** 
     111     * Set a function that will be called every time this Node is updated. 
     112     * Params: 
     113     * on_update = the function that will be called.  Use null as an argument to clear 
     114     * the function. 
     115     * Bugs: 
     116     * Certain Node methods cause access violations.  Perhaps this is a dmd bug? 
     117     * Example: 
     118     * -------------------------------- 
     119     * Node a = new Node(scene); 
     120     * 
     121     * void doSomething() 
     122     * {    self.setScale(a.getLifetime()); // Get smaller over time 
     123     * } 
     124     * a.setLifetime(5); 
     125     * a.onUpdate(&doSomething); 
     126     * --------------------------------*/ 
     127    void onUpdate(void delegate() on_update) 
     128    {   this.on_update = on_update; 
     129    } 
     130 
     131    /// Return a string representation of this Node for human reading. 
     132    char[] toString() 
     133    {   return toString(false); 
     134    } 
     135 
     136    /** 
     137     * Return a string representation of this Node for human reading. 
     138     * Params: 
     139     * recurse = Print this Node's children as well. */ 
     140    char[] toString(bool recurse) 
     141    {   static int indent; 
     142        char[] pad = new char[indent*3]; 
     143        pad[0..length] = ' '; 
     144 
     145        char[] result = pad ~ "[" ~ getType() ~ "]\n"; 
     146        if(parent) 
     147            result ~= pad~"Parent  : " ~ parent.getType() ~ "\n"; 
     148        result ~= pad~"Position: " ~ Vec3f(transform.v[12..15]).toString() ~ "\n"; 
     149        result ~= pad~"Rotation: " ~ transform.toAxis().toString() ~ "\n"; 
     150        result ~= pad~"Velocity: " ~ transform.toAxis().toString() ~ "\n"; 
     151        result ~= pad~"Angular : " ~ transform.toAxis().toString() ~ "\n"; 
     152        result ~= pad~"Children: " ~ std.string.toString(children.length) ~ "\n"; 
     153        delete pad; 
     154 
     155        if (recurse) 
     156        {   indent++; 
     157            foreach (Node c; children.array()) 
     158                result ~= c.toString(recurse); 
     159            indent--; 
     160        } 
     161 
     162        return result; 
     163    } 
     164 
     165    /// Update the positions and rotations of this Node and all children by delta seconds. 
     166    void update(float delta) 
     167    { 
     168        debug scope(failure) writef("Backtrace xx "__FILE__"(",__LINE__,")\n"); 
     169 
     170        // Call the onUpdate() function 
     171        if (on_update !is null) 
     172            on_update(); 
     173 
     174        // Decrement lifetime and remove children with < 0 lifetime. 
     175        // We iterate in reverse to ensure we hit all of them, since the last item 
     176        // is moved over the current item when removing from a Horde. 
     177        lifetime-= delta; 
     178        int i = children.length-1; 
     179        while (i>=0) 
     180        {   if (children[i].lifetime<=0) 
     181                children[i].remove(); 
     182            else 
     183                children[i].update(delta); //may as well update it in the same loop 
     184            i--; 
     185        } 
     186    } 
     187 
    107188 
    108189    /** 
     
    178259    } 
    179260 
    180     /// Return a string representation of this Node for human reading. 
    181     char[] toString() 
    182     {   return toString(false); 
    183     } 
    184  
    185     /** 
    186      * Return a string representation of this Node for human reading. 
    187      * Params: 
    188      * recurse = Print this Node's children as well. */ 
    189     char[] toString(bool recurse) 
    190     {   static int indent; 
    191         char[] pad = new char[indent*3]; 
    192         pad[0..length] = ' '; 
    193  
    194         char[] result = pad ~ "[" ~ getType() ~ "]\n"; 
    195         if(parent) 
    196             result ~= pad~"Parent  : " ~ parent.getType() ~ "\n"; 
    197         result ~= pad~"Position: " ~ Vec3f(transform.v[12..15]).toString() ~ "\n"; 
    198         result ~= pad~"Rotation: " ~ transform.toAxis().toString() ~ "\n"; 
    199         result ~= pad~"Velocity: " ~ transform.toAxis().toString() ~ "\n"; 
    200         result ~= pad~"Angular : " ~ transform.toAxis().toString() ~ "\n"; 
    201         result ~= pad~"Children: " ~ std.string.toString(children.length) ~ "\n"; 
    202         delete pad; 
    203  
    204         if (recurse) 
    205         {   indent++; 
    206             foreach (Node c; children.array()) 
    207                 result ~= c.toString(recurse); 
    208             indent--; 
    209         } 
    210  
    211         return result; 
    212     } 
    213  
    214     /// Update the positions and rotations of this Node and all children by delta seconds. 
    215     void update(float delta) 
    216     { 
    217         debug scope( failure ) writef("Backtrace xx "__FILE__"(",__LINE__,")\n"); 
    218  
    219         // Decrement lifetime and remove children with < 0 lifetime. 
    220         // We iterate in reverse to ensure we hit all of them, since the last item 
    221         // is moved over the current item when removing from a Horde. 
    222         lifetime-= delta; 
    223         int i = children.length-1; 
    224         while (i>=0) 
    225         {   if (children[i].lifeti