55 MMechostr(MSKDEBUG,
"SO3ParticleSystemCreateFromTemplate\n");
61 if ((s == NIL) || (temp == NIL) || (name == NIL))
67 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
74 std::string tmpParticleSystemName(MMstartstr(m, MTOP(name)));
75 std::string tmpParticleSystemtTemplate(MMstartstr(m, MTOP(temp)));
76 SParticleSystem* particlesystem = 0;
80 particlesystem = scene->CreateParticleSystem(tmpParticleSystemName, tmpParticleSystemtTemplate);
82 catch (Ogre::Exception& e)
84 MMechostr(MSKDEBUG,
"An exception has occurred: %s\n", e.what());
106 MMechostr(MSKDEBUG,
"SO3ParticleSystemGetTemplate\n");
116 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
123 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
129 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
130 if (particlesystem == 0)
136 return Mpushstrbloc(m, (
char*)(particlesystem->GetParticleTemplateName().c_str()));
152 MMechostr(MSKDEBUG,
"SO3ParticleSystemSetEnable\n");
155 int b = MTOI(MMpull(m));
156 int ps = MMget(m, 0);
157 if ((ps == NIL) || (b == NIL))
163 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
170 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
175 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
178 particlesystem->SetEnable(
false);
180 particlesystem->SetEnable(
true);
182 MMset(m, 0, ITOM(1));
199 MMechostr(MSKDEBUG,
"SO3ParticleSystemGetEnable\n");
202 int ps = MMget(m, 0);
209 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
216 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
221 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
224 if (particlesystem->GetEnable())
227 MMset(m, 0, ITOM(val));
244 MMechostr(MSKDEBUG,
"SO3ParticleSystemSetPause\n");
247 int b = MTOI(MMpull(m));
248 int ps = MMget(m, 0);
249 if ((ps == NIL) || (b == NIL))
255 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
262 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
267 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
270 particlesystem->SetPaused(
false);
272 particlesystem->SetPaused(
true);
274 MMset(m, 0, ITOM(1));
290 MMechostr(MSKDEBUG,
"SO3ParticleSystemGetPause\n");
293 int ps = MMget(m, 0);
300 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
307 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
312 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
315 if (particlesystem->GetPaused())
318 MMset(m, 0, ITOM(val));
335 MMechostr(MSKDEBUG,
"SO3ParticleSystemSetSpeedFactor\n");
339 int ps = MMget(m, 0);
340 if ((ps == NIL) || (sf == NIL))
346 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
353 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
358 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
360 particlesystem->SetSpeed(MTOF(sf));
361 MMset(m, 0, ITOM(1));
377 MMechostr(MSKDEBUG,
"SO3ParticleSystemGetSpeedFactor\n");
380 int ps = MMget(m, 0);
387 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
394 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
399 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
401 MMset(m, 0, FTOM(particlesystem->GetSpeed()));
417 MMechostr(MSKDEBUG,
"SO3ParticleSystemClear\n");
420 int ps = MMget(m, 0);
427 SNode* node = MMgetPointer<SNode*>(m, MTOP(ps));
434 if (node->GetNodeType() != SNode::PARTICLE_SYSTEM_TYPE_ID)
439 SParticleSystem* particlesystem =
static_cast<SParticleSystem*
> (node);
441 particlesystem->ClearParticles();
442 MMset(m, 0, ITOM(1));
int SCOLloadParticle(mmachine m, cbmachine w)
Load the SO3Engine Viewport function.
NativeDefinition natSO3Particle[]
int SCOLfreeParticle()
free the SO3Engine Viewport function
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
int createObject(mmachine m, SNode *curNode, SScene *curScene)
int SO3ParticleSystemGetTemplate(mmachine m)
SO3ParticleSystemGetTemplate : Get the template for particle system.
int SO3ParticleSystemGetSpeedFactor(mmachine m)
SO3ParticleSystemGetSpeedFactor : Get the speed factor for particle system.
int SO3ParticleSystemSetEnable(mmachine m)
SO3ParticleSystemSetEnable : Set the Enable state for particle system.
int SO3ParticleSystemSetSpeedFactor(mmachine m)
SO3ParticleSystemSetSpeedFactor : Set the speed factor for particle system.
int SO3ParticleSystemClear(mmachine m)
SO3ParticleSystemClear : Clear a set of particle for a given particle system.
int SO3ParticleSystemGetEnable(mmachine m)
SO3ParticleSystemGetEnable : Get the enable state for particle system.
int SO3ParticleSystemGetPause(mmachine m)
SO3ParticleSystemGetPause : Get the pause state for particle system.
int SO3ParticleSystemSetPause(mmachine m)
SO3ParticleSystemSetPause : Set the pause state for particle system.
int SO3ParticleSystemCreateFromTemplate(mmachine m)
main include