Create Projectile from C
by Stephane Savioz · in Torque Game Engine · 09/14/2005 (7:11 am) · 2 replies
How to create a projectile from the C++ code :
I've tried the following code :
ProjectileData* projData = new ProjectileData();
projData->projectileShapeName = "d:/torque/heidi/control/data/models/3dstest/sphere.dts";
projData->muzzleVelocity = 1; //Speed of the Projectile when fired
projData->velInheritFactor = 0; //[0,1] scale of how much velocity should be inherited from the parent object
projData->armingDelay = 0 ; //0.3;
projData->lifetime = 50000;
projData->fadeDelay = 50000;
projData->bounceElasticity = 0;
projData->bounceFriction = 0;
projData->isBallistic = true;
projData->gravityMod = 0.10;
projData->hasLight = false;
projData->lightRadius = 1.5;
ColorF colLight(0.56, 0.36, 0.26, 1.0);
projData->lightColor = colLight;
mMissile = new Projectile();
mMissile->setDataBlock(projData);
Is that the correct way to do it ?
I've tried the following code :
ProjectileData* projData = new ProjectileData();
projData->projectileShapeName = "d:/torque/heidi/control/data/models/3dstest/sphere.dts";
projData->muzzleVelocity = 1; //Speed of the Projectile when fired
projData->velInheritFactor = 0; //[0,1] scale of how much velocity should be inherited from the parent object
projData->armingDelay = 0 ; //0.3;
projData->lifetime = 50000;
projData->fadeDelay = 50000;
projData->bounceElasticity = 0;
projData->bounceFriction = 0;
projData->isBallistic = true;
projData->gravityMod = 0.10;
projData->hasLight = false;
projData->lightRadius = 1.5;
ColorF colLight(0.56, 0.36, 0.26, 1.0);
projData->lightColor = colLight;
mMissile = new Projectile();
mMissile->setDataBlock(projData);
Is that the correct way to do it ?
Associate Kyle Carter