1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]> 2<html xml:lang="en-US" lang="en-US"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/document.css" type="text/css" /> 7 <title>Simplest Method of Using Particles</title> 8 </head> 9 <body> 10 <h1>Simplest Method of Using Particles</h1> 11 <div class="section"> 12 <p>This page describes the content of <a href="../demo/ParticleDemo.html">ParticleDemo</a>.</p> 13 <h2>Creating an instance from a resource</h2> 14 <p>This demo loads a resource and creates an instance from <a href="../../../nw/gfx/res/ResGraphicsFile/GetModels.html">ResModelArray</a> and <a href="../../../nw/gfx/res/ResGraphicsFile/GetEmitters.html">ResEmitterArray</a>. At this time, the SceneObject (specifically, the <a href="../../../nw/gfx/ParticleModel/Overview.html">ParticleModel</a> or <a href="../../../nw/gfx/ParticleEmitter/Overview.html">ParticleEmitter) created by <a href="../../../nw/gfx/SceneBuilder/Overview.html">SceneBuilder</a>::<a href="../../../nw/gfx/SceneBuilder/CreateObject.html">CreateObject</a> is stored for reference resolution purposes.</p> 15 <h2>Resolving the node hierarchical structure</h2> 16 <p>The reference structure of nodes is resolved using <a href="../../../nw/gfx/SceneHelper/Overview.html">SceneHelper</a>::<a href="../../../nw/gfx/SceneHelper/ResolveReference.html">ResolveReference</a>.</p> 17 <h2>Initial setup of particle-related nodes</h2> 18 <p>The following initial setup is performed by <a href="../../../nw/gfx/ParticleUtil/SetupParticleObject.html">SetupParticleObject</a>.</p> 19 <ul> 20 <li>Resolving references</li> 21 <li>Initializing random numbers</li> 22 </ul> 23 <h3>Resolving references</h3> 24 <p>Because references to a <a href="../../../nw/gfx/ParticleSet/Overview.html">ParticleSet</a> from a <a href="../../../nw/gfx/ParticleEmitter/Overview.html">ParticleEmitter</a> and references to a <a href="../../../nw/gfx/ParticleSet/Overview.html">ParticleSet</a> from a <a href="../../../nw/gfx/res/ResParticleChildUpdater/Overview.html">ResParticleChildUpdater</a> are not resolved, they are resolved here. References are resolved within an array given as an argument. Within this scope, there is no problem as long as names do not conflict. The array is passed as an argument in order to explicitly limit the scope of references. This is useful when creating mutliple instances from a single resource.</p> 25 <h3>Initializing random numbers</h3> 26 <p>The random number type is set for each <a href="../../../nw/gfx/ParticleEmitter/Overview.html">ParticleEmitter</a> and <a href="../../../nw/gfx/ParticleSet/Overview.html">ParticleSet</a> based on the random number for <a href="../../../nw/gfx/ParticleContext/Overview.html">ParticleSceneContext</a>.</p> 27 <h2>Adding to the scene tree</h2> 28 <p>After references have been resolved for the <a href="../../../nw/gfx/SceneNode/Overview.html">SceneNode</a>, it is added to the scene tree. 3D models (SkeletalModel) and particles can be mixed together in the scene tree. Configure the tree according the your application design.</p> 29 <p>The description up to here is in preparation for creating objects. The description from here on regards processing performed for each frame.</p> 30 <h2>Updating gfx</h2> 31 <p>Processing equivalent to that performed by <a href="../../../nw/demo/SceneSystem/UpdateScene.html">nw::demo::SceneSystem::UpdateScene</a> is executed. Nodes are updated. If necessary, you can process all gfx animations such as material animations.</p> 32 <h2>Updating particles</h2> 33 <p>Execute <a href="../../../nw/gfx/ParticleSceneUpdater/UpdateNode.html">nw::gfx::ParticleSceneUpdater::UpdateNode</a>. Here, particles are updated, and animation for emitter emission and particles is performed. <a href="../../../nw/gfx/ParticleContext/Overview.html">ParticleContext</a>, passed as an argument, is only for maintaining memory used temporarily, so just one is enough for the system.<br /> Because <a href="../../../nw/gfx/ParticleSceneUpdater/Overview.html">ParticleSceneUpdater</a> is also a class that includes only processing without saving status, it can be used.</p> 34 <h2>Rendering</h2> 35 <p>Execute normal gfx rendering. There is no specific processing for particles at the application level. </p> 36 </div> 37 <hr><p>CONFIDENTIAL</p></body> 38</html> 39