Changeset 4336 in orxonox.OLD for orxonox/branches/physics/src/subprojects
- Timestamp:
- May 27, 2005, 8:22:54 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/subprojects/particles/particle_fun.cc
r4335 r4336 44 44 break; 45 45 } 46 47 } 48 46 } 49 47 } 50 48 … … 62 60 void Framework::moduleHelp(void) const 63 61 { 64 PRINT(0)("i - state Information\n\n"); 62 PRINT(0)("\n"); 63 PRINT(0)("i - Particle-state Information\n\n"); 65 64 PRINT(0)("\n"); 66 65 … … 71 70 Option* option = (Option*) widget; 72 71 const char* name = option->getTitle(); 73 char* valueC = option->save(); 74 float value = atof(valueC); 72 char* value = option->save(); 75 73 76 74 ParticleEmitter* tmpEmit = ParticleEngine::getInstance()->getEmitterByNumber(1); … … 79 77 if (!strcmp(name, "EmissionRate")) 80 78 { 81 tmpEmit->setEmissionRate( value);82 PRINT(3)("EmissionRate set to %f\n", value);79 tmpEmit->setEmissionRate(atof(value)); 80 PRINT(3)("EmissionRate set to %f\n", atof(value)); 83 81 } 84 82 else if (!strcmp(name, "Velocity")) 85 83 { 86 tmpEmit->setEmissionVelocity( value);87 PRINT(3)("Velocity set to %f\n", value);84 tmpEmit->setEmissionVelocity(atof(value)); 85 PRINT(3)("Velocity set to %f\n", atof(value)); 88 86 } 89 87 else if(!strcmp(name, "SpreadAngle")) 90 88 { 91 tmpEmit->setSpread( value);92 PRINT(3)("SpreadAngle set to %f\n", value);89 tmpEmit->setSpread(atof(value)); 90 PRINT(3)("SpreadAngle set to %f\n", atof(value)); 93 91 } 94 92 else if(!strcmp(name, "EmitterType")) 95 93 { 96 if (!strcmp(value C, "EMITTER_DOT"))94 if (!strcmp(value, "EMITTER_DOT")) 97 95 tmpEmit->setType(EMITTER_DOT); 98 else if (!strcmp(value C, "EMITTER_PLANE"))96 else if (!strcmp(value, "EMITTER_PLANE")) 99 97 tmpEmit->setType(EMITTER_PLANE); 100 else if (!strcmp(value C, "EMITTER_CUBE"))98 else if (!strcmp(value, "EMITTER_CUBE")) 101 99 tmpEmit->setType(EMITTER_CUBE); 102 PRINT(3)("EmitterType set to %s\n", value C);100 PRINT(3)("EmitterType set to %s\n", value); 103 101 } 104 102 else if(!strcmp(name, "EmitterSize")) 105 103 { 106 tmpEmit->setSize( value);107 PRINT(3)("EmitterSize set to %f\n", value);108 } 109 } 110 delete value C;104 tmpEmit->setSize(atof(value)); 105 PRINT(3)("EmitterSize set to %f\n", atof(value)); 106 } 107 } 108 delete value; 111 109 } 112 110 … … 116 114 Option* option = (Option*) widget; 117 115 const char* name = option->getTitle(); 118 char* value C= option->save();119 float value = atof(valueC);116 char* value = option->save(); 117 printf("%s\n", value); 120 118 121 119 ParticleSystem* tmpSys = ParticleEngine::getInstance()->getSystemByNumber(1); … … 124 122 if (!strcmp(name, "StartRadius")) 125 123 { 126 tmpSys->setRadius( value, tmpSys->getEndRadius());127 PRINT(3)("ParticleStartRadius set to %f\n", value);124 tmpSys->setRadius(atof(value), tmpSys->getEndRadius()); 125 PRINT(3)("ParticleStartRadius set to %f\n", atof(value)); 128 126 } 129 127 else if (!strcmp(name, "EndRadius")) 130 128 { 131 tmpSys->setRadius( tmpSys->getStartRadius(), value);132 PRINT(3)("ParticleEndRadius set to %f\n", value);129 tmpSys->setRadius( tmpSys->getStartRadius(), atof(value)); 130 PRINT(3)("ParticleEndRadius set to %f\n", atof(value)); 133 131 } 134 132 135 133 else if (!strcmp(name, "LifeSpan")) 136 134 { 137 tmpSys->setLifeSpan( value);138 PRINT(3)("ParticleLifeSpan set to %f\n", value);135 tmpSys->setLifeSpan(atof(value)); 136 PRINT(3)("ParticleLifeSpan set to %f\n", atof(value)); 139 137 } 140 138 141 139 else if (!strcmp(name, "ConserveFactor")) 142 140 { 143 tmpSys->setConserve( value);144 PRINT(3)("ParticleConserveFactor set to %f\n", value);141 tmpSys->setConserve(atof(value)); 142 PRINT(3)("ParticleConserveFactor set to %f\n", atof(value)); 145 143 } 146 144 147 145 else if (!strcmp(name, "ParticleType")) 148 146 { 149 if (!strcmp(value C, "PARTICLE_DOT"))147 if (!strcmp(value, "PARTICLE_DOT")) 150 148 tmpSys->setType(PARTICLE_DOT); 151 else if (!strcmp(value C, "PARTICLE_SPARK"))149 else if (!strcmp(value, "PARTICLE_SPARK")) 152 150 tmpSys->setType(PARTICLE_SPARK); 153 else if (!strcmp(value C, "PARTICLE_SPRITE"))151 else if (!strcmp(value, "PARTICLE_SPRITE")) 154 152 tmpSys->setType(PARTICLE_SPRITE); 155 153 156 PRINT(3)("ParticleType set to %s\n", value C);154 PRINT(3)("ParticleType set to %s\n", value); 157 155 } 158 156 159 157 else if (!strcmp(name, "InheritSpeed")) 160 158 { 161 tmpSys->setInheritSpeed( value);162 PRINT(3)("ParticleInheritSpeed set to %f\n", value);163 } 164 165 } 166 delete value C;159 tmpSys->setInheritSpeed(atof(value)); 160 PRINT(3)("ParticleInheritSpeed set to %f\n", atof(value)); 161 } 162 163 } 164 delete value; 167 165 } 168 166
Note: See TracChangeset
for help on using the changeset viewer.