protected void _createLaser() { var laserParams = new SLaserParameters(); laserParams.numBeams = rand.Next(1, 6); if (laserParams.numBeams == 2) { // 2's don't look too great laserParams.numBeams = 1; } laserParams.beamStartPlacementScale = 2f * (float)rand.NextDouble(); laserParams.beamDestSpread = (float)Math.Pow(rand.NextDouble(), 3.0) * laserParams.beamStartPlacementScale; laserParams.backgroundColor = Color4Helper.RandomDebugColor(); laserParams.overlayColor = Color4.White; laserParams.middleInterferenceColor = Color4.White; //laserParams.driftModulationFuncStr = (rand.NextDouble() * 0.1).ToString(); var newLaser = laserManager.addLaser(laserParams, droneObj1, droneObj2); newLaser.sourceTxfm = laserSourceTxfm; newLaser.beamObstacles = new List <SSObject> (); newLaser.beamObstacles.Add(droneObj2); activeLaser.Target = newLaser; }
public SSpaceMissileRenderInfo(SSpaceMissileVisualData missile) { this.missile = missile; var mParams = missile.parameters as SSpaceMissileVisualParameters; bodyObj = new SSObjectMesh(mParams.missileBodyMesh()); bodyObj.Scale = new Vector3(mParams.missileBodyScale); bodyObj.renderState.castsShadow = false; bodyObj.renderState.receivesShadows = false; //bodyObj.renderState.visible = false; bodyObj.Name = "a missile body"; #if MISSILE_DEBUG debugRays = new MissileDebugRays(missile); debugCountdown = new SSObject2DSurface_AGGText(); debugCountdown.Size = 2f; debugCountdown.MainColor = Color4Helper.RandomDebugColor(); #endif flameSmokeEmitter = new SSRadialEmitter(); flameSmokeEmitter.effectorMask = (ushort)ParticleEffectorMasks.EjectionSmoke; flameSmokeEmitter.life = mParams.flameSmokeDuration; flameSmokeEmitter.color = new Color4(1f, 1f, 1f, 1f); flameSmokeEmitter.billboardXY = true; flameSmokeEmitter.particlesPerEmissionMin = mParams.smokePerEmissionMin; flameSmokeEmitter.particlesPerEmissionMax = mParams.smokePerEmissionMax; flameSmokeEmitter.spriteRectangles = mParams.smokeSpriteRects; //smokeEmitter.phiMin = 0f; //smokeEmitter.phiMax = (float)Math.PI/6f; flameSmokeEmitter.phiMin = (float)Math.PI / 3f; flameSmokeEmitter.phiMax = (float)Math.PI / 2f; flameSmokeEmitter.orientationMin = new Vector3(0f, 0f, 0f); flameSmokeEmitter.orientationMax = new Vector3(0f, 0f, 2f * (float)Math.PI); flameSmokeEmitter.angularVelocityMin = new Vector3(0f, 0f, -1f); flameSmokeEmitter.angularVelocityMax = new Vector3(0f, 0f, +1f); flameSmokeEmitter.radiusOffsetMin = 0f; flameSmokeEmitter.radiusOffsetMax = 0.1f; // positions emitters and mesh preRenderUpdate(0f); }